Permalink
Browse files

Clean up C Compiler warning about declaration of variables.

  • Loading branch information...
1 parent 9114655 commit 9220eaea6f9afba4cc3bc6a0ff240f3492ff5997 @copiousfreetime committed Feb 7, 2013
Showing with 4 additions and 3 deletions.
  1. +4 −3 ext/hitimes/hitimes_instant_osx.c
@@ -14,6 +14,7 @@ long double hitimes_instant_conversion_factor()
{
static mach_timebase_info_data_t s_timebase_info;
static long double conversion_factor;
+ static uint64_t nano_conversion;
/**
* If this is the first time we've run, get the timebase.
@@ -23,9 +24,9 @@ long double hitimes_instant_conversion_factor()
*/
if ( s_timebase_info.denom == 0 ) {
- (void) mach_timebase_info(&s_timebase_info);
- uint64_t nano_conversion = s_timebase_info.numer / s_timebase_info.denom;
- conversion_factor = (long double) (nano_conversion) * (1e9l);
+ mach_timebase_info(&s_timebase_info);
+ nano_conversion = s_timebase_info.numer / s_timebase_info.denom;
+ conversion_factor = (long double) (nano_conversion) * (1e9l);
}
return conversion_factor;

0 comments on commit 9220eae

Please sign in to comment.