Repository navigation
Patches Applied
This fork applies the following fixes to the original source to allow compilation with modern GCC on 64-bit Linux. No functional behaviour has been changed.
Problem: static res_get_list() had no return type, which is illegal in C99 and later. GCC 14+ treats this as a hard error.
/* Before */
static res_get_list(RES_LIST *rl, char *msgbuf)
/* After */
static int res_get_list(RES_LIST *rl, char *msgbuf)Problem: The X_OFFSET_OF macro cast a pointer to int, which truncates the value on 64-bit platforms and produces incorrect struct field offsets.
/* Before */
#define X_OFFSET_OF(t,f) ( (int)&(((t *)0)->f) )
/* After */
# include <stddef.h>
# define X_OFFSET_OF(t,f) ( (int)offsetof(t,f) )The standard offsetof() macro from <stddef.h> is the correct way to compute field offsets portably.
Problem: A local variable char *p was assigned from strchr() called on a const char * argument, discarding the const qualifier. GCC emits a warning for this.
/* Before */
char *p;
/* After */
const char *p;Problem: XKeycodeToKeysym() was deprecated in X11R7.6 and removed in later releases.
/* xvtx.h — added include */
#include <X11/XKBlib.h>
/* xvtxevent.c — before */
KeySym k = XKeycodeToKeysym(tw->X->display, m, 0);
/* xvtxevent.c — after */
KeySym k = XkbKeycodeToKeysym(tw->X->display, m, 0, 0);The replacement XkbKeycodeToKeysym() takes an additional group parameter (set to 0 for the default group).
Problem: The original source only ships xterm.trm. Most modern terminal emulators report TERM=xterm-256color, causing xt to fail at startup with:
No term file or database entry found for term 'xterm-256color'
xt: cannot initialize terminal.
Fix: Added xterm-256color.trm as a copy of xterm.trm. The 256-colour escape sequences are handled by the terminal emulator itself; the .trm file only needs to describe the basic terminal capabilities that xt uses.