--- ray/src/common/font.c 2003/02/25 02:47:21 2.13 +++ ray/src/common/font.c 2004/03/26 21:29:19 2.18 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: font.c,v 2.13 2003/02/25 02:47:21 greg Exp $"; +static const char RCSid[] = "$Id: font.c,v 2.18 2004/03/26 21:29:19 schorsch Exp $"; #endif /* * Polygonal font handling routines @@ -7,8 +7,10 @@ static const char RCSid[] = "$Id: font.c,v 2.13 2003/0 #include "copyright.h" -#include "standard.h" +#include +#include "rtio.h" +#include "rterror.h" #include "font.h" #define galloc(nv) (GLYPH *)malloc(sizeof(GLYPH)+2*sizeof(GORD)*(nv)) @@ -24,7 +26,7 @@ getfont(fname) /* return font fname */ char *fname; { FILE *fp; - char *pathname, *err; + char *pathname, *err = NULL; unsigned wsum, hsum, ngly; int gn, ngv, gv; register GLYPH *g; @@ -37,7 +39,7 @@ char *fname; return(f); } /* load the font file */ - if ((pathname = getpath(fname, getlibpath(), R_OK)) == NULL) { + if ((pathname = getpath(fname, getrlibpath(), R_OK)) == NULL) { sprintf(errmsg, "cannot find font file \"%s\"", fname); error(USER, errmsg); } @@ -117,6 +119,7 @@ fonterr: error(USER, errmsg); memerr: error(SYSTEM, "out of memory in fontglyph"); + return NULL; /* pro forma return */ } @@ -128,12 +131,12 @@ FONT *fnt; register FONT *fl, *f; register int i; /* check reference count */ - if (fnt != NULL && (fnt->nref-- > 1 | retainfonts)) + if (fnt != NULL && ((fnt->nref-- > 1) | retainfonts)) return; head.next = fontlist; fl = &head; while ((f = fl->next) != NULL) - if ((fnt == NULL | fnt == f)) { + if ((fnt == NULL) | (fnt == f)) { fl->next = f->next; for (i = 0; i < 256; i++) if (f->fg[i] != NULL) @@ -207,7 +210,7 @@ FONT *f; /* font */ int cis; /* target intercharacter spacing */ int nsi; /* minimum number of spaces for indent */ { - register char *end, *tab; + register char *end, *tab = NULL; GLYPH *gp; short *nsp; int alen, len, width;