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

Comparing ray/src/common/calprnt.c (file contents):
Revision 1.2 by greg, Wed Aug 14 16:26:34 1991 UTC vs.
Revision 2.5 by schorsch, Fri Nov 14 17:22:06 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1991 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   *  calprint.c - routines for printing calcomp expressions.
9 *
10 *     1/29/87
6   */
7  
8 + #include "copyright.h"
9 +
10   #include  <stdio.h>
11  
12 + #include  "rterror.h"
13   #include  "calcomp.h"
14  
15  
16 + void
17   eprint(ep, fp)                  /* print a parse tree */
18   register EPNODE  *ep;
19   FILE  *fp;
20   {
21      static EPNODE  *curdef = NULL;
22 <    register EPNODE  *ep1;
22 >    register EPNODE  *ep1 = NULL;
23  
24      switch (ep->type) {
25  
# Line 34 | Line 33 | FILE  *fp;
33  
34          case FUNC:
35              eprint(ep->v.kid, fp);
36 <            fputs("(", fp);
36 >            fputc('(', fp);
37              ep1 = ep->v.kid->sibling;
38              while (ep1 != NULL) {
39                  eprint(ep1, fp);
40                  if ((ep1 = ep1->sibling) != NULL)
41                      fputs(", ", fp);
42              }
43 <            fputs(")", fp);
43 >            fputc(')', fp);
44              break;
45  
46          case ARG:
# Line 58 | Line 57 | FILE  *fp;
57              break;
58  
59          case UMINUS:
60 <            fputs("-", fp);
60 >            fputc('-', fp);
61              eprint(ep->v.kid, fp);
62              break;
63  
# Line 71 | Line 70 | FILE  *fp;
70              ep1 = curdef;
71              curdef = ep;
72              eprint(ep->v.kid, fp);
73 <            putc(' ', fp);
74 <            putc(ep->type, fp);
75 <            putc(' ', fp);
73 >            fputc(' ', fp);
74 >            fputc(ep->type, fp);
75 >            fputc(' ', fp);
76              eprint(ep->v.kid->sibling, fp);
77              curdef = ep1;
78              break;
# Line 83 | Line 82 | FILE  *fp;
82          case '*':
83          case '/':
84          case '^':
85 <            fputs("(", fp);
85 >            fputc('(', fp);
86              eprint(ep->v.kid, fp);
87 <            putc(' ', fp);
88 <            putc(ep->type, fp);
89 <            putc(' ', fp);
87 >            fputc(' ', fp);
88 >            fputc(ep->type, fp);
89 >            fputc(' ', fp);
90              eprint(ep->v.kid->sibling, fp);
91 <            fputs(")", fp);
91 >            fputc(')', fp);
92              break;
93  
94          default:
# Line 101 | Line 100 | FILE  *fp;
100   }
101  
102  
103 + void
104   dprint(name, fp)                /* print a definition (all if no name) */
105   char  *name;
106   FILE  *fp;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines