Permalink
Browse files

fixed c89 errors reported for MSVC by Oskar Forsslund

  • Loading branch information...
1 parent 9efd85c commit e56ad9d53ed495584a75d4ed3ad9dd767c61795a @geoffleyland committed Oct 5, 2011
Showing with 5 additions and 3 deletions.
  1. +5 −3 c/c_hook.c
View
@@ -56,8 +56,9 @@ static hook_time_t lclock()
static void get_microseconds_info(void)
{
LARGE_INTEGER frequency;
+ long long f;
QueryPerformanceFrequency(&frequency);
- long long f = frequency.QuadPart;
+ f = frequency.QuadPart;
if (f < 1000000)
{
microseconds_numerator = 1000000 / f;
@@ -108,12 +109,13 @@ static hook_time_t time_out, elapsed;
void hook(lua_State *L, lua_Debug *ar)
{
+ int event;
hook_time_t time_in = CLOCK_FUNCTION();
elapsed += time_in - time_out;
lua_rawgeti(L, LUA_REGISTRYINDEX, hook_index);
- int event = ar->event;
+ event = ar->event;
lua_pushstring(L, hooknames[event]);
if (event == LUA_HOOKLINE)
@@ -165,7 +167,7 @@ static luaL_Reg hook_functions[] =
LUALIB_API int luaopen_luatrace_c_hook(lua_State *L)
{
- // Register the module functions
+ /* Register the module functions */
luaL_register(L, "c_hook", hook_functions);
return 1;
}

0 comments on commit e56ad9d

Please sign in to comment.