diff options
author | Roman Divacky <rdivacky@freebsd.org> | 2012-09-05 22:09:23 +0000 |
---|---|---|
committer | Roman Divacky <rdivacky@freebsd.org> | 2012-09-05 22:09:23 +0000 |
commit | 651e800defafb14ffb7905b9efa8423f1f5c215b (patch) | |
tree | d8287b6481e81d606bdfba89b6379bf30b52b540 /lib/Archive | |
parent | 141e99745adbd3ba9fa7315af3384c1d08c4c20c (diff) | |
download | external_llvm-651e800defafb14ffb7905b9efa8423f1f5c215b.zip external_llvm-651e800defafb14ffb7905b9efa8423f1f5c215b.tar.gz external_llvm-651e800defafb14ffb7905b9efa8423f1f5c215b.tar.bz2 |
Mark checkSignature const, and in turn stop casting away const from
ArchiveMemberHeader. Found by gcc48 -Wcast-qual.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163255 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Archive')
-rw-r--r-- | lib/Archive/ArchiveInternals.h | 2 | ||||
-rw-r--r-- | lib/Archive/ArchiveReader.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/Archive/ArchiveInternals.h b/lib/Archive/ArchiveInternals.h index 55684f7..639f5ac 100644 --- a/lib/Archive/ArchiveInternals.h +++ b/lib/Archive/ArchiveInternals.h @@ -66,7 +66,7 @@ namespace llvm { fmag[1] = '\n'; } - bool checkSignature() { + bool checkSignature() const { return 0 == memcmp(fmag, ARFILE_MEMBER_MAGIC,2); } }; diff --git a/lib/Archive/ArchiveReader.cpp b/lib/Archive/ArchiveReader.cpp index 5cfc810..5052495 100644 --- a/lib/Archive/ArchiveReader.cpp +++ b/lib/Archive/ArchiveReader.cpp @@ -79,7 +79,7 @@ Archive::parseMemberHeader(const char*& At, const char* End, std::string* error) } // Cast archive member header - ArchiveMemberHeader* Hdr = (ArchiveMemberHeader*)At; + const ArchiveMemberHeader* Hdr = (const ArchiveMemberHeader*)At; At += sizeof(ArchiveMemberHeader); int flags = 0; @@ -196,7 +196,7 @@ Archive::parseMemberHeader(const char*& At, const char* End, std::string* error) /* FALL THROUGH */ default: - char* slash = (char*) memchr(Hdr->name, '/', 16); + const char* slash = (const char*) memchr(Hdr->name, '/', 16); if (slash == 0) slash = Hdr->name + 16; pathname.assign(Hdr->name, slash - Hdr->name); |