[llvm-commits] [llvm] r163255 - in /llvm/trunk/lib/Archive: ArchiveInternals.h ArchiveReader.cpp
Roman Divacky
rdivacky at freebsd.org
Wed Sep 5 15:09:23 PDT 2012
Author: rdivacky
Date: Wed Sep 5 17:09:23 2012
New Revision: 163255
URL: http://llvm.org/viewvc/llvm-project?rev=163255&view=rev
Log:
Mark checkSignature const, and in turn stop casting away const from
ArchiveMemberHeader. Found by gcc48 -Wcast-qual.
Modified:
llvm/trunk/lib/Archive/ArchiveInternals.h
llvm/trunk/lib/Archive/ArchiveReader.cpp
Modified: llvm/trunk/lib/Archive/ArchiveInternals.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Archive/ArchiveInternals.h?rev=163255&r1=163254&r2=163255&view=diff
==============================================================================
--- llvm/trunk/lib/Archive/ArchiveInternals.h (original)
+++ llvm/trunk/lib/Archive/ArchiveInternals.h Wed Sep 5 17:09:23 2012
@@ -66,7 +66,7 @@
fmag[1] = '\n';
}
- bool checkSignature() {
+ bool checkSignature() const {
return 0 == memcmp(fmag, ARFILE_MEMBER_MAGIC,2);
}
};
Modified: llvm/trunk/lib/Archive/ArchiveReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Archive/ArchiveReader.cpp?rev=163255&r1=163254&r2=163255&view=diff
==============================================================================
--- llvm/trunk/lib/Archive/ArchiveReader.cpp (original)
+++ llvm/trunk/lib/Archive/ArchiveReader.cpp Wed Sep 5 17:09:23 2012
@@ -79,7 +79,7 @@
}
// Cast archive member header
- ArchiveMemberHeader* Hdr = (ArchiveMemberHeader*)At;
+ const ArchiveMemberHeader* Hdr = (const ArchiveMemberHeader*)At;
At += sizeof(ArchiveMemberHeader);
int flags = 0;
@@ -196,7 +196,7 @@
/* 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);
More information about the llvm-commits
mailing list