--- ray/src/rt/x11.c 1997/12/02 15:57:45 2.28 +++ ray/src/rt/x11.c 2003/02/25 02:47:23 2.30 @@ -1,15 +1,12 @@ -/* Copyright (c) 1995 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: x11.c,v 2.30 2003/02/25 02:47:23 greg Exp $"; #endif - /* * x11.c - driver for X-windows version 11 - * - * Jan 1990 */ +#include "copyright.h" + #include "standard.h" #include #ifdef sparc @@ -82,20 +79,21 @@ static Colormap ourmap = 0; /* our color map */ static int inpcheck; /* whence to check input */ -extern char *malloc(); +static int x11_getcur(); -static int x11_close(), x11_clear(), x11_paintr(), x11_errout(), - x11_getcur(), x11_comout(), x11_comin(), x11_flush(); +static void x11_close(), x11_clear(), x11_paintr(), x11_errout(), + x11_comout(), x11_comin(), x11_flush(); -static int std_comin(), std_comout(); +static void std_comin(), std_comout(); static struct driver x11_driver = { x11_close, x11_clear, x11_paintr, x11_getcur, NULL, NULL, x11_flush, 1.0 }; -static int getpixels(), xnewcolr(), freepixels(), resizewindow(), - getevent(), getkey(), fixwindow(), x11_getc(); +static int getpixels(), x11_getc(); +static void xnewcolr(), freepixels(), resizewindow(), + getevent(), getkey(), fixwindow(); static unsigned long true_pixel(); @@ -103,7 +101,6 @@ struct driver * x11_init(name, id) /* initialize driver */ char *name, *id; { - extern char *getenv(); char *gv; int nplanes; XSetWindowAttributes ourwinattr; @@ -210,7 +207,7 @@ char *name, *id; } -static +static void x11_close() /* close our display */ { erract[COMMAND].pf = NULL; /* reset error vectors */ @@ -233,7 +230,7 @@ x11_close() /* close our display */ } -static +static void x11_clear(xres, yres) /* clear our display */ int xres, yres; { @@ -279,7 +276,7 @@ int xres, yres; } -static +static void x11_paintr(col, xmin, ymin, xmax, ymax) /* fill a rectangle */ COLOR col; int xmin, ymin, xmax, ymax; @@ -298,7 +295,7 @@ int xmin, ymin, xmax, ymax; } -static +static void x11_flush() /* flush output */ { char buf[256]; @@ -334,7 +331,7 @@ x11_flush() /* flush output */ } -static +static void x11_comin(inp, prompt) /* read in a command line */ char *inp, *prompt; { @@ -350,7 +347,7 @@ char *inp, *prompt; } -static +static void x11_comout(outp) /* output a string to command line */ char *outp; { @@ -362,7 +359,7 @@ char *outp; } -static +static void x11_errout(msg) /* output an error message */ char *msg; { @@ -371,12 +368,10 @@ char *msg; } -static +static void std_comin(inp, prompt) /* read in command line from stdin */ char *inp, *prompt; { - extern char *gets(); - if (prompt != NULL) { if (fromcombuf(inp, &x11_driver)) return; @@ -402,7 +397,7 @@ char *inp, *prompt; } -static +static void std_comout(outp) /* write out string to stdout */ char *outp; { @@ -440,7 +435,7 @@ int *xp, *yp; } -static +static void xnewcolr(ndx, r, g, b) /* enter a color into hardware table */ int ndx; int r, g, b; @@ -480,7 +475,7 @@ loop: return(ncolors = 0); if (XAllocColorCells(ourdisplay,ourmap,0,NULL,0,pixval,ncolors)) break; - free((char *)pixval); + free((void *)pixval); pixval = NULL; } if (pixval == NULL) { @@ -509,13 +504,13 @@ loop: } -static +static void freepixels() /* free our pixels */ { if (ncolors == 0) return; XFreeColors(ourdisplay,ourmap,pixval,ncolors,0L); - free((char *)pixval); + free((void *)pixval); pixval = NULL; ncolors = 0; if (ourmap != DefaultColormap(ourdisplay,ourscreen)) @@ -551,7 +546,7 @@ x11_getc() /* get a command character */ } -static +static void getevent() /* get next event */ { XNextEvent(ourdisplay, levptr(XEvent)); @@ -584,7 +579,7 @@ getevent() /* get next event */ } -static +static void getkey(ekey) /* get input key */ register XKeyPressedEvent *ekey; { @@ -597,7 +592,7 @@ register XKeyPressedEvent *ekey; } -static +static void fixwindow(eexp) /* repair damage to window */ register XExposeEvent *eexp; { @@ -615,7 +610,7 @@ register XExposeEvent *eexp; } -static +static void resizewindow(ersz) /* resize window */ register XConfigureEvent *ersz; {