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

Comparing ray/src/rt/text.c (file contents):
Revision 2.7 by greg, Fri Oct 2 16:20:26 1992 UTC vs.
Revision 2.11 by greg, Fri Jun 4 17:03:11 1993 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1991 Regents of the University of California */
1 > /* Copyright (c) 1992 Regents of the University of California */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
# Line 142 | Line 142 | char  *s;
142          if ((tl=(TLINE *)malloc(sizeof(TLINE)+siz)) == NULL ||
143                          (tl->spc=(short *)malloc(siz*sizeof(short))) == NULL)
144                  error(SYSTEM, "out of memory in tlalloc");
145        tl->spc = NULL;
145          tl->next = NULL;
146          strcpy(TLSTR(tl), s);
147          return(tl);
# Line 155 | Line 154 | register OBJREC  *tm;
154   {
155   #define  R      (tm->oargs.farg+3)
156   #define  D      (tm->oargs.farg+6)
157 <        extern char  *strcpy(), *fgets();
157 >        extern char  *strcpy();
158          FVECT  DxR;
159          double  d;
160          FILE  *fp;
# Line 171 | Line 170 | register OBJREC  *tm;
170          if (tm->oargs.nsargs - tndx(tm) < 1 || tm->oargs.nfargs < sndx(tm))
171                  objerror(tm, USER, "bad # arguments");
172          if ((t = (TEXT *)malloc(sizeof(TEXT))) == NULL)
173 <                goto memerr;
173 >                error(SYSTEM, "out of memory in gettext");
174                                                  /* compute vectors */
175          fcross(DxR, D, R);
176          fcross(t->right, DxR, D);
# Line 223 | Line 222 | register OBJREC  *tm;
222          i = d * 256.0;
223          t->tl.width = 0;
224          for (tlp = t->tl.next; tlp != NULL; tlp = tlp->next) {
226                if ((tlp->spc = (short *)malloc(
227                                (strlen(TLSTR(tlp))+1)*sizeof(short))) == NULL)
228                        goto memerr;
225                  if (i < 0)
226                          tlp->width = squeeztext(tlp->spc, TLSTR(tlp), t->f, -i);
227                  else if (i > 0)
# Line 238 | Line 234 | register OBJREC  *tm;
234                                                  /* we're done */
235          tm->os = (char *)t;
236          return(t);
241 memerr:
242        error(SYSTEM, "out of memory in gettext");
237   #undef  R
238   #undef  D
239   }
# Line 254 | Line 248 | OBJREC  *m;
248          tp = (TEXT *)m->os;
249          if (tp == NULL)
250                  return;
251 <        for (tlp = tp->tl.next; tlp != NULL; tlp = tlp->next) {
251 >        while ((tlp = tp->tl.next) != NULL) {
252 >                tp->tl.next = tlp->next;
253                  free((char *)tlp->spc);
254                  free((char *)tlp);
255          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines