summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp
diff options
context:
space:
mode:
authorSimon Atanasyan <simon@atanasyan.com>2014-11-14 07:15:43 +0000
committerSimon Atanasyan <simon@atanasyan.com>2014-11-14 07:15:43 +0000
commit55c2699d29730d767def564befd2bf4ffbf9a3fe (patch)
treef14b1afdbfc94424a92b34ac64ab00797fff1e17 /lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp
parentc50a913f32b2d54714ea8fca0f9867e6bb8a875a (diff)
downloadbcm5719-llvm-55c2699d29730d767def564befd2bf4ffbf9a3fe.tar.gz
bcm5719-llvm-55c2699d29730d767def564befd2bf4ffbf9a3fe.zip
Follow-up to r221913. Fix some -Wcast-qual warning reasons.
llvm-svn: 221974
Diffstat (limited to 'lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp')
-rw-r--r--lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp b/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp
index 0884d3b2ec6..042cca7125d 100644
--- a/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp
+++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp
@@ -300,7 +300,7 @@ readBinary(std::unique_ptr<MemoryBuffer> &mb,
section.alignment = read32(&sect->align, isBig);
section.address = read64(&sect->addr, isBig);
const uint8_t *content =
- (uint8_t *)start + read32(&sect->offset, isBig);
+ (const uint8_t *)start + read32(&sect->offset, isBig);
size_t contentSize = read64(&sect->size, isBig);
// Note: this assign() is copying the content bytes. Ideally,
// we can use a custom allocator for vector to avoid the copy.
@@ -340,11 +340,11 @@ readBinary(std::unique_ptr<MemoryBuffer> &mb,
section.type = (SectionType)(read32(&sect->flags, isBig) &
SECTION_TYPE);
section.attributes =
- read32((uint8_t *)&sect->flags, isBig) & SECTION_ATTRIBUTES;
+ read32((const uint8_t *)&sect->flags, isBig) & SECTION_ATTRIBUTES;
section.alignment = read32(&sect->align, isBig);
section.address = read32(&sect->addr, isBig);
const uint8_t *content =
- (uint8_t *)start + read32(&sect->offset, isBig);
+ (const uint8_t *)start + read32(&sect->offset, isBig);
size_t contentSize = read32(&sect->size, isBig);
// Note: this assign() is copying the content bytes. Ideally,
// we can use a custom allocator for vector to avoid the copy.
@@ -367,8 +367,8 @@ readBinary(std::unique_ptr<MemoryBuffer> &mb,
const char *strings = start + read32(&st->stroff, isBig);
const uint32_t strSize = read32(&st->strsize, isBig);
// Validate string pool and symbol table all in buffer.
- if (read32((uint8_t *)&st->stroff, isBig) +
- read32((uint8_t *)&st->strsize, isBig) >
+ if (read32((const uint8_t *)&st->stroff, isBig) +
+ read32((const uint8_t *)&st->strsize, isBig) >
objSize)
return true;
if (is64) {
@@ -475,7 +475,7 @@ readBinary(std::unique_ptr<MemoryBuffer> &mb,
entry.offset = read32(&dataInCode[i].offset, isBig);
entry.length = read16(&dataInCode[i].length, isBig);
entry.kind =
- (DataRegionType)read16((uint8_t *)&dataInCode[i].kind, isBig);
+ (DataRegionType)read16((const uint8_t *)&dataInCode[i].kind, isBig);
f->dataInCode.push_back(entry);
}
}
OpenPOWER on IntegriCloud