[EMAIL PROTECTED] wrote:

* I just stumbled on this code (in 0.93), netboot/timer.c. ----------------------------------------- unsigned long currticks(void) { static unsigned long clocks_per_tick; unsigned long clocks_high, clocks_low; unsigned long currticks; if (!clocks_per_tick) { clocks_per_tick = calibrate_tsc(); printf("clocks_per_tick = %d\n", clocks_per_tick); } ------------------------------------------

Shouldn't clock_per_tick be inited to zero? If so, is that fixed in
the new version?


clock_per_tick is declared as "static" but not given a constant value. But as it is "static" it is therefore automatically given a value of 0. So, it is in fact a definition, I.E. It is automatically give a value of 0 (unless specifically given a different value) the first time one calls the function containing it.


i.e. static unsigned long clocks_per_tick;
is exactly the same as
static unsigned long clocks_per_tick = 0;

So, no fix necassary.

Cheers
James


_______________________________________________ Bug-grub mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/bug-grub

Reply via email to