head 1.1; access; symbols; locks; strict; comment @ * @; 1.1 date 2026.06.28.06.16.28; author tsutsui; state Exp; branches; next ; commitid J1Yf621yszsDTwLG; desc @@ 1.1 log @ja-freewnn-{lib,server}: fix builds with gcc 14 and later - Add necessary standard headers to pull proper prototypes in test programs in the generated configure script to avoid errors caused by -Wimplicit-function-declaration (which is fatal on -std=gnu23) - Use proper qsort(3)-compatible comparator prototypes - Add missing prototypes for several function pointer arguments - Fix other -Wimcompatiple-pointer-types warnings - Appease several -Wpointer-compare and -Wpointer-sign warnings - Move -Wchar-subscripts fixes from SUBST to explicit patch files - Also fix wnn_sStrncpy() to use the correct conversion direction (found during -Wincompatiple-pointer-types cleanup) While here, take MAINTAINERship. Bump PKGREVISIONs. @ text @$NetBSD$ - Fix build with -std=gnu23 (i.e. gcc14 and later) --- Wnn/jutil/atod.c.orig 2013-09-02 11:01:39.000000000 +0000 +++ Wnn/jutil/atod.c @@@@ -76,7 +76,7 @@@@ static char *rcs_id = "$Id: atod.c,v 1.1 extern int wnn_loadhinsi FRWNN_PARAMS((unsigned char*)), init_heap FRWNN_PARAMS((int,int,int,int,FILE*)), little_endian FRWNN_PARAMS(()), - Sorted FRWNN_PARAMS((register char*,register int,int,int (*sort_fun)(char*,char*))), + Sorted FRWNN_PARAMS((const void*,register int,int,WNN_CompareFunc)), asshuku FRWNN_PARAMS((int)), revdic FRWNN_PARAMS((struct JT *,int)); #ifdef CHINESE @@@@ -87,7 +87,7 @@@@ extern void ujis_header FRWNN_PARAMS((vo extern void read_ujis FRWNN_PARAMS((int,int,int)), reverse_yomi FRWNN_PARAMS((void)), create_rev_dict FRWNN_PARAMS((void)), - uniq_je FRWNN_PARAMS((int(*func)(char*,char*))), + uniq_je FRWNN_PARAMS((WNN_CompareFunc)), sort_if_not_sorted FRWNN_PARAMS((void)), output_header FRWNN_PARAMS((FILE*,struct JT*,struct wnn_file_head*)), udytoS FRWNN_PARAMS((w_char*,int,char*,struct uind1*)), @@@@ -97,8 +97,8 @@@@ extern void read_ujis FRWNN_PARAMS((int, rev_short_fun FRWNN_PARAMS((w_char*)), rev_w_char FRWNN_PARAMS((w_char*,int)); -extern int sort_func_sdic FRWNN_PARAMS((char*,char*)); -extern int sort_func_je FRWNN_PARAMS((char*,char*)); +extern int sort_func_sdic FRWNN_PARAMS((const void*,const void*)); +extern int sort_func_je FRWNN_PARAMS((const void*,const void*)); extern void set_cswidth FRWNN_PARAMS((register unsigned int)); static void ujistoud FRWNN_PARAMS((void)), @@@@ -573,12 +573,12 @@@@ yStrcmp (w_char* a, w_char*b) } int -sort_func_sdic (char* a, char* b) +sort_func_sdic (const void* a, const void* b) { int tmp; struct je *pa, *pb; - pa = *((struct je **) a); - pb = *((struct je **) b); + pa = *((struct je * const *) a); + pb = *((struct je * const *) b); tmp = yStrcmp (pa->yomi, pb->yomi); if (tmp) return (tmp); @@@@ -595,9 +595,9 @@@@ sort_func_sdic (char* a, char* b) static void sdic_sort (void) { - if (!Sorted ((char *) jeary, (int) jt.maxserial, sizeof (struct je *), sort_func_sdic)) + if (!Sorted (jeary, (int) jt.maxserial, sizeof (struct je *), sort_func_sdic)) { - qsort ((char *) jeary, (int) jt.maxserial, sizeof (struct je *), sort_func_sdic); + qsort (jeary, (int) jt.maxserial, sizeof (struct je *), sort_func_sdic); } } @