diff options
author | ted.mielczarek@gmail.com <ted.mielczarek@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2013-02-01 19:20:34 +0000 |
---|---|---|
committer | ted.mielczarek@gmail.com <ted.mielczarek@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2013-02-01 19:20:34 +0000 |
commit | bd6d0964e77f8235836df471ef84e94bd8bc9087 (patch) | |
tree | 83d93b9a6772814c67f290a32e2784924b34368a /src | |
parent | Add API to find out if there is crash reports to send to the server. (diff) | |
download | breakpad-bd6d0964e77f8235836df471ef84e94bd8bc9087.tar.xz |
Fix some issues with -Werror=sign-compare on Android builds
R=digit at https://breakpad.appspot.com/524002/
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1110 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src')
-rw-r--r-- | src/client/linux/handler/exception_handler_unittest.cc | 2 | ||||
-rw-r--r-- | src/common/android/breakpad_getcontext_unittest.cc | 19 | ||||
-rw-r--r-- | src/common/android/testing/mkdtemp.h | 2 |
3 files changed, 14 insertions, 9 deletions
diff --git a/src/client/linux/handler/exception_handler_unittest.cc b/src/client/linux/handler/exception_handler_unittest.cc index 4b3ec07b..d7176916 100644 --- a/src/client/linux/handler/exception_handler_unittest.cc +++ b/src/client/linux/handler/exception_handler_unittest.cc @@ -889,7 +889,7 @@ TEST(ExceptionHandlerTest, ExternalDumper) { const ssize_t n = HANDLE_EINTR(recvmsg(fds[0], &msg, 0)); ASSERT_EQ(static_cast<ssize_t>(kCrashContextSize), n); ASSERT_EQ(kControlMsgSize, msg.msg_controllen); - ASSERT_EQ(0, msg.msg_flags); + ASSERT_EQ(static_cast<typeof(msg.msg_flags)>(0), msg.msg_flags); ASSERT_EQ(0, close(fds[0])); pid_t crashing_pid = -1; diff --git a/src/common/android/breakpad_getcontext_unittest.cc b/src/common/android/breakpad_getcontext_unittest.cc index 004390c3..3bafb9a6 100644 --- a/src/common/android/breakpad_getcontext_unittest.cc +++ b/src/common/android/breakpad_getcontext_unittest.cc @@ -36,11 +36,13 @@ TEST(AndroidUContext, GRegsOffset) { #ifdef __arm__ // There is no gregs[] array on ARM, so compare to the offset of // first register fields, since they're stored in order. - ASSERT_EQ(MCONTEXT_GREGS_OFFSET, offsetof(ucontext_t,uc_mcontext.arm_r0)); + ASSERT_EQ(static_cast<size_t>(MCONTEXT_GREGS_OFFSET), + offsetof(ucontext_t,uc_mcontext.arm_r0)); #elif defined(__i386__) - ASSERT_EQ(MCONTEXT_GREGS_OFFSET, offsetof(ucontext_t,uc_mcontext.gregs)); + ASSERT_EQ(static_cast<size_t>(MCONTEXT_GREGS_OFFSET), + offsetof(ucontext_t,uc_mcontext.gregs)); #define CHECK_REG(x) \ - ASSERT_EQ(MCONTEXT_##x##_OFFSET, \ + ASSERT_EQ(static_cast<size_t>(MCONTEXT_##x##_OFFSET), \ offsetof(ucontext_t,uc_mcontext.gregs[REG_##x])) CHECK_REG(GS); CHECK_REG(FS); @@ -62,15 +64,18 @@ TEST(AndroidUContext, GRegsOffset) { CHECK_REG(UESP); CHECK_REG(SS); - ASSERT_EQ(UCONTEXT_FPREGS_OFFSET, offsetof(ucontext_t,uc_mcontext.fpregs)); + ASSERT_EQ(static_cast<size_t>(UCONTEXT_FPREGS_OFFSET), + offsetof(ucontext_t,uc_mcontext.fpregs)); - ASSERT_EQ(UCONTEXT_FPREGS_MEM_OFFSET, + ASSERT_EQ(static_cast<size_t>(UCONTEXT_FPREGS_MEM_OFFSET), offsetof(ucontext_t,__fpregs_mem)); #else - ASSERT_EQ(MCONTEXT_GREGS_OFFSET, offsetof(ucontext_t,uc_mcontext.gregs)); + ASSERT_EQ(static_cast<size_t>(MCONTEXT_GREGS_OFFSET), + offsetof(ucontext_t,uc_mcontext.gregs)); #endif } TEST(AndroidUContext, SigmakOffset) { - ASSERT_EQ(UCONTEXT_SIGMASK_OFFSET, offsetof(ucontext_t,uc_sigmask)); + ASSERT_EQ(static_cast<size_t>(UCONTEXT_SIGMASK_OFFSET), + offsetof(ucontext_t,uc_sigmask)); } diff --git a/src/common/android/testing/mkdtemp.h b/src/common/android/testing/mkdtemp.h index 063e356f..85644c9f 100644 --- a/src/common/android/testing/mkdtemp.h +++ b/src/common/android/testing/mkdtemp.h @@ -57,7 +57,7 @@ char* mkdtemp(char* path) { const size_t kSuffixLen = strlen(kSuffix); char* path_end = path + strlen(path); - if (path_end - path < kSuffixLen || + if (static_cast<size_t>(path_end - path) < kSuffixLen || memcmp(path_end - kSuffixLen, kSuffix, kSuffixLen) != 0) { errno = EINVAL; return NULL; |