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

Comparing ray/src/util/rpiece.c (file contents):
Revision 2.36 by gwlarson, Thu Jun 18 09:23:49 1998 UTC vs.
Revision 2.37 by greg, Sat Feb 22 02:07:30 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1995 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   * Generate sections of a picture.
6   */
# Line 25 | Line 22 | char *argv[];
22   #include <signal.h>
23   #include "color.h"
24   #include "view.h"
28 #include "resolu.h"
25  
26   #ifndef NFS
27   #define  NFS                    1
# Line 48 | Line 44 | char *argv[];
44   #define unguard()       0
45   #endif
46  
47 < #ifndef linux
52 < extern char  *sys_errlist[];
53 < #endif
47 > extern char  *strerror();
48  
49                                  /* rpict command */
50   char  *rpargv[128] = {"rpict", "-S", "1"};
# Line 90 | Line 84 | char  *argv[];
84          progname = argv[0];
85          for (i = 1; i < argc; i++) {
86                                                  /* expand arguments */
87 <                while (rval = expandarg(&argc, &argv, i))
88 <                        if (rval < 0) {
89 <                                fprintf(stderr, "%s: cannot expand '%s'",
90 <                                                argv[0], argv[i]);
91 <                                exit(1);
92 <                        }
87 >                while ((rval = expandarg(&argc, &argv, i)) > 0)
88 >                        ;
89 >                if (rval < 0) {
90 >                        fprintf(stderr, "%s: cannot expand '%s'",
91 >                                        argv[0], argv[i]);
92 >                        exit(1);
93 >                }
94                  if (argv[i][0] == '-')
95                          switch (argv[i][1]) {
96                          case 'v':
# Line 200 | Line 195 | int  ltyp;
195          fls.l_type = ltyp;
196          if (fcntl(fd, F_SETLKW, &fls) < 0) {
197                  fprintf(stderr, "%s: cannot lock/unlock file: %s\n",
198 <                                progname, sys_errlist[errno]);
198 >                                progname, strerror(errno));
199                  exit(1);
200          }
201   }
# Line 508 | Line 503 | int  xpos, ypos;
503                  filerr("lock");
504   #endif
505                                  /* write new piece to file */
506 <        if (lseek(outfd, fls.l_start, 0) < 0)
506 >        if (lseek(outfd, (off_t)fls.l_start, 0) < 0)
507                  filerr("seek");
508          if (hmult == 1) {
509                  if (writebuf(outfd, (char *)pbuf,
# Line 520 | Line 515 | int  xpos, ypos;
515                                          hr*sizeof(COLR)) != hr*sizeof(COLR))
516                                  filerr("write");
517                          if (y < vr-1 && lseek(outfd,
518 <                                        (long)(hmult-1)*hr*sizeof(COLR),
518 >                                        (off_t)(hmult-1)*hr*sizeof(COLR),
519                                          1) < 0)
520                                  filerr("seek");
521                  }
# Line 551 | Line 546 | filerr(t)                      /* report file error and exit */
546   char  *t;
547   {
548          fprintf(stderr, "%s: %s error on file \"%s\": %s\n",
549 <                        progname, t, outfile, sys_errlist[errno]);
549 >                        progname, t, outfile, strerror(errno));
550          _exit(1);
551   }
552  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines