mirror of
https://git.suyu.dev/suyu/breakpad.git
synced 2026-03-05 20:16:32 +00:00
Turn on more warnings in ios / mac projects.
Make casts explicit. This makes casts that loose precision explicit, from here on we will get warnings. The changes in this commit are made without evaluating each cast, asuming the original casts were intentional. Patch by: jakerr@google.com Review: https://breakpad.appspot.com/453002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1046 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user