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

Comparing ray/src/px/psign.c (file contents):
Revision 2.15 by greg, Fri Jun 4 17:02:48 1993 UTC vs.
Revision 2.22 by schorsch, Mon Jun 30 14:59:12 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1992 Regents of the University of California */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ LBL";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   *  psign.c - produce picture from text.
6   *
7   *      7/1/87
8   */
9  
10 < #include  "standard.h"
10 > #include  "copyright.h"
11  
12 < #include  "color.h"
12 > #include  <string.h>
13  
14 + #include  "standard.h"
15 + #include  "platform.h"
16 + #include  "color.h"
17   #include  "font.h"
18  
19 #include  "paths.h"
20
19   #ifndef  SSS
20   #define  SSS                    3       /* super-sample size */
21   #endif
# Line 40 | Line 38 | unsigned char  *ourbitmap;             /* our output bitmap */
38   int  xsiz, ysiz;                        /* bitmap dimensions */
39   int  xdim;                              /* size of horizontal scan (bytes) */
40  
41 +                                /* conflicting def's in param.h */
42 + #undef  tstbit
43 + #undef  setbit
44 + #undef  clrbit
45 + #undef  tglbit
46 +
47   #define  bitop(x,y,op)          (ourbitmap[(y)*xdim+((x)>>3)] op (1<<((x)&7)))
48   #define  tstbit(x,y)            bitop(x,y,&)
49   #define  setbit(x,y)            bitop(x,y,|=)
# Line 48 | Line 52 | int  xdim;                             /* size of horizontal scan (bytes) */
52  
53   FONT  *ourfont;                         /* our font */
54  
51 char  *libpath;                         /* library search path */
52
55   typedef struct line {
56          char  *s;               /* line w/o LF */
57          short  *sp;             /* character spacing */
# Line 66 | Line 68 | int  argc;
68   char  *argv[];
69   {
70          int  an;
71 < #ifdef MSDOS
70 <        setmode(fileno(stdout), O_BINARY);
71 < #endif
71 >        SET_FILE_BINARY(stdout);
72          for (an = 1; an < argc && argv[an][0] == '-'; an++)
73                  switch (argv[an][1]) {
74                  case 'c':                       /* color */
# Line 126 | Line 126 | unkopt:
126                          exit(1);
127                  }
128                                          /* load font file */
129        if ((libpath = getenv(ULIBVAR)) == NULL)
130                libpath = DEFPATH;
129          ourfont = getfont(fontfile);
130                                          /* get text */
131          if (an == argc)
# Line 140 | Line 138 | unkopt:
138                                          /* convert text to bitmap */
139          maptext();
140                                          /* print header */
141 +        newheader("RADIANCE", stdout);
142          printargs(argc, argv, stdout);
143          fputformat(COLRFMT, stdout);
144          putchar('\n');
# Line 209 | Line 208 | makemap()                      /* create the bit map */
208          ourbitmap = (BYTE *)bmalloc(ysiz*xdim);
209          if (ourbitmap == NULL)
210                  error(SYSTEM, "Out of memory in makemap");
211 <        bzero((char *)ourbitmap, ysiz*xdim);
211 >        memset((char *)ourbitmap, '\0', ysiz*xdim);
212   }
213  
214  
# Line 228 | Line 227 | FILE  *fp;
227                  if (curl == NULL)
228                          goto memerr;
229                  len = strlen(buf);
230 <                curl->s = malloc(len);
230 >                curl->s = (char *)malloc(len);
231                  curl->sp = (short *)malloc(sizeof(short)*len--);
232                  if (curl->s == NULL | curl->sp == NULL)
233                          goto memerr;
# Line 265 | Line 264 | char  *av[];
264          ourtext = (LINE *)malloc(sizeof(LINE));
265          if (ourtext == NULL)
266                  goto memerr;
267 <        ourtext->s = malloc(MAXLINE);
267 >        ourtext->s = (char *)malloc(MAXLINE);
268          if (ourtext->s == NULL)
269                  goto memerr;
270          for (cp = ourtext->s; ac-- > 0; av++) {
# Line 443 | Line 442 | FILE  *fp;
442                          exit(1);
443                  }
444          }
445 <        free((char *)scanout);
445 >        free((void *)scanout);
446   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines