Commit 94d4e8b2 authored by Emmanuele Bassi's avatar Emmanuele Bassi

Initialize variables before using them

Avoid a compiler warning when using the average, minimum, and maximum
elapsed variables without initializing them.

https://bugzilla.gnome.org/show_bug.cgi?id=794732
parent 327c3798
......@@ -125,6 +125,9 @@ run_test (PerformanceTest *test)
g_print ("Running %"G_GINT64_MODIFIER"d rounds\n", num_rounds);
/* Run the test */
avg_elapsed = 0.0;
min_elapsed = 0.0;
max_elapsed = 0.0;
for (i = 0; i < num_rounds; i++)
{
test->init (test, data, factor);
......@@ -144,7 +147,8 @@ run_test (PerformanceTest *test)
}
}
avg_elapsed = avg_elapsed / num_rounds;
if (num_rounds > 1)
avg_elapsed = avg_elapsed / num_rounds;
if (verbose)
{
......@@ -152,6 +156,7 @@ run_test (PerformanceTest *test)
g_print ("Maximum corrected round time: %.2f msecs\n", max_elapsed * 1000);
g_print ("Average corrected round time: %.2f msecs\n", avg_elapsed * 1000);
}
/* Print the results */
test->print_result (test, data, min_elapsed);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment