mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-02 17:26:17 +01:00
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
This commit is contained in:
parent
327c379862
commit
94d4e8b2fb
@ -125,6 +125,9 @@ run_test (PerformanceTest *test)
|
|||||||
g_print ("Running %"G_GINT64_MODIFIER"d rounds\n", num_rounds);
|
g_print ("Running %"G_GINT64_MODIFIER"d rounds\n", num_rounds);
|
||||||
|
|
||||||
/* Run the test */
|
/* Run the test */
|
||||||
|
avg_elapsed = 0.0;
|
||||||
|
min_elapsed = 0.0;
|
||||||
|
max_elapsed = 0.0;
|
||||||
for (i = 0; i < num_rounds; i++)
|
for (i = 0; i < num_rounds; i++)
|
||||||
{
|
{
|
||||||
test->init (test, data, factor);
|
test->init (test, data, factor);
|
||||||
@ -144,6 +147,7 @@ run_test (PerformanceTest *test)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (num_rounds > 1)
|
||||||
avg_elapsed = avg_elapsed / num_rounds;
|
avg_elapsed = avg_elapsed / num_rounds;
|
||||||
|
|
||||||
if (verbose)
|
if (verbose)
|
||||||
@ -152,6 +156,7 @@ run_test (PerformanceTest *test)
|
|||||||
g_print ("Maximum corrected round time: %.2f msecs\n", max_elapsed * 1000);
|
g_print ("Maximum corrected round time: %.2f msecs\n", max_elapsed * 1000);
|
||||||
g_print ("Average corrected round time: %.2f msecs\n", avg_elapsed * 1000);
|
g_print ("Average corrected round time: %.2f msecs\n", avg_elapsed * 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Print the results */
|
/* Print the results */
|
||||||
test->print_result (test, data, min_elapsed);
|
test->print_result (test, data, min_elapsed);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user