Skip to content

Commit

Permalink
Lua plugin: Add pointer casts for C89 compatibility
Browse files Browse the repository at this point in the history
This addresses a build failure with GCC 14.
  • Loading branch information
fweimer-rh authored and epico committed Jan 22, 2024
1 parent f19b229 commit cf33a2c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/lua-plugin-init.c
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ static int ime_utf8_to_utf16(lua_State* L){
gunichar2 * str = g_utf8_to_utf16(s, l, NULL, &written, NULL);

/* not includes trailing-zero */
luaL_addlstring(&buf, str, written * sizeof(gunichar2));
luaL_addlstring(&buf, (const char *)str, written * sizeof(gunichar2));
luaL_pushresult(&buf);

g_free(str);
Expand All @@ -419,7 +419,7 @@ static int ime_utf8_to_utf16(lua_State* L){

static int ime_utf16_to_utf8(lua_State* L){
size_t l;
const gunichar2 * s = luaL_checklstring(L, 1, &l);
const gunichar2 * s = (const gunichar2 *)luaL_checklstring(L, 1, &l);

luaL_Buffer buf;
luaL_buffinit(L, &buf);
Expand Down

0 comments on commit cf33a2c

Please sign in to comment.