diff options
author | David Wragg <dpw@lshift.net> | 2010-05-30 23:31:40 +0100 |
---|---|---|
committer | David Wragg <dpw@lshift.net> | 2010-05-30 23:31:40 +0100 |
commit | 7e8fbea4c9212774c101e33218d26a0dc992dc03 (patch) | |
tree | 4815bc608e2f3f54187c20142c5c909fa1ab0810 /tests | |
parent | 2347dc9977d3bf0c9ed19f7ed3a905eb4e65fa46 (diff) | |
download | rabbitmq-c-github-ask-7e8fbea4c9212774c101e33218d26a0dc992dc03.tar.gz |
Remove uses of the GNU-specific %ll printf format modifier
The MS C runtime doesn't support it. Use the C99 inttypes.h macros
instead, which is supplied by MinGW.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_tables.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/tests/test_tables.c b/tests/test_tables.c index e620443..282aa8f 100644 --- a/tests/test_tables.c +++ b/tests/test_tables.c @@ -54,7 +54,8 @@ #include <time.h> #include <errno.h> -#include <stdint.h> +#include <inttypes.h> + #include <amqp.h> #include <amqp_framing.h> #include <amqp_private.h> @@ -75,13 +76,13 @@ static void dump_value(int indent, amqp_field_value_t v) { putchar(' '); switch (v.kind) { case AMQP_FIELD_KIND_BOOLEAN: puts(v.value.boolean ? "true" : "false"); break; - case AMQP_FIELD_KIND_I8: printf("%d\n", v.value.i8); break; - case AMQP_FIELD_KIND_U8: printf("%d\n", v.value.u8); break; - case AMQP_FIELD_KIND_I16: printf("%d\n", v.value.i16); break; - case AMQP_FIELD_KIND_U16: printf("%d\n", v.value.u16); break; - case AMQP_FIELD_KIND_I32: printf("%ld\n", (long) v.value.i32); break; - case AMQP_FIELD_KIND_U32: printf("%lu\n", (unsigned long) v.value.u32); break; - case AMQP_FIELD_KIND_I64: printf("%lld\n", (long long) v.value.i64); break; + case AMQP_FIELD_KIND_I8: printf("%"PRId8"\n", v.value.i8); break; + case AMQP_FIELD_KIND_U8: printf("%"PRIu8"\n", v.value.u8); break; + case AMQP_FIELD_KIND_I16: printf("%"PRId16"\n", v.value.i16); break; + case AMQP_FIELD_KIND_U16: printf("%"PRIu16"\n", v.value.u16); break; + case AMQP_FIELD_KIND_I32: printf("%"PRId32"\n", v.value.i32); break; + case AMQP_FIELD_KIND_U32: printf("%"PRIu32"\n", v.value.u32); break; + case AMQP_FIELD_KIND_I64: printf("%"PRId64"\n", v.value.i64); break; case AMQP_FIELD_KIND_F32: printf("%g\n", (double) v.value.f32); break; case AMQP_FIELD_KIND_F64: printf("%g\n", v.value.f64); break; case AMQP_FIELD_KIND_DECIMAL: @@ -106,7 +107,7 @@ static void dump_value(int indent, amqp_field_value_t v) { } } break; - case AMQP_FIELD_KIND_TIMESTAMP: printf("%llu\n", (unsigned long long) v.value.u64); break; + case AMQP_FIELD_KIND_TIMESTAMP: printf("%"PRIu64"\n", v.value.u64); break; case AMQP_FIELD_KIND_TABLE: putchar('\n'); { @@ -272,7 +273,7 @@ int main(int argc, char const * const *argv) { if ((sizeof(float) != 4) || (vi.i != 0x40490fdb)) { printf("*** ERROR: single floating point encoding does not work as expected\n"); printf("sizeof float is %lu, float is %g, u32 is 0x%08lx\n", - sizeof(float), + (unsigned long)sizeof(float), vi.f, (unsigned long) vi.i); } @@ -280,10 +281,9 @@ int main(int argc, char const * const *argv) { vl.d = M_PI; if ((sizeof(double) != 8) || (vl.l != 0x400921fb54442d18L)) { printf("*** ERROR: double floating point encoding does not work as expected\n"); - printf("sizeof double is %lu, double is %g, u64 is 0x%16llx\n", - sizeof(double), - vl.d, - (unsigned long long) vl.l); + printf("sizeof double is %lu, double is %g, u64 is 0x%16"PRIx64"\n", + (unsigned long)sizeof(double), + vl.d, vl.l); } test_table_codec(); |