Skip to content

Commit 0b0ac38

Browse files
committed
test/capi: fix compiler warning in profiler_cb
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. ```
1 parent bd5680c commit 0b0ac38

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

tests/capi/luaL_loadbuffer_proto/luaL_loadbuffer_proto_test.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,10 @@ metrics_increment_num_error_samples(struct metrics *metrics)
181181
}
182182

183183
UNUSED static void
184-
profiler_cb(lua_State *L, void *data, size_t *size)
184+
profiler_cb(lua_State *L, void *data, int samples, int vmstate)
185185
{
186186
(void)L;
187187
(void)data;
188-
(void)size;
189188
/* Do nothing. */
190189
}
191190

0 commit comments

Comments
 (0)