Skip to content

Commit

Permalink
test/capi: fix compiler warning in profiler_cb
Browse files Browse the repository at this point in the history
The patch fixes a compiler warning:

```
/home/sergeyb/sources/lua-c-api-tests/tests/capi/luaL_loadbuffer_proto/luaL_loadbuffer_proto_test.cc:371:32: warning: cast from 'void (*)(lua_State
 *, void *, size_t *)' (aka 'void (*)(lua_State *, void *, unsigned long *)') to 'luaJIT_profile_callback' (aka 'void (*)(void *, lua_State *, int,
 int)') converts to incompatible function type [-Wcast-function-type-mismatch]
  371 |         luaJIT_profile_start(L, mode, (luaJIT_profile_callback)profiler_cb, NULL);
      |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
```
  • Loading branch information
ligurio committed Feb 20, 2025
1 parent bd5680c commit 0f010f7
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,10 @@ metrics_increment_num_error_samples(struct metrics *metrics)
}

UNUSED static void
profiler_cb(lua_State *L, void *data, size_t *size)
profiler_cb(lua_State *L, void *data, int samples, int vmstate)
{
(void)L;
(void)data;
(void)size;
/* Do nothing. */
}

Expand Down

0 comments on commit 0f010f7

Please sign in to comment.