Skip to content

Commit 966c684

Browse files
committed
chore: clear warning
Cleared Clang warnings "warning| Suspicious usage of 'sizeof()' on an expression of pointer type"
1 parent c9b8e44 commit 966c684

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lgi/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ core_module (lua_State *L)
576576
}
577577

578578
/* Embed the module in the userdata for the module. */
579-
*(GModule **) lua_newuserdata (L, sizeof (module)) = module;
579+
*(GModule **) lua_newuserdata (L, sizeof (GModule *)) = module;
580580
luaL_getmetatable (L, UD_MODULE);
581581
lua_setmetatable (L, -2);
582582

lgi/gi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ lgi_gi_info_new (lua_State *L, GIBaseInfo *info)
2828
}
2929
else
3030
{
31-
ud_info = lua_newuserdata (L, sizeof (info));
31+
ud_info = lua_newuserdata (L, sizeof (GIBaseInfo *));
3232
*ud_info = info;
3333
luaL_getmetatable (L, LGI_GI_INFO);
3434
lua_setmetatable (L, -2);

0 commit comments

Comments
 (0)