Fix "type qualifiers ignored on cast result type" warnings

These warnings start to get emitted with gcc-8.

llvm-svn: 356362
This commit is contained in:
Pavel Labath 2019-03-18 10:50:46 +00:00
parent dec963921b
commit f92ddfed5a
2 changed files with 10 additions and 13 deletions

View File

@ -162,7 +162,7 @@ UUID MinidumpParser::GetModuleUUID(const MinidumpModule *module) {
return UUID();
const CvSignature cv_signature =
static_cast<CvSignature>(static_cast<const uint32_t>(*signature));
static_cast<CvSignature>(static_cast<uint32_t>(*signature));
if (cv_signature == CvSignature::Pdb70) {
// PDB70 record
@ -263,9 +263,8 @@ ArchSpec MinidumpParser::GetArchitecture() {
llvm::Triple triple;
triple.setVendor(llvm::Triple::VendorType::UnknownVendor);
const MinidumpCPUArchitecture arch =
static_cast<const MinidumpCPUArchitecture>(
static_cast<const uint32_t>(system_info->processor_arch));
const MinidumpCPUArchitecture arch = static_cast<MinidumpCPUArchitecture>(
static_cast<uint32_t>(system_info->processor_arch));
switch (arch) {
case MinidumpCPUArchitecture::X86:
@ -285,8 +284,8 @@ ArchSpec MinidumpParser::GetArchitecture() {
break;
}
const MinidumpOSPlatform os = static_cast<const MinidumpOSPlatform>(
static_cast<const uint32_t>(system_info->platform_id));
const MinidumpOSPlatform os = static_cast<MinidumpOSPlatform>(
static_cast<uint32_t>(system_info->platform_id));
// TODO add all of the OSes that Minidump/breakpad distinguishes?
switch (os) {

View File

@ -19,11 +19,10 @@ const MinidumpHeader *MinidumpHeader::Parse(llvm::ArrayRef<uint8_t> &data) {
Status error = consumeObject(data, header);
const MinidumpHeaderConstants signature =
static_cast<const MinidumpHeaderConstants>(
static_cast<const uint32_t>(header->signature));
const MinidumpHeaderConstants version =
static_cast<const MinidumpHeaderConstants>(
static_cast<const uint32_t>(header->version) & 0x0000ffff);
static_cast<MinidumpHeaderConstants>(
static_cast<uint32_t>(header->signature));
const MinidumpHeaderConstants version = static_cast<MinidumpHeaderConstants>(
static_cast<uint32_t>(header->version) & 0x0000ffff);
// the high 16 bits of the version field are implementation specific
if (error.Fail() || signature != MinidumpHeaderConstants::Signature ||
@ -115,8 +114,7 @@ const MinidumpMiscInfo *MinidumpMiscInfo::Parse(llvm::ArrayRef<uint8_t> &data) {
}
llvm::Optional<lldb::pid_t> MinidumpMiscInfo::GetPid() const {
uint32_t pid_flag =
static_cast<const uint32_t>(MinidumpMiscInfoFlags::ProcessID);
uint32_t pid_flag = static_cast<uint32_t>(MinidumpMiscInfoFlags::ProcessID);
if (flags1 & pid_flag)
return llvm::Optional<lldb::pid_t>(process_id);