Tuesday, June 02, 2026

fixes for net/ytalk with llvm 22

I've fixed all the prototypes issues, even the warnings. This does compile cleanly with llvm v2, at least on amd64 Basic program appears to work, I've successfully opened a connection with myself on several machines, and the menus are also functional. (yes, it's a truckload of diffs) I had a bit of "fun" with the generic function pointers of the menu system, and also the BSD42_SOCK typedef, which is subtly different from our sockaddr_in, but removing it led to connection errors, so I've decided to leave it as-in for now. Some of the comments about spending hours debugging the talk connection protocols scared me away from digging further ;) Index: Makefile =================================================================== RCS file: /vide/cvs/ports/net/ytalk/Makefile,v diff -u -p -r1.39 Makefile --- Makefile 27 Sep 2023 14:18:41 -0000 1.39 +++ Makefile 2 Jun 2026 14:36:31 -0000 @@ -1,7 +1,7 @@ COMMENT= enhanced talk that allows for multiple parties DISTNAME= ytalk-3.1.1 -REVISION= 4 +REVISION= 5 CATEGORIES= net SITES= https://distfiles.sigtrap.nl/ @@ -9,6 +9,7 @@ SITES= https://distfiles.sigtrap.nl/ MAINTAINER= Marc Espie <espie@openbsd.org> PERMIT_PACKAGE= Yes +DEBUG_PACKAGES = ${BUILD_PACKAGES} WANTLIB= c curses Index: patches/patch-comm_c =================================================================== RCS file: patches/patch-comm_c diff -N patches/patch-comm_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-comm_c 2 Jun 2026 11:34:04 -0000 @@ -0,0 +1,234 @@ +Index: comm.c +--- comm.c.orig ++++ comm.c +@@ -58,10 +58,7 @@ static v3_winch v3w; + /* Set up a drain of out-of-band data. + */ + static void +-drain_user(user, len, func) +- yuser *user; +- int len; +- void (*func)(); ++drain_user(yuser *user, int len, void (*func)()) + { + if(len > user->dbuf_size) + { +@@ -76,10 +73,7 @@ drain_user(user, len, func) + /* Send out-of-band data. + */ + static void +-send_oob(fd, ptr, len) +- int fd; +- yaddr ptr; +- int len; ++send_oob(int fd, yaddr ptr, int len) + { + ychar oob, size; + static struct iovec iov[3]; +@@ -114,8 +108,7 @@ send_oob(fd, ptr, len) + * just now connected to. + */ + static void +-send_import(to, from) +- yuser *to, *from; ++send_import(yuser *to, yuser *from) + { + if(to->remote.vmajor > 2) + { +@@ -138,8 +131,7 @@ send_import(to, from) + /* Tell another ytalk connection to connect to a user. + */ + static void +-send_accept(to, from) +- yuser *to, *from; ++send_accept(yuser *to, yuser *from) + { + if(to->remote.vmajor > 2) + { +@@ -162,9 +154,7 @@ send_accept(to, from) + /* Process a Ytalk version 2.? data packet. + */ + static void +-v2_process(user, pack) +- yuser *user; +- v2_pack *pack; ++v2_process(yuser *user, v2_pack *pack) + { + register yuser *u; + ylong host_addr; +@@ -232,9 +222,7 @@ v2_process(user, pack) + /* Process a Ytalk version 3.? data packet. + */ + static void +-v3_process_pack(user, pack) +- yuser *user; +- v3_pack *pack; ++v3_process_pack(yuser *user, v3_pack *pack) + { + register yuser *u, *u2; + ylong host_addr, pid; +@@ -306,9 +294,7 @@ v3_process_pack(user, pack) + * them later. + */ + static void +-v3_process_flags(user, pack) +- yuser *user; +- v3_flags *pack; ++v3_process_flags(yuser *user, v3_flags *pack) + { + switch(pack->code) + { +@@ -324,9 +310,7 @@ v3_process_flags(user, pack) + /* Process a Ytalk version 3.? winch packet. + */ + static void +-v3_process_winch(user, pack) +- yuser *user; +- v3_winch *pack; ++v3_process_winch(yuser *user, v3_winch *pack) + { + switch(pack->code) + { +@@ -355,9 +339,7 @@ v3_process_winch(user, pack) + * function based on the type of packet. + */ + static void +-v3_process(user, ptr) +- yuser *user; +- yaddr ptr; ++v3_process(yuser *user, yaddr ptr) + { + ychar *str; + +@@ -387,8 +369,7 @@ v3_process(user, ptr) + * data from the canonical input stream. + */ + static void +-read_user(fd) +- int fd; ++read_user(int fd) + { + register ychar *c, *p; + register int rc; +@@ -521,8 +502,7 @@ read_user(fd) + /* Initial Handshaking: read the parameter pack from another ytalk user. + */ + static void +-ytalk_user(fd) +- int fd; ++ytalk_user(int fd) + { + register yuser *user, *u; + u_short cols; +@@ -617,8 +597,7 @@ ytalk_user(fd) + * this is another ytalk user. + */ + static void +-connect_user(fd) +- int fd; ++connect_user(int fd) + { + register yuser *user, *u; + +@@ -685,12 +664,11 @@ connect_user(fd) + * my edit keys. + */ + static void +-contact_user(fd) +- int fd; ++contact_user(int fd) + { + register yuser *user; + register int n; +- size_t socklen; ++ socklen_t socklen; + struct sockaddr_in peer; + char *hname; + +@@ -742,8 +720,7 @@ contact_user(fd) + /* Do a word wrap. + */ + static int +-word_wrap(user) +- register yuser *user; ++word_wrap(yuser *user) + { + register int i, x, bound; + static ychar temp[20]; +@@ -767,8 +744,7 @@ word_wrap(user) + * to that instead of messing up his screen. + */ + static int +-announce(user) +- yuser *user; ++announce(yuser *user) + { + register int rc, fd; + +@@ -818,9 +794,7 @@ announce(user) + /* Invite a user into the conversation. + */ + yuser * +-invite(name, send_announce) +- register char *name; +- int send_announce; ++invite(char *name, int send_announce) + { + register int rc; + char *hisname, *hishost, *histty; +@@ -1012,8 +986,7 @@ house_clean() + } + + void +-send_winch(user) +- yuser *user; ++send_winch(yuser *user) + { + register yuser *u; + +@@ -1067,10 +1040,7 @@ send_end_region() + * users if the given user is either "me" or NULL. + */ + void +-send_users(user, buf, len) +- yuser *user; +- ychar *buf; +- register int len; ++send_users(yuser *user, ychar *buf, int len) + { + register ychar *o, *b; + register yuser *u; +@@ -1112,10 +1082,7 @@ send_users(user, buf, len) + /* Display user input. Emulate ANSI. + */ + void +-show_input(user, buf, len) +- yuser *user; +- register ychar *buf; +- register int len; ++show_input(yuser *user, ychar *buf, int len) + { + if(user->got_esc) + { +@@ -1341,10 +1308,7 @@ process_esc: + /* Process keyboard input. + */ + void +-my_input(user, buf, len) +- yuser *user; +- register ychar *buf; +- int len; ++my_input(yuser *user, ychar *buf, int len) + { + register ychar *c; + register int i; +@@ -1441,8 +1405,7 @@ my_input(user, buf, len) + } + + void +-lock_flags(flags) +- ylong flags; ++lock_flags(ylong flags) + { + register yuser *u; + Index: patches/patch-cwin_c =================================================================== RCS file: patches/patch-cwin_c diff -N patches/patch-cwin_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-cwin_c 2 Jun 2026 09:29:15 -0000 @@ -0,0 +1,147 @@ +Index: cwin.c +--- cwin.c.orig ++++ cwin.c +@@ -43,8 +43,7 @@ static ywin *head; /* head of linked list */ + /* Take input from the user. + */ + static void +-curses_input(fd) +- int fd; ++curses_input(int fd) + { + register int rc; + static ychar buf[MAXBUF]; +@@ -59,9 +58,7 @@ curses_input(fd) + } + + static ywin * +-new_ywin(user, title) +- yuser *user; +- char *title; ++new_ywin(yuser *user, char *title) + { + register ywin *out; + register int len; +@@ -76,9 +73,7 @@ new_ywin(user, title) + } + + static void +-make_win(w, height, width, row, col) +- ywin *w; +- int height, width, row, col; ++make_win(ywin *w, int height, int width, int row, int col) + { + if((w->win = newwin(height, width, row, col)) == NULL) + { +@@ -97,8 +92,7 @@ make_win(w, height, width, row, col) + } + + static void +-draw_title(w) +- ywin *w; ++draw_title(ywin *w) + { + register int pad, x; + register char *t; +@@ -129,8 +123,7 @@ draw_title(w) + /* Return number of lines per window, given "wins" windows. + */ + static int +-win_size(wins) +- int wins; ++win_size(int wins) + { + return (LINES - 1) / wins; + } +@@ -138,7 +131,7 @@ win_size(wins) + /* Break down and redraw all user windows. + */ + static void +-curses_redraw() ++curses_redraw(void) + { + register ywin *w; + register int row, wins, wsize; +@@ -261,9 +254,7 @@ end_curses() + /* Open a new window. + */ + int +-open_curses(user, title) +- yuser *user; +- char *title; ++open_curses(yuser *user, char *title) + { + register ywin *w; + register int wins; +@@ -300,8 +291,7 @@ open_curses(user, title) + /* Close a window. + */ + void +-close_curses(user) +- yuser *user; ++close_curses(yuser *user) + { + register ywin *w, *p; + +@@ -330,9 +320,7 @@ close_curses(user) + } + + void +-addch_curses(user, c) +- yuser *user; +- register ychar c; ++addch_curses(yuser *user, ychar c) + { + register ywin *w; + register int x, y; +@@ -345,9 +333,7 @@ addch_curses(user, c) + } + + void +-move_curses(user, y, x) +- yuser *user; +- register int y, x; ++move_curses(yuser *user, int y, int x) + { + register ywin *w; + +@@ -356,8 +342,7 @@ move_curses(user, y, x) + } + + void +-clreol_curses(user) +- register yuser *user; ++clreol_curses(yuser *user) + { + register ywin *w; + +@@ -366,8 +351,7 @@ clreol_curses(user) + } + + void +-clreos_curses(user) +- register yuser *user; ++clreos_curses(yuser *user) + { + register ywin *w; + +@@ -376,8 +360,7 @@ clreos_curses(user) + } + + void +-scroll_curses(user) +- register yuser *user; ++scroll_curses(yuser *user) + { + register ywin *w; + +@@ -400,8 +383,7 @@ scroll_curses(user) + } + + void +-flush_curses(user) +- register yuser *user; ++flush_curses(yuser *user) + { + register ywin *w; + Index: patches/patch-cwin_h =================================================================== RCS file: patches/patch-cwin_h diff -N patches/patch-cwin_h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-cwin_h 2 Jun 2026 09:28:33 -0000 @@ -0,0 +1,36 @@ +Index: cwin.h +--- cwin.h.orig ++++ cwin.h +@@ -16,19 +16,19 @@ + + /* Mail comments or questions to ytalk@austin.eds.com */ + +-extern void init_curses (); +-extern void end_curses (); +-extern int open_curses ( /* yuser, title */ ); +-extern void close_curses ( /* yuser */ ); +-extern void addch_curses ( /* yuser, char */ ); +-extern void move_curses ( /* yuser, y, x */ ); +-extern void clreol_curses ( /* yuser */ ); +-extern void clreos_curses ( /* yuser */ ); +-extern void scroll_curses ( /* yuser */ ); +-extern void flush_curses ( /* yuser */ ); +-extern void redisplay_curses(); +-extern void set_raw_curses(); +-extern void set_cooked_curses(); ++extern void init_curses (void); ++extern void end_curses (void); ++extern int open_curses (yuser *, char *); ++extern void close_curses (yuser *); ++extern void addch_curses (yuser *, ychar); ++extern void move_curses (yuser *, int, int); ++extern void clreol_curses (yuser *); ++extern void clreos_curses (yuser *); ++extern void scroll_curses (yuser *); ++extern void flush_curses (yuser *); ++extern void redisplay_curses(void); ++extern void set_raw_curses(void); ++extern void set_cooked_curses(void); + + #ifndef getyx + # define getyx(w,y,x) y = w->_cury, x = w->_curx Index: patches/patch-exec_c =================================================================== RCS file: /vide/cvs/ports/net/ytalk/patches/patch-exec_c,v diff -u -p -r1.2 patch-exec_c --- patches/patch-exec_c 11 Mar 2022 19:48:19 -0000 1.2 +++ patches/patch-exec_c 2 Jun 2026 12:05:23 -0000 @@ -1,6 +1,29 @@ ---- exec.c.orig Fri Dec 7 22:54:16 2012 -+++ exec.c Fri Dec 7 22:57:00 2012 -@@ -100,7 +100,11 @@ getpty(name) +Index: exec.c +--- exec.c.orig ++++ exec.c +@@ -47,6 +47,7 @@ + # endif + # endif +

No comments:

Post a Comment