From 0b0ac38615a0dab397a93785170385b3bc2e88cb Mon Sep 17 00:00:00 2001 From: Sergey Bronnikov Date: Sun, 16 Feb 2025 11:22:28 +0300 Subject: [PATCH] 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. ``` --- tests/capi/luaL_loadbuffer_proto/luaL_loadbuffer_proto_test.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/capi/luaL_loadbuffer_proto/luaL_loadbuffer_proto_test.cc b/tests/capi/luaL_loadbuffer_proto/luaL_loadbuffer_proto_test.cc index 4e90320..851542e 100644 --- a/tests/capi/luaL_loadbuffer_proto/luaL_loadbuffer_proto_test.cc +++ b/tests/capi/luaL_loadbuffer_proto/luaL_loadbuffer_proto_test.cc @@ -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. */ }