diff options
author | Stephen Hines <srhines@google.com> | 2013-10-11 16:33:03 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-10-11 16:33:03 -0700 |
commit | 78f6db64fe90e45f1cdb649543feb2d92696802a (patch) | |
tree | 572f4f617f44405ca855d713a5728a4d3366dd7c /tests | |
parent | 49bb53c8e20ff37a1965ba4af645464ea4b8f8fa (diff) | |
parent | 36959302a334499c7d2ddf4a090e2ab7e3a8ae1d (diff) | |
download | bionic-78f6db64fe90e45f1cdb649543feb2d92696802a.zip bionic-78f6db64fe90e45f1cdb649543feb2d92696802a.tar.gz bionic-78f6db64fe90e45f1cdb649543feb2d92696802a.tar.bz2 |
am 36959302: am 8704ada3: Merge "Fix clang warnings in bionic."
* commit '36959302a334499c7d2ddf4a090e2ab7e3a8ae1d':
Fix clang warnings in bionic.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/libc_logging_test.cpp | 4 | ||||
-rw-r--r-- | tests/stack_unwinding_test_impl.c | 2 | ||||
-rw-r--r-- | tests/stdio_test.cpp | 6 |
3 files changed, 6 insertions, 6 deletions
diff --git a/tests/libc_logging_test.cpp b/tests/libc_logging_test.cpp index d9c615e..5b10ce3 100644 --- a/tests/libc_logging_test.cpp +++ b/tests/libc_logging_test.cpp @@ -53,10 +53,10 @@ TEST(libc_logging, smoke) { __libc_format_buffer(buf, sizeof(buf), "a%db", -8123); EXPECT_STREQ("a-8123b", buf); - __libc_format_buffer(buf, sizeof(buf), "a%hdb", 0x7fff0010); + __libc_format_buffer(buf, sizeof(buf), "a%hdb", static_cast<short>(0x7fff0010)); EXPECT_STREQ("a16b", buf); - __libc_format_buffer(buf, sizeof(buf), "a%hhdb", 0x7fffff10); + __libc_format_buffer(buf, sizeof(buf), "a%hhdb", static_cast<char>(0x7fffff10)); EXPECT_STREQ("a16b", buf); __libc_format_buffer(buf, sizeof(buf), "a%lldb", 0x1000000000LL); diff --git a/tests/stack_unwinding_test_impl.c b/tests/stack_unwinding_test_impl.c index b0099f0..7518a2c 100644 --- a/tests/stack_unwinding_test_impl.c +++ b/tests/stack_unwinding_test_impl.c @@ -48,7 +48,7 @@ static void noinline do_crash() { } static void noinline foo() { - char c1 __attribute__((cleanup(foo_cleanup))); + char c1 __attribute__((cleanup(foo_cleanup))) unused; do_crash(); } diff --git a/tests/stdio_test.cpp b/tests/stdio_test.cpp index 8eb65a6..e47f967 100644 --- a/tests/stdio_test.cpp +++ b/tests/stdio_test.cpp @@ -226,10 +226,10 @@ TEST(stdio, snprintf_smoke) { snprintf(buf, sizeof(buf), "a%db", -8123); EXPECT_STREQ("a-8123b", buf); - snprintf(buf, sizeof(buf), "a%hdb", 0x7fff0010); + snprintf(buf, sizeof(buf), "a%hdb", static_cast<short>(0x7fff0010)); EXPECT_STREQ("a16b", buf); - snprintf(buf, sizeof(buf), "a%hhdb", 0x7fffff10); + snprintf(buf, sizeof(buf), "a%hhdb", static_cast<char>(0x7fffff10)); EXPECT_STREQ("a16b", buf); snprintf(buf, sizeof(buf), "a%lldb", 0x1000000000LL); @@ -281,7 +281,7 @@ TEST(stdio, snprintf_smoke) { snprintf(buf, sizeof(buf), "a_%f_b", 1.23f); EXPECT_STREQ("a_1.230000_b", buf); - snprintf(buf, sizeof(buf), "a_%g_b", 3.14d); + snprintf(buf, sizeof(buf), "a_%g_b", 3.14); EXPECT_STREQ("a_3.14_b", buf); } |