From 0e8148024b4bd3f50331ad5fcc7334d4aa60949b Mon Sep 17 00:00:00 2001 From: Roger Meier Date: Fri, 17 Jan 2014 21:07:58 +0100 Subject: [PATCH] =?utf8?q?THRIFT-2229=20cpp:thrift=20failed=20to=20build?= =?utf8?q?=20on=20OSX=2010.9=20GM=20fix=20test/cpp=C2=20Patch:=20Roger=20M?= =?utf8?q?eier?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- test/cpp/src/TestClient.cpp | 22 +++++++++++----------- test/cpp/src/TestServer.cpp | 14 +++++++------- 2 files changed, 18 insertions(+), 18 deletions(-) mode change 100644 => 100755 test/cpp/src/TestClient.cpp mode change 100644 => 100755 test/cpp/src/TestServer.cpp diff --git a/test/cpp/src/TestClient.cpp b/test/cpp/src/TestClient.cpp old mode 100644 new mode 100755 index cd78505b..a0ada14d --- a/test/cpp/src/TestClient.cpp +++ b/test/cpp/src/TestClient.cpp @@ -288,7 +288,7 @@ int main(int argc, char** argv) { */ printf("testI64(-34359738368)"); int64_t i64 = testClient.testI64(-34359738368LL); - printf(" = %"PRId64"\n", i64); + printf(" = %" PRId64 "\n", i64); if (i64 != -34359738368LL) failCount++; /** @@ -311,7 +311,7 @@ int main(int argc, char** argv) { out.i64_thing = -5; Xtruct in; testClient.testStruct(in, out); - printf(" = {\"%s\", %d, %d, %"PRId64"}\n", + printf(" = {\"%s\", %d, %d, %" PRId64 "}\n", in.string_thing.c_str(), (int)in.byte_thing, in.i32_thing, @@ -330,7 +330,7 @@ int main(int argc, char** argv) { Xtruct2 in2; testClient.testNest(in2, out2); in = in2.struct_thing; - printf(" = {%d, {\"%s\", %d, %d, %"PRId64"}, %d}\n", + printf(" = {%d, {\"%s\", %d, %d, %" PRId64 "}, %d}\n", in2.byte_thing, in.string_thing.c_str(), (int)in.byte_thing, @@ -488,7 +488,7 @@ int main(int argc, char** argv) { */ printf("testTypedef(309858235082523)"); UserId uid = testClient.testTypedef(309858235082523LL); - printf(" = %"PRId64"\n", uid); + printf(" = %" PRId64 "\n", uid); if (uid != 309858235082523LL) failCount++; @@ -527,7 +527,7 @@ int main(int argc, char** argv) { printf(" = {"); map >::const_iterator i_iter; for (i_iter = whoa.begin(); i_iter != whoa.end(); ++i_iter) { - printf("%"PRId64" => {", i_iter->first); + printf("%" PRId64 " => {", i_iter->first); map::const_iterator i2_iter; for (i2_iter = i_iter->second.begin(); i2_iter != i_iter->second.end(); @@ -537,7 +537,7 @@ int main(int argc, char** argv) { map::const_iterator um; printf("{"); for (um = userMap.begin(); um != userMap.end(); ++um) { - printf("%d => %"PRId64", ", um->first, um->second); + printf("%d => %" PRId64 ", ", um->first, um->second); } printf("}, "); @@ -545,7 +545,7 @@ int main(int argc, char** argv) { vector::const_iterator x; printf("{"); for (x = xtructs.begin(); x != xtructs.end(); ++x) { - printf("{\"%s\", %d, %d, %"PRId64"}, ", + printf("{\"%s\", %d, %d, %" PRId64 "}, ", x->string_thing.c_str(), (int)x->byte_thing, x->i32_thing, @@ -658,7 +658,7 @@ int main(int argc, char** argv) { uint64_t stop = now(); uint64_t tot = stop-start; - printf("Total time: %"PRIu64" us\n", stop-start); + printf("Total time: %" PRIu64 " us\n", stop-start); time_tot += tot; if (time_min == 0 || tot < time_min) { @@ -676,9 +676,9 @@ int main(int argc, char** argv) { uint64_t time_avg = time_tot / numTests; - printf("Min time: %"PRIu64" us\n", time_min); - printf("Max time: %"PRIu64" us\n", time_max); - printf("Avg time: %"PRIu64" us\n", time_avg); + printf("Min time: %" PRIu64 " us\n", time_min); + printf("Max time: %" PRIu64 " us\n", time_max); + printf("Avg time: %" PRIu64 " us\n", time_avg); return failCount; } diff --git a/test/cpp/src/TestServer.cpp b/test/cpp/src/TestServer.cpp old mode 100644 new mode 100755 index adb8fd1f..af43d72e --- a/test/cpp/src/TestServer.cpp +++ b/test/cpp/src/TestServer.cpp @@ -85,7 +85,7 @@ class TestHandler : public ThriftTestIf { } int64_t testI64(const int64_t thing) { - printf("testI64(%"PRId64")\n", thing); + printf("testI64(%" PRId64 ")\n", thing); return thing; } @@ -95,13 +95,13 @@ class TestHandler : public ThriftTestIf { } void testStruct(Xtruct& out, const Xtruct &thing) { - printf("testStruct({\"%s\", %d, %d, %"PRId64"})\n", thing.string_thing.c_str(), (int)thing.byte_thing, thing.i32_thing, thing.i64_thing); + printf("testStruct({\"%s\", %d, %d, %" PRId64 "})\n", thing.string_thing.c_str(), (int)thing.byte_thing, thing.i32_thing, thing.i64_thing); out = thing; } void testNest(Xtruct2& out, const Xtruct2& nest) { const Xtruct &thing = nest.struct_thing; - printf("testNest({%d, {\"%s\", %d, %d, %"PRId64"}, %d})\n", (int)nest.byte_thing, thing.string_thing.c_str(), (int)thing.byte_thing, thing.i32_thing, thing.i64_thing, nest.i32_thing); + printf("testNest({%d, {\"%s\", %d, %d, %" PRId64 "}, %d})\n", (int)nest.byte_thing, thing.string_thing.c_str(), (int)thing.byte_thing, thing.i32_thing, thing.i64_thing, nest.i32_thing); out = nest; } @@ -175,7 +175,7 @@ class TestHandler : public ThriftTestIf { } UserId testTypedef(const UserId thing) { - printf("testTypedef(%"PRId64")\n", thing); + printf("testTypedef(%" PRId64 ")\n", thing); return thing; } @@ -233,7 +233,7 @@ class TestHandler : public ThriftTestIf { printf(" = {"); map >::const_iterator i_iter; for (i_iter = insane.begin(); i_iter != insane.end(); ++i_iter) { - printf("%"PRId64" => {", i_iter->first); + printf("%" PRId64 " => {", i_iter->first); map::const_iterator i2_iter; for (i2_iter = i_iter->second.begin(); i2_iter != i_iter->second.end(); @@ -243,7 +243,7 @@ class TestHandler : public ThriftTestIf { map::const_iterator um; printf("{"); for (um = userMap.begin(); um != userMap.end(); ++um) { - printf("%d => %"PRId64", ", um->first, um->second); + printf("%d => %" PRId64 ", ", um->first, um->second); } printf("}, "); @@ -251,7 +251,7 @@ class TestHandler : public ThriftTestIf { vector::const_iterator x; printf("{"); for (x = xtructs.begin(); x != xtructs.end(); ++x) { - printf("{\"%s\", %d, %d, %"PRId64"}, ", x->string_thing.c_str(), (int)x->byte_thing, x->i32_thing, x->i64_thing); + printf("{\"%s\", %d, %d, %" PRId64 "}, ", x->string_thing.c_str(), (int)x->byte_thing, x->i32_thing, x->i64_thing); } printf("}"); -- 2.17.1