ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/font.c
(Generate patch)

Comparing ray/src/common/font.c (file contents):
Revision 2.13 by greg, Tue Feb 25 02:47:21 2003 UTC vs.
Revision 2.18 by schorsch, Fri Mar 26 21:29:19 2004 UTC

# Line 7 | Line 7 | static const char      RCSid[] = "$Id$";
7  
8   #include "copyright.h"
9  
10 < #include "standard.h"
10 > #include <stdlib.h>
11  
12 + #include "rtio.h"
13 + #include "rterror.h"
14   #include "font.h"
15  
16   #define galloc(nv)      (GLYPH *)malloc(sizeof(GLYPH)+2*sizeof(GORD)*(nv))
# Line 24 | Line 26 | getfont(fname)                         /* return font fname */
26   char  *fname;
27   {
28          FILE  *fp;
29 <        char  *pathname, *err;
29 >        char  *pathname, *err = NULL;
30          unsigned  wsum, hsum, ngly;
31          int  gn, ngv, gv;
32          register GLYPH  *g;
# Line 37 | Line 39 | char  *fname;
39                          return(f);
40                  }
41                                                  /* load the font file */
42 <        if ((pathname = getpath(fname, getlibpath(), R_OK)) == NULL) {
42 >        if ((pathname = getpath(fname, getrlibpath(), R_OK)) == NULL) {
43                  sprintf(errmsg, "cannot find font file \"%s\"", fname);
44                  error(USER, errmsg);
45          }
# Line 117 | Line 119 | fonterr:
119          error(USER, errmsg);
120   memerr:
121          error(SYSTEM, "out of memory in fontglyph");
122 +        return NULL; /* pro forma return */
123   }
124  
125  
# Line 128 | Line 131 | FONT *fnt;
131          register FONT  *fl, *f;
132          register int  i;
133                                          /* check reference count */
134 <        if (fnt != NULL && (fnt->nref-- > 1 | retainfonts))
134 >        if (fnt != NULL && ((fnt->nref-- > 1) | retainfonts))
135                  return;
136          head.next = fontlist;
137          fl = &head;
138          while ((f = fl->next) != NULL)
139 <                if ((fnt == NULL | fnt == f)) {
139 >                if ((fnt == NULL) | (fnt == f)) {
140                          fl->next = f->next;
141                          for (i = 0; i < 256; i++)
142                                  if (f->fg[i] != NULL)
# Line 207 | Line 210 | FONT  *f;                      /* font */
210   int  cis;                       /* target intercharacter spacing */
211   int  nsi;                       /* minimum number of spaces for indent */
212   {
213 <        register char  *end, *tab;
213 >        register char  *end, *tab = NULL;
214          GLYPH  *gp;
215          short  *nsp;
216          int  alen, len, width;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines