diff options
Diffstat (limited to 'src/common/mac')
-rw-r--r-- | src/common/mac/file_id.cc | 6 | ||||
-rw-r--r-- | src/common/mac/macho_walker.cc | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/common/mac/file_id.cc b/src/common/mac/file_id.cc index 50502e4c..b81cf834 100644 --- a/src/common/mac/file_id.cc +++ b/src/common/mac/file_id.cc @@ -90,8 +90,10 @@ void FileID::ConvertIdentifierToString(const unsigned char identifier[16], if (idx == 4 || idx == 6 || idx == 8 || idx == 10) buffer[buffer_idx++] = '-'; - buffer[buffer_idx++] = (hi >= 10) ? 'A' + hi - 10 : '0' + hi; - buffer[buffer_idx++] = (lo >= 10) ? 'A' + lo - 10 : '0' + lo; + buffer[buffer_idx++] = + static_cast<char>((hi >= 10) ? ('A' + hi - 10) : ('0' + hi)); + buffer[buffer_idx++] = + static_cast<char>((lo >= 10) ? ('A' + lo - 10) : ('0' + lo)); } // NULL terminate diff --git a/src/common/mac/macho_walker.cc b/src/common/mac/macho_walker.cc index 92da7b1f..eb915c39 100644 --- a/src/common/mac/macho_walker.cc +++ b/src/common/mac/macho_walker.cc @@ -111,7 +111,7 @@ bool MachoWalker::ReadBytes(void *buffer, size_t size, off_t offset) { if (offset + size > memory_size_) { if (static_cast<size_t>(offset) >= memory_size_) return false; - size = memory_size_ - offset; + size = memory_size_ - static_cast<size_t>(offset); result = false; } memcpy(buffer, static_cast<char *>(memory_) + offset, size); |