Skip to content

Commit

Permalink
Update printf format specifiers
Browse files Browse the repository at this point in the history
Can't find any format specifier that works portably for int64_t (PRId64
is problematic on MSYS) so just use long longs instead.
  • Loading branch information
jbytheway committed Jun 18, 2019
1 parent 75a9215 commit 8bad9a9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/line_test.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <inttypes.h>
#include <time.h>
#include <chrono>
#include <cstdio>
Expand Down Expand Up @@ -332,14 +333,14 @@ static void line_to_comparison( const int iterations )
const auto end2 = std::chrono::high_resolution_clock::now();

if( iterations > 1 ) {
const int64_t diff1 =
const long long diff1 =
std::chrono::duration_cast<std::chrono::microseconds>( end1 - start1 ).count();
const int64_t diff2 =
const long long diff2 =
std::chrono::duration_cast<std::chrono::microseconds>( end2 - start2 ).count();

printf( "line_to() executed %d times in %ld microseconds.\n",
printf( "line_to() executed %d times in %lld microseconds.\n",
iterations, diff1 );
printf( "canonical_line_to() executed %d times in %ld microseconds.\n",
printf( "canonical_line_to() executed %d times in %lld microseconds.\n",
iterations, diff2 );
}
}
Expand Down

0 comments on commit 8bad9a9

Please sign in to comment.