--- ray/src/px/psign.c 1993/06/04 17:02:48 2.15 +++ ray/src/px/psign.c 2003/06/30 14:59:12 2.22 @@ -1,23 +1,21 @@ -/* Copyright (c) 1992 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: psign.c,v 2.22 2003/06/30 14:59:12 schorsch Exp $"; #endif - /* * psign.c - produce picture from text. * * 7/1/87 */ -#include "standard.h" +#include "copyright.h" -#include "color.h" +#include +#include "standard.h" +#include "platform.h" +#include "color.h" #include "font.h" -#include "paths.h" - #ifndef SSS #define SSS 3 /* super-sample size */ #endif @@ -40,6 +38,12 @@ unsigned char *ourbitmap; /* our output bitmap */ int xsiz, ysiz; /* bitmap dimensions */ int xdim; /* size of horizontal scan (bytes) */ + /* conflicting def's in param.h */ +#undef tstbit +#undef setbit +#undef clrbit +#undef tglbit + #define bitop(x,y,op) (ourbitmap[(y)*xdim+((x)>>3)] op (1<<((x)&7))) #define tstbit(x,y) bitop(x,y,&) #define setbit(x,y) bitop(x,y,|=) @@ -48,8 +52,6 @@ int xdim; /* size of horizontal scan (bytes) */ FONT *ourfont; /* our font */ -char *libpath; /* library search path */ - typedef struct line { char *s; /* line w/o LF */ short *sp; /* character spacing */ @@ -66,9 +68,7 @@ int argc; char *argv[]; { int an; -#ifdef MSDOS - setmode(fileno(stdout), O_BINARY); -#endif + SET_FILE_BINARY(stdout); for (an = 1; an < argc && argv[an][0] == '-'; an++) switch (argv[an][1]) { case 'c': /* color */ @@ -126,8 +126,6 @@ unkopt: exit(1); } /* load font file */ - if ((libpath = getenv(ULIBVAR)) == NULL) - libpath = DEFPATH; ourfont = getfont(fontfile); /* get text */ if (an == argc) @@ -140,6 +138,7 @@ unkopt: /* convert text to bitmap */ maptext(); /* print header */ + newheader("RADIANCE", stdout); printargs(argc, argv, stdout); fputformat(COLRFMT, stdout); putchar('\n'); @@ -209,7 +208,7 @@ makemap() /* create the bit map */ ourbitmap = (BYTE *)bmalloc(ysiz*xdim); if (ourbitmap == NULL) error(SYSTEM, "Out of memory in makemap"); - bzero((char *)ourbitmap, ysiz*xdim); + memset((char *)ourbitmap, '\0', ysiz*xdim); } @@ -228,7 +227,7 @@ FILE *fp; if (curl == NULL) goto memerr; len = strlen(buf); - curl->s = malloc(len); + curl->s = (char *)malloc(len); curl->sp = (short *)malloc(sizeof(short)*len--); if (curl->s == NULL | curl->sp == NULL) goto memerr; @@ -265,7 +264,7 @@ char *av[]; ourtext = (LINE *)malloc(sizeof(LINE)); if (ourtext == NULL) goto memerr; - ourtext->s = malloc(MAXLINE); + ourtext->s = (char *)malloc(MAXLINE); if (ourtext->s == NULL) goto memerr; for (cp = ourtext->s; ac-- > 0; av++) { @@ -443,5 +442,5 @@ FILE *fp; exit(1); } } - free((char *)scanout); + free((void *)scanout); }