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

Comparing ray/src/px/mt160r.c (file contents):
Revision 2.6 by greg, Sat Feb 22 02:07:27 2003 UTC vs.
Revision 2.8 by schorsch, Sun Mar 28 20:33:14 2004 UTC

# Line 8 | Line 8 | static const char      RCSid[] = "$Id$";
8   */
9  
10   #include  <stdio.h>
11 #ifdef MSDOS
12 #include  <fcntl.h>
13 #endif
11   #include  <time.h>
12  
13 + #include  "platform.h"
14   #include  "color.h"
15   #include  "resolu.h"
16  
17   #define  NCOLS          880             /* for wide carriage */
18  
19 + static int printp(char  *fname);
20 + static void plotscan(COLR  scan[], int  len, int  y);
21 + static int bit(COLR  clr, int  x);
22  
23 < main(argc, argv)
24 < int  argc;
25 < char  *argv[];
23 >
24 > int
25 > main(
26 >        int  argc,
27 >        char  *argv[]
28 > )
29   {
30          int  i;
31          int  status = 0;
32 < #ifdef MSDOS
33 <        extern int  _fmode;
34 <        _fmode = O_BINARY;
31 <        setmode(fileno(stdin), O_BINARY);
32 <        setmode(fileno(stdout), O_BINARY);
33 < #endif
32 >        SET_DEFAULT_BINARY();
33 >        SET_FILE_BINARY(stdin);
34 >        SET_FILE_BINARY(stdout);
35          if (argc < 2)
36                  status += printp(NULL) == -1;
37          else
# Line 40 | Line 41 | char  *argv[];
41   }
42  
43  
44 < printp(fname)                           /* print a picture */
45 < char  *fname;
44 > static int
45 > printp(                         /* print a picture */
46 >        char  *fname
47 > )
48   {
49          FILE  *input;
50          int  xres, yres;
# Line 89 | Line 92 | char  *fname;
92   }
93  
94  
95 < plotscan(scan, len, y)                  /* plot a scanline */
96 < COLR  scan[];
97 < int  len;
98 < int  y;
95 > static void
96 > plotscan(                       /* plot a scanline */
97 >        COLR  scan[],
98 >        int  len,
99 >        int  y
100 > )
101   {
102          static BYTE  pat[NCOLS];
103          int  bpos;
104          register int  i;
105  
106 <        if (bpos = y & 7) {
106 >        if ((bpos = y & 7)) {
107  
108                  for (i = 0; i < len; i++)
109                          pat[i] |= bit(scan[i], i) << bpos;
# Line 121 | Line 126 | int  y;
126   }
127  
128  
129 < bit(clr, x)                             /* return bit for color at x */
130 < COLR  clr;
131 < register int  x;
129 > static int
130 > bit(                            /* return bit for color at x */
131 >        COLR  clr,
132 >        register int  x
133 > )
134   {
135          static int  cerr[NCOLS];
136          static int  err;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines