Description: 修复 GCC 14+ 下旧式空参数函数指针导致的编译失败
 GCC 14+ 对空参数列表的函数指针声明（如 EB_Error_Code(*funct)()）一律按
 无参数函数处理，带参调用 (*funct)(eb, word) 与传入真实函数指针均报硬错误，
 导致 ruby-eb 无法编译。本补丁为 easy_search/position_search 的 funct 参数、
 font2bitmapformat 的 w_size_func/n_size_func/conv_func 参数补齐完整函数原型；
 text_hook 第 6 参数的类型改为 const unsigned int *，使其与 EB_Hook.function
 完全一致，赋值时去掉 (int (*)()) 强转。
Author: tangxiaofeng <tangxiaofeng@kylinos.cn>
Forwarded: not-needed
Last-Update: 2026-09-05

--- ruby-eb-2.6.orig/eb.c
+++ ruby-eb-2.6/eb.c
@@ -110,7 +110,7 @@ reb_check_type(VALUE obj, VALUE klass)
 }
 
 static int
-text_hook(EB_Book * book, EB_Appendix * appendix, void *container, EB_Hook_Code code, int argc, const int *argv)
+text_hook(EB_Book * book, EB_Appendix * appendix, void *container, EB_Hook_Code code, int argc, const unsigned int *argv)
 {
     VALUE func, ret_buff, rargv, rb_eb, rb_hookset;
     int idx;
@@ -612,7 +612,7 @@ set_keywords(VALUE array, char **buffer,
 
 static VALUE
 easy_search(int argc, VALUE * argv, VALUE obj, int wordtype,
-            EB_Error_Code(*funct) ())
+            EB_Error_Code(*funct) (EB_Book *, const char *))
 {
     EB_Book *eb;
     void *word;
@@ -674,7 +674,8 @@ reb_endsearchword(int argc, VALUE * argv
 static VALUE
 reb_searchkeyword(int argc, VALUE * argv, VALUE obj)
 {
-    return easy_search(argc, argv, obj, SEARCHTYPE_WORDLIST, eb_search_keyword);
+    return easy_search(argc, argv, obj, SEARCHTYPE_WORDLIST,
+                       (EB_Error_Code (*) (EB_Book *, const char *)) eb_search_keyword);
 }
 
 
@@ -774,7 +775,7 @@ hitmaker2(VALUE reb, EB_Book * eb, unsig
 
 static VALUE
 position_search(int argc, VALUE * argv, VALUE obj, int wordtype,
-                EB_Error_Code(*funct) ())
+                EB_Error_Code(*funct) (EB_Book *, const char *))
 {
     EB_Book *eb;
     char *buffer[MAX_KEYWORDS];
@@ -832,7 +833,8 @@ reb_endsearchword2(int argc, VALUE * arg
 static VALUE
 reb_searchkeyword2(int argc, VALUE * argv, VALUE obj)
 {
-    return position_search(argc, argv, obj, SEARCHTYPE_WORDLIST, eb_search_keyword);
+    return position_search(argc, argv, obj, SEARCHTYPE_WORDLIST,
+                           (EB_Error_Code (*) (EB_Book *, const char *)) eb_search_keyword);
 }
 
 
@@ -1322,12 +1324,12 @@ rebfont_code(VALUE obj)
 
 static VALUE
 font2bitmapformat(struct ExtFont *font,
-                  EB_Error_Code(*w_size_func) (),
-                  EB_Error_Code(*n_size_func) (),
+                  EB_Error_Code(*w_size_func) (EB_Font_Code, size_t *),
+                  EB_Error_Code(*n_size_func) (EB_Font_Code, size_t *),
 #if EB_VERSION_MAJOR < 4 || (EB_VERSION_MAJOR == 4 && EB_VERSION_MINOR < 1)
-                  void (*conv_func) ())
+                  void (*conv_func) (const char *, int, int, char *, size_t *))
 #else
-                  EB_Error_Code(*conv_func) ())
+                  EB_Error_Code(*conv_func) (const char *, int, int, char *, size_t *))
 #endif
 {
     int size, retcode;
@@ -1531,7 +1533,7 @@ rebhk_register(int argc, VALUE * argv, V
     Data_Get_Struct(self, EB_Hookset, text_hookset);
     hook.code = hook_type;
     if (proc != Qnil) {
-        hook.function = (int (*)()) (text_hook);
+        hook.function = text_hook;
     }
     else {
         hook.function = NULL;

