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
This commit is contained in:
parent
00407e09c7
commit
bd6d0964e7
@ -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;
|
||||
|
@ -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));
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user