Mark checkSignature const, and in turn stop casting away const from

ArchiveMemberHeader. Found by gcc48 -Wcast-qual.

llvm-svn: 163255
This commit is contained in:
Roman Divacky 2012-09-05 22:09:23 +00:00
parent 4906050a4d
commit 84d5745fdc
2 changed files with 3 additions and 3 deletions

View File

@ -66,7 +66,7 @@ namespace llvm {
fmag[1] = '\n';
}
bool checkSignature() {
bool checkSignature() const {
return 0 == memcmp(fmag, ARFILE_MEMBER_MAGIC,2);
}
};

View File

@ -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);