From f1489baeb7376ea1e1041de09e24a67a05e11a15 Mon Sep 17 00:00:00 2001 From: "qsr@chromium.org" Date: Fri, 21 Sep 2012 07:58:25 +0000 Subject: 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 --- src/common/mac/file_id.cc | 6 ++++-- src/common/mac/macho_walker.cc | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src/common/mac') 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((hi >= 10) ? ('A' + hi - 10) : ('0' + hi)); + buffer[buffer_idx++] = + static_cast((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(offset) >= memory_size_) return false; - size = memory_size_ - offset; + size = memory_size_ - static_cast(offset); result = false; } memcpy(buffer, static_cast(memory_) + offset, size); -- cgit v1.2.1