--- ray/src/px/psign.c 2003/06/21 15:05:01 2.21 +++ ray/src/px/psign.c 2004/03/28 20:33:14 2.25 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: psign.c,v 2.21 2003/06/21 15:05:01 greg Exp $"; +static const char RCSid[] = "$Id: psign.c,v 2.25 2004/03/28 20:33:14 schorsch Exp $"; #endif /* * psign.c - produce picture from text. @@ -7,8 +7,13 @@ static const char RCSid[] = "$Id: psign.c,v 2.21 2003/ * 7/1/87 */ -#include "standard.h" +#include "copyright.h" + +#include + #include "platform.h" +#include "standard.h" +#include "resolu.h" #include "color.h" #include "font.h" @@ -58,10 +63,21 @@ LINE *ourtext; /* our text */ int nlines, maxline; /* text dimensions */ int maxwidth; /* maximum line width (dvi) */ +static void makemap(void); +static void gettext(FILE *fp); +static void arg_text(int ac, char *av[]); +static void maptext(void); +static void mapglyph(GLYPH *gl, int tx0, int ty0); +static void mapcoord(int p[2], int tx, int ty); +static void mapedge(int x, int y, int run, int rise); +static void writemap(FILE *fp); -main(argc, argv) -int argc; -char *argv[]; + +int +main( + int argc, + char *argv[] +) { int an; SET_FILE_BINARY(stdout); @@ -145,7 +161,8 @@ unkopt: } -makemap() /* create the bit map */ +static void +makemap(void) /* create the bit map */ { double pictaspect; @@ -204,12 +221,14 @@ 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); } -gettext(fp) /* get text from a file */ -FILE *fp; +static void +gettext( /* get text from a file */ + FILE *fp +) { char buf[MAXLINE]; register LINE *curl; @@ -225,7 +244,7 @@ FILE *fp; len = strlen(buf); curl->s = (char *)malloc(len); curl->sp = (short *)malloc(sizeof(short)*len--); - if (curl->s == NULL | curl->sp == NULL) + if ((curl->s == NULL) | (curl->sp == NULL)) goto memerr; if (len > maxline) maxline = len; @@ -251,9 +270,11 @@ memerr: } -arg_text(ac, av) /* get text from arguments */ -int ac; -char *av[]; +static void +arg_text( /* get text from arguments */ + int ac, + char *av[] +) { register char *cp; @@ -289,7 +310,8 @@ memerr: } -maptext() /* map our text */ +static void +maptext(void) /* map our text */ { register LINE *curl; int l, len; @@ -305,9 +327,12 @@ maptext() /* map our text */ } -mapglyph(gl, tx0, ty0) /* convert a glyph */ -GLYPH *gl; -int tx0, ty0; +static void +mapglyph( /* convert a glyph */ + GLYPH *gl, + int tx0, + int ty0 +) { int n; register GORD *gp; @@ -328,8 +353,12 @@ int tx0, ty0; } -mapcoord(p, tx, ty) /* map text to picture coordinates */ -int p[2], tx, ty; +static void +mapcoord( /* map text to picture coordinates */ + int p[2], + int tx, + int ty +) { tx = (long)tx*cwidth >> 8; ty = (long)ty*cheight >> 8; @@ -355,9 +384,13 @@ int p[2], tx, ty; } -mapedge(x, y, run, rise) /* map an edge */ -register int x, y; -int run, rise; +static void +mapedge( /* map an edge */ + register int x, + register int y, + int run, + int rise +) { int xstep; int rise2, run2; @@ -392,8 +425,10 @@ int run, rise; } -writemap(fp) /* write out bitmap */ -FILE *fp; +static void +writemap( /* write out bitmap */ + FILE *fp +) { COLR pixval[SSS*SSS+1]; /* possible pixel values */ COLOR ctmp0, ctmp1;