mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16: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);
|
||||
|
||||
/* 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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user