Tue, 21 Jan 2025 10:49:29 -0600
Fix invalid prototypes that will break with C23
Using `function()` used to mean "any number" of parameters, but as of C23, this
is now aligned with C++ and means _zero_ parameters. This will cause build
failures due to mismatched function parameters in GCC15, which switched to C23
by default.
Related to PIDGIN-18028, though I guess Gentoo didn't actually have the problem as they disabled Zephyr.
Testing Done:
Compiled with GCC15 without error.
Reviewed at https://reviews.imfreedom.org/r/3776/
--- a/configure.ac Tue Jan 21 10:44:24 2025 -0600 +++ b/configure.ac Tue Jan 21 10:49:29 2025 -0600 @@ -200,7 +200,7 @@ #include <time.h> #include <stdio.h> -int main() +int main(void) { char buf[6]; time_t t = time(NULL);
--- a/libpurple/protocols/zephyr/ZSendList.c Tue Jan 21 10:44:24 2025 -0600 +++ b/libpurple/protocols/zephyr/ZSendList.c Tue Jan 21 10:49:29 2025 -0600 @@ -18,7 +18,7 @@ Code_t ZSrvSendList(ZNotice_t *notice, char *list[], int nitems, - Z_AuthProc cert_routine, Code_t (*send_routine)()) + Z_AuthProc cert_routine, Z_SendProc send_routine) { Code_t retval; ZNotice_t newnotice;
--- a/libpurple/protocols/zephyr/ZSendNot.c Tue Jan 21 10:44:24 2025 -0600 +++ b/libpurple/protocols/zephyr/ZSendNot.c Tue Jan 21 10:49:29 2025 -0600 @@ -18,7 +18,7 @@ Code_t ZSrvSendNotice(ZNotice_t *notice, Z_AuthProc cert_routine, - Code_t (*send_routine)()) + Z_SendProc send_routine) { Code_t retval; ZNotice_t newnotice;
--- a/libpurple/protocols/zephyr/zephyr_internal.h Tue Jan 21 10:44:24 2025 -0600 +++ b/libpurple/protocols/zephyr/zephyr_internal.h Tue Jan 21 10:49:29 2025 -0600 @@ -147,6 +147,7 @@ /* Defines for ZFormatNotice, et al. */ typedef Code_t (*Z_AuthProc) ZP((ZNotice_t*, char *, int, int *)); +typedef Code_t (*Z_SendProc) ZP((ZNotice_t *, char *, int, int)); Code_t ZMakeAuthentication ZP((ZNotice_t*, char *,int, int*)); char *ZGetSender ZP((void)); @@ -163,9 +164,9 @@ Code_t ZReadAscii16 ZP((char *, int, unsigned short *)); Code_t ZSendPacket ZP((char*, int, int)); Code_t ZSendList ZP((ZNotice_t*, char *[], int, Z_AuthProc)); -Code_t ZSrvSendList ZP((ZNotice_t*, char*[], int, Z_AuthProc, Code_t (*)())); +Code_t ZSrvSendList ZP((ZNotice_t*, char*[], int, Z_AuthProc, Z_SendProc)); Code_t ZSendNotice ZP((ZNotice_t *, Z_AuthProc)); -Code_t ZSrvSendNotice ZP((ZNotice_t*, Z_AuthProc, Code_t (*)())); +Code_t ZSrvSendNotice ZP((ZNotice_t*, Z_AuthProc, Z_SendProc)); Code_t ZFormatNotice ZP((ZNotice_t*, char**, int*, Z_AuthProc)); Code_t ZFormatSmallNotice ZP((ZNotice_t*, ZPacket_t, int*, Z_AuthProc)); Code_t ZFormatRawNoticeList ZP((ZNotice_t *notice, char *list[], int nitems,