--- ray/src/px/ximage.c 1992/06/24 09:17:43 2.5 +++ ray/src/px/ximage.c 2003/04/23 00:52:34 2.10 @@ -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.10 2003/04/23 00:52:34 greg Exp $"; #endif - /* * ximage.c - driver for X-windows * @@ -21,6 +18,8 @@ static char SCCSid[] = "$SunId$ LBL"; #include +#include + #include "color.h" #include "resolu.h" @@ -86,13 +85,7 @@ char *progname; char errmsg[128]; -extern long ftell(); -extern char *malloc(), *calloc(); - -extern double pow(), log(); - - main(argc, argv) int argc; char *argv[]; @@ -103,7 +96,7 @@ char *argv[]; int i; progname = argv[0]; - if ((gv = getenv("GAMMA")) != NULL) + if ((gv = getenv("DISPLAY_GAMMA")) != NULL) gamcor = atof(gv); for (i = 1; i < argc; i++) @@ -171,6 +164,7 @@ userr: } +int headline(s) /* get relevant info from header */ char *s; { @@ -183,6 +177,7 @@ char *s; wrongformat = strcmp(fmt, COLRFMT); } else if (isview(s) && sscanview(&ourview, s) > 0) gotview++; + return(0); } @@ -251,6 +246,7 @@ char *err; } +void eputs(s) char *s; { @@ -258,6 +254,7 @@ char *s; } +void quit(code) int code; { @@ -571,8 +568,8 @@ getmono() /* get monochrome data */ cerr[x] = err + errp; } } - free((char *)inl); - free((char *)cerr); + free((void *)inl); + free((void *)cerr); } @@ -600,7 +597,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); @@ -644,7 +641,7 @@ int y; if (fseek(fin, scanpos[y], 0) == -1) quiterr("fseek error"); cury = y; - } else if (scanpos != NULL) + } else if (scanpos != NULL && scanpos[y] == -1) scanpos[y] = ftell(fin); if (freadcolrs(scanline, xmax, fin) < 0)