From 651d366bca28d22638bfd6575b8c1abdae88ce80 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Sun, 21 Jan 2024 14:39:52 +0100 Subject: [PATCH] Add pointer casts for C89 compatibility Related to: --- ibus-libpinyin-c89.patch | 28 ++++++++++++++++++++++++++++ ibus-libpinyin.spec | 7 ++++++- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 ibus-libpinyin-c89.patch diff --git a/ibus-libpinyin-c89.patch b/ibus-libpinyin-c89.patch new file mode 100644 index 0000000..96a2863 --- /dev/null +++ b/ibus-libpinyin-c89.patch @@ -0,0 +1,28 @@ +Lua plugin: Add pointer casts for C89 compatibility + +This addresses a build failure with GCC 14. + +Submitted upstream: + +diff --git a/lua/lua-plugin-init.c b/lua/lua-plugin-init.c +index c6fa9bac806167a4..e6e86ec8c2511a1c 100644 +--- a/lua/lua-plugin-init.c ++++ b/lua/lua-plugin-init.c +@@ -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); +@@ -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); diff --git a/ibus-libpinyin.spec b/ibus-libpinyin.spec index d62ba22..1a77c04 100644 --- a/ibus-libpinyin.spec +++ b/ibus-libpinyin.spec @@ -2,7 +2,7 @@ Name: ibus-libpinyin Version: 1.15.6 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Intelligent Pinyin engine based on libpinyin for IBus License: GPL-3.0-or-later URL: https://github.com/libpinyin/ibus-libpinyin @@ -10,6 +10,7 @@ Source0: http://downloads.sourceforge.net/libpinyin/ibus-libpinyin/%{name}-%{ %if %snapshot Patch0: ibus-libpinyin-1.15.x-head.patch %endif +Patch1: ibus-libpinyin-c89.patch Requires: python3-gobject Requires: ibus >= 1.5.11 @@ -41,6 +42,7 @@ input method based on libpinyin for IBus. %if %snapshot %patch0 -p1 -b .head %endif +%patch1 -p1 %build %configure --disable-static \ @@ -81,6 +83,9 @@ desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/ibus-setup-libbopo %{_datadir}/ibus/component/* %changelog +* Sun Jan 21 2024 Florian Weimer - 1.15.6-3 +- Add pointer casts for C89 compatibility + * Sat Jan 20 2024 Fedora Release Engineering - 1.15.6-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild