--- ray/src/px/ximage.c 1994/09/20 15:48:25 2.7 +++ ray/src/px/ximage.c 2004/01/02 12:47:01 2.13 @@ -1,9 +1,6 @@ -/* Copyright (c) 1987 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: ximage.c,v 2.13 2004/01/02 12:47:01 schorsch Exp $"; #endif - /* * ximage.c - driver for X-windows * @@ -18,19 +15,15 @@ static char SCCSid[] = "$SunId$ LBL"; #include #include - +#include #include +#include #include "color.h" - #include "resolu.h" - #include "xraster.h" - #include "view.h" - #include "pic.h" - #include "random.h" #define controlshift(e) (((XButtonEvent *)(e))->detail & (ShiftMask|ControlMask)) @@ -86,20 +79,15 @@ char *progname; char errmsg[128]; -extern long ftell(); +static gethfunc headline; -extern char *malloc(), *calloc(); -extern double pow(), log(); - - main(argc, argv) int argc; char *argv[]; { extern char *getenv(); char *gv; - int headline(); int i; progname = argv[0]; @@ -171,8 +159,11 @@ userr: } -headline(s) /* get relevant info from header */ -char *s; +static int +headline( /* get relevant info from header */ + char *s, + void *p +) { char fmt[32]; @@ -183,6 +174,7 @@ char *s; wrongformat = strcmp(fmt, COLRFMT); } else if (isview(s) && sscanview(&ourview, s) > 0) gotview++; + return(0); } @@ -251,6 +243,7 @@ char *err; } +void eputs(s) char *s; { @@ -258,6 +251,7 @@ char *s; } +void quit(code) int code; { @@ -571,8 +565,8 @@ getmono() /* get monochrome data */ cerr[x] = err + errp; } } - free((char *)inl); - free((char *)cerr); + free((void *)inl); + free((void *)cerr); } @@ -600,7 +594,7 @@ colormap cmap; xr->cdefs[xr->ncolors].pixel = *p; xr->pmap[*p] = xr->ncolors++; } - xr->cdefs = (Color *)realloc((char *)xr->cdefs, xr->ncolors*sizeof(Color)); + xr->cdefs = (Color *)realloc((void *)xr->cdefs, xr->ncolors*sizeof(Color)); if (xr->cdefs == NULL) return(0); return(1); @@ -677,7 +671,7 @@ picwriteline(y, l) /* add 8-bit scanline to image */ int y; pixel *l; { - bcopy((char *)l, (char *)ourras->data.bz+BZPixmapSize(xmax,y), BZPixmapSize(xmax,1)); + memcpy((void *)ourras->data.bz+BZPixmapSize(xmax,y), (void *)l, BZPixmapSize(xmax,1)); }