diff options
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/mac/file_id.cc | 6 | ||||
-rw-r--r-- | src/common/mac/macho_walker.cc | 2 | ||||
-rw-r--r-- | src/common/string_conversion.cc | 2 |
3 files changed, 6 insertions, 4 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); diff --git a/src/common/string_conversion.cc b/src/common/string_conversion.cc index 27fb8cd9..5fa3496e 100644 --- a/src/common/string_conversion.cc +++ b/src/common/string_conversion.cc @@ -115,7 +115,7 @@ void UTF32ToUTF16Char(wchar_t in, u_int16_t out[2]) { } static inline u_int16_t Swap(u_int16_t value) { - return (value >> 8) | (value << 8); + return (value >> 8) | static_cast<uint16_t>(value << 8); } string UTF16ToUTF8(const vector<u_int16_t> &in, bool swap) { |