Skip to content

Commit

Permalink
Codacy: Error-prone Code
Browse files Browse the repository at this point in the history
%i in format string requires 'int' but the argument type is 'unsigned int'.
  • Loading branch information
GregoryLundberg committed Oct 26, 2018
1 parent 421149b commit bad9e86
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/attack_prediction.cpp
Expand Up @@ -2707,12 +2707,12 @@ static void run(unsigned specific_battle)
auto total = end - start;

#ifdef BENCHMARK
printf("Total time for %i combats was %lf\n", NUM_UNITS * (NUM_UNITS - 1) * (NUM_UNITS - 2),
printf("Total time for %u combats was %lf\n", NUM_UNITS * (NUM_UNITS - 1) * (NUM_UNITS - 2),
static_cast<double>(duration_cast<microseconds>(total).count()) / 1000000.0);
printf("Time per calc = %li us\n", static_cast<long>(duration_cast<microseconds>(total).count())
/ (NUM_UNITS * (NUM_UNITS - 1) * (NUM_UNITS - 2)));
#else
printf("Total combats: %i\n", NUM_UNITS * (NUM_UNITS - 1) * (NUM_UNITS - 2));
printf("Total combats: %u\n", NUM_UNITS * (NUM_UNITS - 1) * (NUM_UNITS - 2));
#endif

for(i = 0; i < NUM_UNITS; ++i) {
Expand Down

0 comments on commit bad9e86

Please sign in to comment.