From 81146d6b0fc58509f73f9a9cb9778cf3b9b52e37 Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Mon, 17 Nov 2014 14:17:07 -0700 Subject: [PATCH] Clean up compiler warnings --- samples/fun_call_performance.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/samples/fun_call_performance.cpp b/samples/fun_call_performance.cpp index bfeb73e..a689b5a 100644 --- a/samples/fun_call_performance.cpp +++ b/samples/fun_call_performance.cpp @@ -307,7 +307,8 @@ int main(int argc, char *argv[]) for (int i = 0; i < 1000; i++) { - printf(helloWorld("Bob12345").c_str()); + std::string str = helloWorld("Bob12345"); + fwrite(str.c_str(), 1, str.size(), stdout); } clock_t end = clock(); @@ -383,8 +384,8 @@ int main(int argc, char *argv[]) end = clock(); double elapsed_secs1 = double(end - begin) / CLOCKS_PER_SEC; - printf("**C++::time= %lf\n", elapsed_secs); - printf("**ChaiScript::time= %lf\n", elapsed_secs1); + printf("**C++::time= %.10f\n", elapsed_secs); + printf("**ChaiScript::time= %.10f\n", elapsed_secs1); break; } default: std::cout << "Unrecognized execution mode" << std::endl; return EXIT_FAILURE;