xterm - 1996/1/7 - patch #2 - T.Dickey
This is my second patch to xterm. It corrects most of the gcc warnings (except
for some that are due to X header files ;-). I compared objects to keep track
of the changes that don't affect the object code (n/c) versus those that do.
At this point, I'm compiling (fairly) clean with gcc options
-Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wnested-externs
(I also compiled with -Wshadow, but while that found some things that I wanted
to find, there's far too many warnings from the X headers to be usable in this
context).
The changes:
Tekproc.c:
+ parenthesized expression to avoid gcc warning -- n/c.
+ corrected nested-extern declaration for Bool
waiting_for_initial_map; ourTopLevelShellArgs, and
number_ourTopLevelShellArgs - n/c
charproc.c:
+ corrected potentially-unintialized variables 'scstype', 'xim',
and 'input_style' -- changes object.
+ adjusted logic of VTparse so that gcc won't warn about setjmp
clobbering parsestate -- changes object.
+ corrected initialization of 'scstype', which could have been
clobbered by setjmp/longjmp - changes object.
+ corrected nested-extern declaration of 'term', 'ProgramName'
- n/c
cursor.c:
+ corrected nested-extern declaration of 'term' -- n/c
+ renamed 'term' parameters to avoid gcc -Wshadow warning - n/c
input.c:
+ change interface of StringInput to assume size_t (i.e.,
unsigned) nbytes -- changes object.
+ change interface of funcvalue, and sunfuncvalue to use
'KeySym' type instead of 'int' - changes object.
main.c:
+ moved definitions of SIGNAL_T, SIGNAL_RETURN to proto.h - n/c
+ corrected missing params of 'do_hangup()' -- changes object
(note: the missing params were not used).
+ corrected missing param of 'Error()' -- changes object
+ corrected nested-extern 'environ' - n/c
+ adjusted assignments to 'tty_got_hung' and 'no_dev_tty' so
that gcc can see they won't be clobbered by the longjmp -
changes object.
+ use Size_t type - n/c.
menu.c:
+ removed redundant prototype for 'do_hangup()' -- n/c.
+ renamed 'time' parameters to avoid gcc -Wshadow warning - n/c
menu.h:
+ renamed 'time' parameters to avoid gcc -Wshadow warning - n/c
misc.c:
+ corrected definition of 'HandleFocusChange()' -- changes
object
+ cast parameters in call to 'TekExpose()' -- n/c
+ corrected nested-extern declarations of 'term', 'toplevel',
ProgramName, and 'environ' -- n/c.
+ use Size_t type - n/c.
proto.h:
+ moved definition of SIGNAL_T (and SIGNAL_RETURN) here from
main.c, resize.c to allow use of this symbol in prototypes
(mostly in xterm.h).
+ added definition 'Size_t' to use as corrected type for
strncpy, malloc sizes - n/c.
resize.c:
+ moved SIGNAL_T definition to proto.h -- n/c.
+ use Size_t type - n/c.
screen.c:
+ use Size_t type - n/c.
tabs.c:
+ corrected nested-extern declaration of 'term' -- n/c
util.c:
+ corrected/supplied parameters to 'TekExpose()' -- changes
object (note: 'TekExpose()' doesn't use its parameters).
+ corrected nested-extern declaration of
'waiting_for_initial_map' -- n/c.
+ renamed 'term' parameters to avoid gcc -Wshadow warning - n/c
xterm.h:
+ prototype 'do_hangup()', 'HandleFocusChange()',
'TekExpose()', 'Error()', 'Exit()' - forces changes in
various places.
+ adjusted prototypes that pass 'Boolean' arguments to use
'int' (this is the "correct" ANSI approach to extended
compiles; it's worth mentioning that gcc doesn't meet the
ANSI spec here). I used gcc -Wconversion to find these, but
there's a lot of unrelated warnings that are due to setting
NARROWPROTO in the config - n/c.
+ renamed 'term' parameters to avoid gcc -Wshadow warning - n/c
--------------------------------------------------------------------------------
Tekproc.c | 11 +++++------
charproc.c | 19 +++++++++++--------
cursor.c | 27 +++++++++++++--------------
input.c | 12 ++++++------
main.c | 33 +++++++++++----------------------
menu.c | 7 +++----
menu.h | 2 +-
misc.c | 31 ++++++++++++++++---------------
proto.h | 15 +++++++++++++++
resize.c | 8 +-------
screen.c | 5 +++--
tabs.c | 3 ++-
util.c | 25 +++++++++++++------------
xterm.h | 31 +++++++++++++++++--------------
14 files changed, 117 insertions, 112 deletions
--------------------------------------------------------------------------------
Index: Tekproc.c
--- xterm-original/Tekproc.c Sat Jan 6 18:10:07 1996
+++ xterm-patched/Tekproc.c Sun Jan 7 11:04:36 1996
@@ -159,6 +159,9 @@
#define unput(c) *Tpushback++ = c
extern Widget toplevel;
+extern Bool waiting_for_initial_map;
+extern Arg ourTopLevelShellArgs[];
+extern int number_ourTopLevelShellArgs;
static struct Tek_Char {
int hsize; /* in Tek units */
@@ -352,9 +355,6 @@
static TekWidget CreateTekWidget ()
{
- extern Arg ourTopLevelShellArgs[];
- extern int number_ourTopLevelShellArgs;
-
/* this causes the Initialize method to be called */
tekshellwidget = XtCreatePopupShell ("tektronix", topLevelShellWidgetClass,
toplevel, ourTopLevelShellArgs,
@@ -854,7 +854,6 @@
Region region;
{
register TScreen *screen = &term->screen;
- extern Bool waiting_for_initial_map;
#ifdef lint
region = region;
@@ -994,8 +993,8 @@
(t = &TekChar[screen->cur.fontsize])->hsize
);
- if(screen->margin == MARGIN1 && x < 0 || screen->margin == MARGIN2
- && x < TEKWIDTH / 2) {
+ if(((screen->margin == MARGIN1) && (x < 0))
+ || ((screen->margin == MARGIN2) && (x < TEKWIDTH / 2))) {
if((l = (screen->cur_Y + (t->vsize - 1)) / t->vsize + 1) >=
t->nlines) {
screen->margin = !screen->margin;
Index: charproc.c
--- xterm-original/charproc.c Sat Jan 6 19:52:54 1996
+++ xterm-patched/charproc.c Sun Jan 7 10:55:38 1996
@@ -112,9 +112,10 @@
#include "xterm.h"
extern jmp_buf VTend;
-
+extern XtermWidget term;
extern XtAppContext app_con;
extern Widget toplevel;
+extern char *ProgramName;
extern int LoadNewFont PROTO((TScreen *screen, char *nfontname, char *bfontname, Bool doresize, int fontnum));
extern int in_put PROTO((void));
@@ -705,13 +706,17 @@
static void VTparse()
{
register TScreen *screen = &term->screen;
- register int *parsestate = groundtable;
+ register int *parsestate;
register unsigned int c;
register unsigned char *cp;
register int row, col, top, bot, scstype;
- if(setjmp(vtjmpbuf))
- parsestate = groundtable;
+ /* We longjmp back to this point in VTReset() */
+ (void)setjmp(vtjmpbuf);
+
+ parsestate = groundtable;
+ scstype = 0;
+
for( ; ; ) {
switch (parsestate[c = doinput()]) {
case CASE_PRINT:
@@ -2266,7 +2271,6 @@
{
char buf[2];
register i = 1;
- extern XtermWidget term;
#ifdef AMOEBA
if (ttypreprocess(c)) return;
@@ -2809,9 +2813,9 @@
*end,
tmp[1024],
buf[32];
- XIM xim;
+ XIM xim = 0;
XIMStyles *xim_styles;
- XIMStyle input_style;
+ XIMStyle input_style = 0;
Boolean found;
term->screen.xic = NULL;
@@ -3246,7 +3250,6 @@
int numbers; /* count of numbers per range */
int digits; /* count of digits in a number */
static char *errfmt = "%s: %s in range string \"%s\" (position %d)\n";
- extern char *ProgramName;
if (!s || !s[0]) return -1;
Index: cursor.c
--- xterm-original/cursor.c Sat Jan 6 18:01:03 1996
+++ xterm-patched/cursor.c Sun Jan 7 12:20:50 1996
@@ -31,13 +31,13 @@
#include "xterm.h"
+extern XtermWidget term; /* %%% gross */
+
static void _CheckSelection PROTO((TScreen *screen));
static void _CheckSelection(screen)
register TScreen *screen;
{
- extern XtermWidget term; /* %%% gross */
-
if (screen->cur_row > screen->endHRow ||
(screen->cur_row == screen->endHRow &&
screen->cur_col >= screen->endHCol)) {}
@@ -82,7 +82,6 @@
int n;
{
register int i, j, k, rev;
- extern XtermWidget term;
if((rev = (term->flags & (REVERSEWRAP | WRAPAROUND)) ==
(REVERSEWRAP | WRAPAROUND)) && screen->do_wrap)
@@ -224,15 +223,15 @@
* Save Cursor and Attributes
*/
void
-CursorSave(term, sc)
-register XtermWidget term;
+CursorSave(tw, sc)
+register XtermWidget tw;
register SavedCursor *sc;
{
- register TScreen *screen = &term->screen;
+ register TScreen *screen = &tw->screen;
sc->row = screen->cur_row;
sc->col = screen->cur_col;
- sc->flags = term->flags;
+ sc->flags = tw->flags;
sc->curgl = screen->curgl;
sc->curgr = screen->curgr;
memmove( sc->gsets, screen->gsets, sizeof(screen->gsets));
@@ -242,17 +241,17 @@
* Restore Cursor and Attributes
*/
void
-CursorRestore(term, sc)
-register XtermWidget term;
+CursorRestore(tw, sc)
+register XtermWidget tw;
register SavedCursor *sc;
{
- register TScreen *screen = &term->screen;
+ register TScreen *screen = &tw->screen;
memmove( screen->gsets, sc->gsets, sizeof(screen->gsets));
screen->curgl = sc->curgl;
screen->curgr = sc->curgr;
- term->flags &= ~(BOLD|INVERSE|UNDERLINE|ORIGIN);
- term->flags |= sc->flags & (BOLD|INVERSE|UNDERLINE|ORIGIN);
- CursorSet (screen, (term->flags & ORIGIN) ? sc->row - screen->top_marg
- : sc->row, sc->col, term->flags);
+ tw->flags &= ~(BOLD|INVERSE|UNDERLINE|ORIGIN);
+ tw->flags |= sc->flags & (BOLD|INVERSE|UNDERLINE|ORIGIN);
+ CursorSet (screen, (tw->flags & ORIGIN) ? sc->row - screen->top_marg
+ : sc->row, sc->col, tw->flags);
}
Index: input.c
--- xterm-original/input.c Sat Jan 6 18:24:21 1996
+++ xterm-patched/input.c Sun Jan 7 11:58:18 1996
@@ -41,8 +41,8 @@
static char *kypd_apl = " ABCDEFGHIJKLMNOPQRSTUVWXYZ??????abcdefghijklmnopqrstuvwxyzXXX";
static char *cur = "DACB";
-static int funcvalue PROTO((int keycode));
-static int sunfuncvalue PROTO((int keycode));
+static int funcvalue PROTO((KeySym keycode));
+static int sunfuncvalue PROTO((KeySym keycode));
static void AdjustAfterInput PROTO((TScreen *screen));
extern Boolean sunFunctionKeys;
@@ -185,7 +185,7 @@
StringInput (screen, string, nbytes)
register TScreen *screen;
register char *string;
- int nbytes;
+ Size_t nbytes;
{
int pty = screen->respond;
@@ -194,14 +194,14 @@
TekGINoff();
nbytes--;
}
- while (nbytes-- > 0)
+ while (nbytes-- != 0)
unparseputc(*string++, pty);
if(!screen->TekEmu)
AdjustAfterInput(screen);
}
static int funcvalue (keycode)
- int keycode;
+ KeySym keycode;
{
switch (keycode) {
case XK_F1: return(11);
@@ -242,7 +242,7 @@
static int sunfuncvalue (keycode)
- int keycode;
+ KeySym keycode;
{
switch (keycode) {
case XK_F1: return(224);
Index: main.c
--- xterm-original/main.c Sat Jan 6 19:50:50 1996
+++ xterm-patched/main.c Sun Jan 7 11:39:35 1996
@@ -422,16 +422,6 @@
#endif
#endif
-#ifdef SIGNALRETURNSINT
-#define SIGNAL_T int
-#define SIGNAL_RETURN return 0
-#else
-#define SIGNAL_T void
-#define SIGNAL_RETURN return
-#endif
-
-SIGNAL_T Exit();
-
#ifndef X_NOT_POSIX
#include <unistd.h>
#else
@@ -577,7 +567,7 @@
static int override_tty_modes = 0;
struct _xttymodes {
char *name;
- int len;
+ Size_t len;
int set;
char value;
} ttymodelist[] = {
@@ -1000,9 +990,6 @@
Widget toplevel;
Bool waiting_for_initial_map;
-extern void do_hangup();
-extern void xt_error();
-
/*
* DeleteWindow(): Action proc to implement ICCCM delete_window.
*/
@@ -1018,12 +1005,12 @@
if (term->screen.Tshow)
hide_vt_window();
else
- do_hangup(w);
+ do_hangup(w, (XtPointer)0, (XtPointer)0);
else
if (term->screen.Vshow)
hide_tek_window();
else
- do_hangup(w);
+ do_hangup(w, (XtPointer)0, (XtPointer)0);
}
/* ARGSUSED */
@@ -1056,7 +1043,6 @@
register TScreen *screen;
register int pty;
int Xsocket, mode;
- int xerror(), xioerror();
#ifdef I18N
XtSetLanguageProc(NULL,NULL,NULL);
@@ -1605,14 +1591,14 @@
#else /* !MINIX */
#ifdef USE_SYSV_TERMIO
if (0 > (mode = fcntl(pty, F_GETFL, 0)))
- Error();
+ Error(1);
#ifdef O_NDELAY
mode |= O_NDELAY;
#else
mode |= O_NONBLOCK;
#endif /* O_NDELAY */
if (fcntl(pty, F_SETFL, mode))
- Error();
+ Error(1);
#else /* USE_SYSV_TERMIO */
mode = 1;
if (ioctl (pty, FIONBIO, (char *)&mode) == -1) SysError (ERROR_FIONBIO);
@@ -1969,6 +1955,8 @@
#ifndef AMOEBA
+extern char **environ;
+
int
spawn ()
/*
@@ -2060,7 +2048,7 @@
setgid (screen->gid);
setuid (screen->uid);
} else {
- Bool tty_got_hung = False;
+ Bool tty_got_hung;
/*
* Sometimes /dev/tty hangs on open (as in the case of a pty
@@ -2072,6 +2060,7 @@
if (! setjmp(env)) {
tty = open ("/dev/tty", O_RDWR, 0);
alarm(0);
+ tty_got_hung = False;
} else {
tty_got_hung = True;
tty = -1;
@@ -2085,6 +2074,7 @@
* no controlling terminal, but some systems (e.g. SunOS 4.0)
* seem to return EIO. Solaris 2.3 is said to return EINVAL.
*/
+ no_dev_tty = FALSE;
if (tty < 0) {
if (tty_got_hung || errno == ENXIO || errno == EIO ||
errno == EINVAL || errno == ENOTTY) {
@@ -2277,7 +2267,6 @@
/*
* now in child process
*/
- extern char **environ;
#if defined(_POSIX_SOURCE) || defined(SVR4) || defined(__convex__)
int pgrp = setsid();
#else
@@ -3751,7 +3740,7 @@
{
#ifndef USE_SYSV_ENVVARS
register char *ptr1, *ptr2;
- register int i;
+ register Size_t i;
register int li_first = 0;
register char *temp;
Index: menu.c
--- xterm-original/menu.c Sat Jan 6 20:14:35 1996
+++ xterm-patched/menu.c Sun Jan 7 12:24:09 1996
@@ -52,7 +52,6 @@
static void do_logging PROTO_XT_CALLBACK_ARGS;
#endif
-extern void do_hangup PROTO_XT_CALLBACK_ARGS;
static void do_allow132 PROTO_XT_CALLBACK_ARGS;
static void do_allowsends PROTO_XT_CALLBACK_ARGS;
static void do_altscreen PROTO_XT_CALLBACK_ARGS;
@@ -387,8 +386,8 @@
*/
/* ARGSUSED */
-void DoSecureKeyboard (time)
- Time time;
+void DoSecureKeyboard (tp)
+ Time tp;
{
do_securekbd (term->screen.mainMenu, NULL, NULL);
}
@@ -854,7 +853,7 @@
} else if (screen->Tshow || allowswitch) { /* is showing, turn off */
set_vt_visibility (FALSE);
if (!screen->TekEmu && TekRefresh) dorefresh ();
- end_vt_mode ();
+ end_vt_mode (); /* WARNING: this does a longjmp... */
} else
Bell();
}
Index: menu.h
--- xterm-original/menu.h Sat Jan 6 20:08:57 1996
+++ xterm-patched/menu.h Sun Jan 7 12:23:42 1996
@@ -79,7 +79,7 @@
extern void HandleLogging PROTO_XT_ACTIONS_ARGS;
#endif
-extern void DoSecureKeyboard PROTO((Time time));
+extern void DoSecureKeyboard PROTO((Time tp));
/*
* The following definitions MUST match the order of entries given in
Index: misc.c
--- xterm-original/misc.c Sat Jan 6 18:06:21 1996
+++ xterm-patched/misc.c Sun Jan 7 11:28:52 1996
@@ -55,6 +55,8 @@
#include "module/proc.h"
#endif
+extern char **environ; /* used in 'Setenv()' */
+
extern jmp_buf Tekend;
extern jmp_buf VTend;
@@ -65,6 +67,9 @@
extern char *getenv();
#endif
+extern XtermWidget term;
+extern Widget toplevel; /* used in 'ChangeGroup()' */
+
extern Boolean AllocateColor PROTO((XtermWidget pTerm, ScrnColors *pNew, int ndx, char *name));
extern Boolean ChangeColorsRequest PROTO((XtermWidget pTerm, int start, char *names));
extern Boolean GetOldColors PROTO(( XtermWidget pTerm));
@@ -121,7 +126,7 @@
Cursor make_colored_cursor (cursorindex, fg, bg)
- int cursorindex; /* index into font */
+ unsigned cursorindex; /* index into font */
unsigned long fg, bg; /* pixel value */
{
register TScreen *screen = &term->screen;
@@ -253,11 +258,13 @@
/*ARGSUSED*/
-void HandleFocusChange(w, eventdata, event)
+void HandleFocusChange(w, eventdata, ev, cont)
Widget w;
-register XFocusChangeEvent *event;
-caddr_t eventdata;
+XEvent *ev;
+XtPointer eventdata;
+Boolean *cont;
{
+ register XFocusChangeEvent *event = (XFocusChangeEvent *)ev;
register TScreen *screen = &term->screen;
if(event->type == FocusIn)
@@ -337,7 +344,6 @@
void
Bell()
{
- extern XtermWidget term;
register TScreen *screen = &term->screen;
struct timeval curtime;
long now_msecs;
@@ -382,7 +388,6 @@
void
VisualBell()
{
- extern XtermWidget term;
register TScreen *screen = &term->screen;
register Pixel xorPixel = screen->foreground ^ term->core.background_pixel;
XGCValues gcval;
@@ -443,7 +448,6 @@
void
Redraw()
{
- extern XtermWidget term;
register TScreen *screen = &term->screen;
XExposeEvent event;
@@ -466,7 +470,7 @@
event.window = TWindow(screen);
event.width = tekWidget->core.width;
event.height = tekWidget->core.height;
- TekExpose (tekWidget, &event, NULL);
+ TekExpose ((Widget)tekWidget, (XEvent *)&event, NULL);
}
}
@@ -764,7 +768,6 @@
String attribute;
XtArgVal value;
{
- extern Widget toplevel;
Arg args[1];
XtSetArg( args[0], attribute, value );
@@ -1024,7 +1027,6 @@
Cleanup (code)
int code;
{
- extern XtermWidget term;
register TScreen *screen;
screen = &term->screen;
@@ -1051,9 +1053,8 @@
Setenv (var, value)
register char *var, *value;
{
- extern char **environ;
register int envindex = 0;
- register int len = strlen(var);
+ register Size_t len = strlen(var);
while (environ [envindex] != NULL) {
if (strncmp (environ [envindex], var, len) == 0) {
@@ -1084,7 +1085,7 @@
register char *s1, *s2;
{
register char *s3;
- int s2len = strlen (s2);
+ Size_t s2len = strlen (s2);
while ((s3=strchr(s1, *s2)) != NULL) {
if (strncmp(s3, s2, s2len) == 0)
@@ -1118,11 +1119,11 @@
Exit(ERROR_XIOERROR);
}
+extern char *ProgramName;
+
void xt_error(message)
String message;
{
- extern char *ProgramName;
-
(void) fprintf (stderr, "%s Xt error: %s\n", ProgramName, message);
exit(1);
}
Index: proto.h
--- xterm-original/proto.h Sat Jan 6 20:06:29 1996
+++ xterm-patched/proto.h Sun Jan 7 11:29:52 1996
@@ -26,4 +26,19 @@
#define PROTO_XT_SEL_CB_ARGS \
PROTO((Widget w, XtPointer client_data, Atom *selection, Atom *type, XtPointer value, unsigned long *length, int *format))
+#ifdef SIGNALRETURNSINT
+#define SIGNAL_T int
+#define SIGNAL_RETURN return 0
+#else
+#define SIGNAL_T void
+#define SIGNAL_RETURN return
+#endif
+
+#undef Size_t
+#ifndef X_NOT_STDC_ENV
+#define Size_t size_t
+#else
+#define Size_t int
+#endif
+
#endif/*included_proto_h*/
Index: resize.c
--- xterm-original/resize.c Sat Jan 6 18:37:40 1996
+++ xterm-patched/resize.c Sun Jan 7 11:29:32 1996
@@ -103,12 +103,6 @@
#include <signal.h>
#include <pwd.h>
-#ifdef SIGNALRETURNSINT
-#define SIGNAL_T int
-#else
-#define SIGNAL_T void
-#endif
-
#ifndef X_NOT_STDC_ENV
#include <stdlib.h>
#else
@@ -493,7 +487,7 @@
register char *s1, *s2;
{
register char *s3;
- int s2len = strlen (s2);
+ Size_t s2len = strlen (s2);
while ((s3 = strchr(s1, *s2)) != NULL)
{
Index: screen.c
--- xterm-original/screen.c Sat Jan 6 17:51:36 1996
+++ xterm-patched/screen.c Sun Jan 7 11:33:54 1996
@@ -110,7 +110,8 @@
{
register ScrnBuf base;
register Char *tmp;
- register int i, minrows, mincols;
+ register int i, minrows;
+ register Size_t mincols;
Char *oldbuf;
int move_down = 0, move_up = 0;
@@ -330,7 +331,7 @@
{
register Char *ptr = sb[4 * row];
register Char *attrs = sb[4 * row + 1];
- register nbytes = (size - n - col);
+ register Size_t nbytes = (size - n - col);
int wrappedbit = attrs[0]&LINEWRAPPED;
memmove( ptr + col, ptr + col + n, nbytes);
Index: tabs.c
--- xterm-original/tabs.c Sat Jan 6 12:25:15 1996
+++ xterm-patched/tabs.c Sun Jan 7 11:02:04 1996
@@ -31,6 +31,8 @@
#include "xterm.h"
+extern XtermWidget term;
+
/*
* This file presumes 32bits/word. This is somewhat of a crock, and should
* be fixed sometime.
@@ -85,7 +87,6 @@
Tabs tabs;
int col;
{
- extern XtermWidget term;
register TScreen *screen = &term->screen;
if(screen->curses && screen->do_wrap && (term->flags & WRAPAROUND)) {
Index: util.c
--- xterm-original/util.c Sat Jan 6 18:02:32 1996
+++ xterm-patched/util.c Sun Jan 7 12:22:30 1996
@@ -37,6 +37,8 @@
#include "xterm.h"
+extern Bool waiting_for_initial_map;
+
extern int handle_translated_exposure PROTO((TScreen *screen, int rect_x, int rect_y, unsigned int rect_width, unsigned int rect_height));
extern void CopyWait PROTO((TScreen *screen));
static void copy_area PROTO((TScreen *screen, int src_x, int src_y, unsigned int width, unsigned int height, int dest_x, int dest_y));
@@ -915,7 +917,6 @@
register unsigned int rect_width, rect_height;
{
register int toprow, leftcol, nrows, ncols;
- extern Bool waiting_for_initial_map;
toprow = (rect_y - screen->border) / FontHeight(screen);
if(toprow < 0)
@@ -957,15 +958,15 @@
/***====================================================================***/
void
-GetColors(term,pColors)
- XtermWidget term;
+GetColors(tw,pColors)
+ XtermWidget tw;
ScrnColors *pColors;
{
- register TScreen *screen = &term->screen;
+ register TScreen *screen = &tw->screen;
pColors->which= 0;
SET_COLOR_VALUE(pColors,TEXT_FG, screen->foreground);
- SET_COLOR_VALUE(pColors,TEXT_BG, term->core.background_pixel);
+ SET_COLOR_VALUE(pColors,TEXT_BG, tw->core.background_pixel);
SET_COLOR_VALUE(pColors,TEXT_CURSOR, screen->cursorcolor);
SET_COLOR_VALUE(pColors,MOUSE_FG, screen->mousecolor);
SET_COLOR_VALUE(pColors,MOUSE_BG, screen->mousecolorback);
@@ -975,16 +976,16 @@
}
void
-ChangeColors(term,pNew)
- XtermWidget term;
+ChangeColors(tw,pNew)
+ XtermWidget tw;
ScrnColors *pNew;
{
- register TScreen *screen = &term->screen;
+ register TScreen *screen = &tw->screen;
Window tek = TWindow(screen);
Bool newCursor= TRUE;
if (COLOR_DEFINED(pNew,TEXT_BG)) {
- term->core.background_pixel= COLOR_VALUE(pNew,TEXT_BG);
+ tw->core.background_pixel= COLOR_VALUE(pNew,TEXT_BG);
}
if (COLOR_DEFINED(pNew,TEXT_CURSOR)) {
@@ -1007,13 +1008,13 @@
if (COLOR_DEFINED(pNew,TEXT_BG)) {
Pixel bg= COLOR_VALUE(pNew,TEXT_BG);
- term->core.background_pixel= bg;
+ tw->core.background_pixel= bg;
XSetBackground(screen->display,screen->normalGC,bg);
XSetForeground(screen->display,screen->reverseGC,bg);
XSetBackground(screen->display,screen->normalboldGC,bg);
XSetForeground(screen->display,screen->reverseboldGC,bg);
XSetWindowBackground(screen->display, TextWindow(screen),
- term->core.background_pixel);
+ tw->core.background_pixel);
}
if (COLOR_DEFINED(pNew,MOUSE_FG)||(COLOR_DEFINED(pNew,MOUSE_BG))) {
@@ -1041,7 +1042,7 @@
screen->max_col + 1, False);
if(screen->Tshow) {
XClearWindow(screen->display, tek);
- TekExpose((XExposeEvent *) NULL);
+ TekExpose((Widget)NULL, (XEvent *)NULL, (Region)NULL);
}
}
Index: xterm.h
--- xterm-original/xterm.h Sat Jan 6 20:01:16 1996
+++ xterm-patched/xterm.h Sun Jan 7 12:04:56 1996
@@ -12,7 +12,7 @@
extern void TCursorToggle PROTO((int toggle));
extern void TekCopy PROTO((void));
extern void TekEnqMouse PROTO((int c));
-extern void TekExpose NOPROTO((Widget w, XEvent *event, Region region));
+extern void TekExpose PROTO((Widget w, XEvent *event, Region region));
extern void TekGINoff PROTO((void));
extern void TekReverseVideo PROTO((TScreen *screen));
extern void TekRun PROTO((void));
@@ -50,7 +50,7 @@
extern void SetVTFont PROTO((int i, Bool doresize, char *name1, char *name2));
extern void ShowCursor PROTO((void));
extern void SwitchBufPtrs PROTO((TScreen *screen));
-extern void VTReset PROTO((Boolean full));
+extern void VTReset PROTO((int full));
extern void VTRun PROTO((void));
extern void set_cursor_gcs PROTO((TScreen *screen));
extern void unparseputc PROTO((int c, int fd));
@@ -61,8 +61,8 @@
extern void CursorBack PROTO((TScreen *screen, int n));
extern void CursorDown PROTO((TScreen *screen, int n));
extern void CursorForward PROTO((TScreen *screen, int n));
-extern void CursorRestore PROTO((XtermWidget term, SavedCursor *sc));
-extern void CursorSave PROTO((XtermWidget term, SavedCursor *sc));
+extern void CursorRestore PROTO((XtermWidget tw, SavedCursor *sc));
+extern void CursorSave PROTO((XtermWidget tw, SavedCursor *sc));
extern void CursorSet PROTO((TScreen *screen, int row, int col, unsigned flags));
extern void CursorUp PROTO((TScreen *screen, int n));
extern void Index PROTO((TScreen *screen, int amount));
@@ -70,7 +70,7 @@
/* input.c */
extern void Input PROTO((TKeyboard *keyboard, TScreen *screen, XKeyEvent *event, Bool eightbit));
-extern void StringInput PROTO((TScreen *screen, char *string, int nbytes));
+extern void StringInput PROTO((TScreen *screen, char *string, Size_t nbytes));
/* main.c */
extern int main PROTO((int argc, char **argv));
@@ -86,11 +86,14 @@
#endif
#ifdef SIGNAL_T
-extern SIGNAL_T Exit NOPROTO((int n));
+extern SIGNAL_T Exit PROTO((int n));
#endif
+/* menu.c */
+extern void do_hangup PROTO_XT_CALLBACK_ARGS;
+
/* misc.c */
-extern Cursor make_colored_cursor PROTO((int cursorindex, unsigned long fg, unsigned long bg));
+extern Cursor make_colored_cursor PROTO((unsigned cursorindex, unsigned long fg, unsigned long bg));
extern char *SysErrorMsg PROTO((int n));
extern char *strindex PROTO((char *s1, char *s2));
extern int XStrCmp PROTO((char *s1, char *s2));
@@ -100,11 +103,11 @@
extern void Changename PROTO((char *name));
extern void Changetitle PROTO((char *name));
extern void Cleanup PROTO((int code));
-/* extern void Error NOPROTO((int i)); */
+extern void Error PROTO((int i));
extern void HandleBellPropertyChange PROTO_XT_EV_HANDLER_ARGS;
extern void HandleEightBitKeyPressed PROTO_XT_ACTIONS_ARGS;
extern void HandleEnterWindow PROTO_XT_EV_HANDLER_ARGS;
-extern void HandleFocusChange NOPROTO((Widget w, XtPointer eventdata, XEvent *event, Boolean* cont));
+extern void HandleFocusChange PROTO_XT_EV_HANDLER_ARGS;
extern void HandleKeyPressed PROTO_XT_ACTIONS_ARGS;
extern void HandleLeaveWindow PROTO_XT_EV_HANDLER_ARGS;
extern void HandleStringEvent PROTO_XT_ACTIONS_ARGS;
@@ -120,8 +123,8 @@
extern void end_vt_mode PROTO((void));
extern void hide_tek_window PROTO((void));
extern void hide_vt_window PROTO((void));
-extern void set_tek_visibility PROTO((Boolean on));
-extern void set_vt_visibility PROTO((Boolean on));
+extern void set_tek_visibility PROTO((int on));
+extern void set_vt_visibility PROTO((int on));
extern void switch_modes PROTO((Bool tovt));
extern void xevents PROTO((void));
extern void xt_error PROTO((String message));
@@ -143,7 +146,7 @@
extern void ScrnDeleteLine PROTO((ScrnBuf sb, int n, int last, int size, int where));
extern void ScrnInsertChar PROTO((ScrnBuf sb, int row, int size, int col, int n));
extern void ScrnInsertLine PROTO((ScrnBuf sb, int last, int where, int n, int size));
-extern void ScrnRefresh PROTO((TScreen *screen, int toprow, int leftcol, int nrows, int ncols, Boolean force));
+extern void ScrnRefresh PROTO((TScreen *screen, int toprow, int leftcol, int nrows, int ncols, int force));
extern void ScrnSetAttributes PROTO((TScreen *screen, int row, int col, unsigned mask, unsigned value, int length));
/* scrollbar.c */
@@ -167,7 +170,7 @@
/* util.c */
extern int AddToRefresh PROTO((TScreen *screen));
extern int HandleExposure PROTO((TScreen *screen, XEvent *event));
-extern void ChangeColors PROTO((XtermWidget term, ScrnColors *pNew));
+extern void ChangeColors PROTO((XtermWidget tw, ScrnColors *pNew));
extern void ClearAbove PROTO((TScreen *screen));
extern void ClearBelow PROTO((TScreen *screen));
extern void ClearLeft PROTO((TScreen *screen));
@@ -177,7 +180,7 @@
extern void DeleteChar PROTO((TScreen *screen, int n));
extern void DeleteLine PROTO((TScreen *screen, int n));
extern void FlushScroll PROTO((TScreen *screen));
-extern void GetColors PROTO((XtermWidget term, ScrnColors *pColors));
+extern void GetColors PROTO((XtermWidget tw, ScrnColors *pColors));
extern void InsertChar PROTO((TScreen *screen, int n));
extern void InsertLine PROTO((TScreen *screen, int n));
extern void RevScroll PROTO((TScreen *screen, int amount));