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

Comparing ray/src/px/pvalue.c (file contents):
Revision 2.16 by greg, Tue Feb 25 16:47:23 2003 UTC vs.
Revision 2.27 by greg, Fri Oct 1 07:45:30 2004 UTC

# Line 7 | Line 7 | static const char RCSid[] = "$Id$";
7   *     4/23/86
8   */
9  
10 + #include  "platform.h"
11   #include  "standard.h"
11
12   #include  "color.h"
13
14 #include  <time.h>
15
13   #include  "resolu.h"
14 + #include  "view.h"
15  
18 typedef unsigned short uint16;  /* sizeof (uint16) must == 2 */
19
16   #define  min(a,b)               ((a)<(b)?(a):(b))
17  
18                                  /* what to put out (also RED, GRN, BLU) */
19   #define  ALL            3
20   #define  BRIGHT         4
21  
26 #define  brightonly     (putprim==BRIGHT)
27
22   RESOLU  picres;                 /* resolution of picture */
29
23   int  uniq = 0;                  /* print only unique values? */
31
24   int  doexposure = 0;            /* exposure change? (>100 to print) */
33
25   int  dataonly = 0;              /* data only format? */
35
26   int  putprim = ALL;             /* what to put out */
37
27   int  reverse = 0;               /* reverse conversion? */
39
28   int  format = 'a';              /* input/output format */
29   char  *fmtid = "ascii";         /* format identifier for header */
42
30   int  header = 1;                /* do header? */
44
31   long  skipbytes = 0;            /* skip bytes in input? */
32 <
47 < int  swapbytes = 0;             /* swap bytes in 16-bit words? */
48 <
32 > int  swapbytes = 0;             /* swap bytes? */
33   int  interleave = 1;            /* file is interleaved? */
50
34   int  resolution = 1;            /* put/get resolution string? */
52
35   int  original = 0;              /* convert to original values? */
54
36   int  wrongformat = 0;           /* wrong input format? */
56
37   double  gamcor = 1.0;           /* gamma correction */
38  
39   int  ord[3] = {RED, GRN, BLU};  /* RGB ordering */
# Line 66 | Line 46 | char  *progname;
46   FILE  *fin;
47   FILE  *fin2 = NULL, *fin3 = NULL;       /* for other color channels */
48  
69 int  (*getval)(), (*putval)();
49  
50 < double
51 < rgb_bright(clr)
52 < COLOR  clr;
50 > typedef int getfunc_t(COLOR  col);
51 > typedef int putfunc_t(COLOR  col);
52 > typedef double brightfunc_t(COLOR  col);
53 >
54 > getfunc_t *getval;
55 > putfunc_t *putval;
56 > brightfunc_t *mybright;
57 >
58 > static gethfunc checkhead;
59 > static brightfunc_t rgb_bright, xyz_bright;
60 > static getfunc_t getbascii, getbint, getbdouble, getbfloat, getbbyte, getbword;
61 > static getfunc_t getcascii, getcint, getcdouble, getcfloat, getcbyte, getcword;
62 > static putfunc_t putbascii, putbint, putbdouble, putbfloat, putbbyte, putbword;
63 > static putfunc_t putcascii, putcint, putcdouble, putcfloat, putcbyte, putcword;
64 > static putfunc_t putpascii, putpint, putpdouble, putpfloat, putpbyte, putpword;
65 >
66 > static void set_io(void);
67 > static void pixtoval(void);
68 > static void valtopix(void);
69 > static void swap16(uint16  *wp, int  n);
70 > static void swap32(uint32  *wp, int  n);
71 > static void swap64(char  *wp, int  n);
72 >
73 >
74 > static double
75 > rgb_bright(
76 >        COLOR  clr
77 > )
78   {
79          return(bright(clr));
80   }
81  
82 < double
83 < xyz_bright(clr)
84 < COLOR  clr;
82 > static double
83 > xyz_bright(
84 >        COLOR  clr
85 > )
86   {
87          return(clr[CIEY]);
88   }
89  
90 < double  (*mybright)() = &rgb_bright;
91 <
92 <
93 < main(argc, argv)
94 < int  argc;
90 < char  **argv;
90 > int
91 > main(
92 >        int  argc,
93 >        char  **argv
94 > )
95   {
92        extern int  checkhead();
93        extern long  atol();
96          double  d, expval = 1.0;
97          int  i;
98  
99          progname = argv[0];
100 +        mybright = &rgb_bright; /* default */
101  
102          for (i = 1; i < argc; i++)
103                  if (argv[i][0] == '-' || argv[i][0] == '+')
# Line 178 | Line 181 | char  **argv;
181                                          format = 'w';
182                                          fmtid = "16-bit";
183                                          break;
184 +                                case 'F':               /* swapped floats */
185 +                                        swapbytes = 1;
186                                  case 'f':               /* float */
187                                          dataonly = 1;
188                                          format = 'f';
189                                          fmtid = "float";
190                                          break;
191 +                                case 'D':               /* swapped doubles */
192 +                                        swapbytes = 1;
193                                  case 'd':               /* double */
194                                          dataonly = 1;
195                                          format = 'd';
# Line 218 | Line 225 | unkopt:
225                  else
226                          break;
227                                          /* recognize special formats */
228 <        if (dataonly && format == 'b')
229 <                if (brightonly)
223 <                        fmtid = "8-bit_grey";
224 <                else
228 >        if (dataonly && format == 'b') {
229 >                if (putprim == ALL)
230                          fmtid = "24-bit_rgb";
226        if (dataonly && format == 'w')
227                if (brightonly)
228                        fmtid = "16-bit_grey";
231                  else
232 +                        fmtid = "8-bit_grey";
233 +        }
234 +        if (dataonly && format == 'w') {
235 +                if (putprim == ALL)
236                          fmtid = "48-bit_rgb";
237 +                else
238 +                        fmtid = "16-bit_grey";
239 +        }
240                                          /* assign reverse ordering */
241          rord[ord[0]] = 0;
242          rord[ord[1]] = 1;
# Line 241 | Line 250 | unkopt:
250                                                  progname, argv[i]);
251                          quit(1);
252                  }
253 <                if (reverse && !brightonly && i == argc-3) {
253 >                if (reverse && putprim != BRIGHT && i == argc-3) {
254                          if ((fin2 = fopen(argv[i+1], "r")) == NULL) {
255                                  fprintf(stderr, "%s: can't open file \"%s\"\n",
256                                                  progname, argv[i+1]);
# Line 255 | Line 264 | unkopt:
264                          interleave = -1;
265                  } else if (i != argc-1)
266                          fin = NULL;
267 <                if (reverse && !brightonly && !interleave) {
267 >                if (reverse && putprim != BRIGHT && !interleave) {
268                          fin2 = fopen(argv[i], "r");
269                          fin3 = fopen(argv[i], "r");
270                  }
# Line 273 | Line 282 | unkopt:
282          }
283  
284          if (reverse) {
285 < #ifdef MSDOS
286 <                setmode(fileno(stdout), O_BINARY);
285 > #ifdef _WIN32
286 >                SET_FILE_BINARY(stdout);
287                  if (format != 'a' && format != 'i')
288 <                        setmode(fileno(fin), O_BINARY);
288 >                        SET_FILE_BINARY(fin);
289   #endif
290                                          /* get header */
291                  if (header) {
# Line 321 | Line 330 | unkopt:
330                  fputsresolu(&picres, stdout);   /* always put resolution */
331                  valtopix();
332          } else {
333 < #ifdef MSDOS
334 <                setmode(fileno(fin), O_BINARY);
333 > #ifdef _WIN32
334 >                SET_FILE_BINARY(fin);
335                  if (format != 'a' && format != 'i')
336 <                        setmode(fileno(stdout), O_BINARY);
336 >                        SET_FILE_BINARY(stdout);
337   #endif
338                                                  /* get header */
339                  getheader(fin, checkhead, NULL);
# Line 351 | Line 360 | unkopt:
360          }
361  
362          quit(0);
363 +        return 0; /* pro forma return */
364   }
365  
366  
367 < int
368 < checkhead(line)                         /* deal with line from header */
369 < char  *line;
367 > static int
368 > checkhead(                              /* deal with line from header */
369 >        char    *line,
370 >        void    *p
371 > )
372   {
373          char    fmt[32];
374          double  d;
375          COLOR   ctmp;
376  
377          if (formatval(fmt, line)) {
378 <                if (!strcmp(fmt, CIEFMT)) {
378 >                if (!strcmp(fmt, CIEFMT))
379                          mybright = &xyz_bright;
380 <                        if (original) {
369 <                                scalecolor(exposure, 1./WHTEFFICACY);
370 <                                doexposure++;
371 <                        }
372 <                } else if (!strcmp(fmt, COLRFMT))
380 >                else if (!strcmp(fmt, COLRFMT))
381                          mybright = &rgb_bright;
382                  else
383                          wrongformat++;
384          } else if (original && isexpos(line)) {
385                  d = 1.0/exposval(line);
386                  scalecolor(exposure, d);
387 + fprintf(stderr, "scaled exposure by %f, now at %f\n", d, bright(exposure));
388                  doexposure++;
389          } else if (original && iscolcor(line)) {
390                  colcorval(ctmp, line);
# Line 389 | Line 398 | char  *line;
398   }
399  
400  
401 < pixtoval()                              /* convert picture to values */
401 > static void
402 > pixtoval(void)                          /* convert picture to values */
403   {
404          register COLOR  *scanln;
405          int  dogamma;
406          COLOR  lastc;
407 <        FLOAT  hv[2];
407 >        RREAL  hv[2];
408          int  startprim, endprim;
409          long  startpos;
410          int  y;
# Line 426 | Line 436 | pixtoval()                             /* convert picture to values */
436                                  quit(1);
437                          }
438                          for (x = 0; x < scanlen(&picres); x++) {
439 <                                if (uniq)
439 >                                if (uniq) {
440                                          if (    colval(scanln[x],RED) ==
441                                                          colval(lastc,RED) &&
442                                                  colval(scanln[x],GRN) ==
# Line 436 | Line 446 | pixtoval()                             /* convert picture to values */
446                                                  continue;
447                                          else
448                                                  copycolor(lastc, scanln[x]);
449 +                                }
450                                  if (doexposure)
451                                          multcolor(scanln[x], exposure);
452                                  if (dogamma)
# Line 461 | Line 472 | pixtoval()                             /* convert picture to values */
472   }
473  
474  
475 < valtopix()                      /* convert values to a pixel file */
475 > static void
476 > valtopix(void)                  /* convert values to a pixel file */
477   {
478          int  dogamma;
479          register COLOR  *scanln;
# Line 513 | Line 525 | int  code;
525   }
526  
527  
528 < swap16(wp, n)           /* swap n 16-bit words */
529 < register uint16  *wp;
530 < int  n;
528 > static void
529 > swap16(         /* swap n 16-bit words */
530 >        register uint16  *wp,
531 >        int  n
532 > )
533   {
534          while (n-- > 0) {
535                  *wp = *wp << 8 | ((*wp >> 8) & 0xff);
# Line 523 | Line 537 | int  n;
537          }
538   }
539  
540 < getcascii(col)          /* get an ascii color value from stream(s) */
541 < COLOR  col;
540 >
541 > static void
542 > swap32(         /* swap n 32-bit words */
543 >        register uint32  *wp,
544 >        int  n
545 > )
546   {
547 +        while (n-- > 0) {
548 +                *wp = *wp << 24 | ((*wp >> 24) & 0xff) |
549 +                        (*wp & 0xff00) << 8 | (*wp & 0xff0000) >> 8;
550 +                wp++;
551 +        }
552 + }
553 +
554 +
555 + static void
556 + swap64(         /* swap n 64-bit words */
557 +        register char  *wp,
558 +        int  n
559 + )
560 + {
561 +        register int    t;
562 +
563 +        while (n-- > 0) {
564 +                t = wp[0]; wp[0] = wp[7]; wp[7] = t;
565 +                t = wp[1]; wp[1] = wp[6]; wp[6] = t;
566 +                t = wp[2]; wp[2] = wp[5]; wp[5] = t;
567 +                t = wp[3]; wp[3] = wp[4]; wp[4] = t;
568 +                wp += 8;
569 +        }
570 + }
571 +
572 +
573 + static int
574 + getcascii(              /* get an ascii color value from stream(s) */
575 +        COLOR  col
576 + )
577 + {
578          double  vd[3];
579  
580          if (fin2 == NULL) {
# Line 542 | Line 591 | COLOR  col;
591   }
592  
593  
594 < getcdouble(col)         /* get a double color value from stream(s) */
595 < COLOR  col;
594 > static int
595 > getcdouble(             /* get a double color value from stream(s) */
596 >        COLOR  col
597 > )
598   {
599          double  vd[3];
600  
# Line 556 | Line 607 | COLOR  col;
607                          fread((char *)(vd+2), sizeof(double), 1, fin3) != 1)
608                          return(-1);
609          }
610 +        if (swapbytes)
611 +                swap64((char *)vd, 3);
612          setcolor(col, vd[rord[RED]], vd[rord[GRN]], vd[rord[BLU]]);
613          return(0);
614   }
615  
616  
617 < getcfloat(col)          /* get a float color value from stream(s) */
618 < COLOR  col;
617 > static int
618 > getcfloat(              /* get a float color value from stream(s) */
619 >        COLOR  col
620 > )
621   {
622          float  vf[3];
623  
# Line 575 | Line 630 | COLOR  col;
630                          fread((char *)(vf+2), sizeof(float), 1, fin3) != 1)
631                          return(-1);
632          }
633 +        if (swapbytes)
634 +                swap32((uint32 *)vf, 3);
635          setcolor(col, vf[rord[RED]], vf[rord[GRN]], vf[rord[BLU]]);
636          return(0);
637   }
638  
639  
640 < getcint(col)            /* get an int color value from stream(s) */
641 < COLOR  col;
640 > static int
641 > getcint(                /* get an int color value from stream(s) */
642 >        COLOR  col
643 > )
644   {
645          int  vi[3];
646  
# Line 600 | Line 659 | COLOR  col;
659   }
660  
661  
662 < getcbyte(col)           /* get a byte color value from stream(s) */
663 < COLOR  col;
662 > static int
663 > getcbyte(               /* get a byte color value from stream(s) */
664 >        COLOR  col
665 > )
666   {
667          BYTE  vb[3];
668  
# Line 620 | Line 681 | COLOR  col;
681   }
682  
683  
684 < getcword(col)           /* get a 16-bit color value from stream(s) */
685 < COLOR  col;
684 > static int
685 > getcword(               /* get a 16-bit color value from stream(s) */
686 >        COLOR  col
687 > )
688   {
689          uint16  vw[3];
690  
# Line 642 | Line 705 | COLOR  col;
705   }
706  
707  
708 < getbascii(col)          /* get an ascii brightness value from fin */
709 < COLOR  col;
708 > static int
709 > getbascii(              /* get an ascii brightness value from fin */
710 >        COLOR  col
711 > )
712   {
713          double  vd;
714  
# Line 654 | Line 719 | COLOR  col;
719   }
720  
721  
722 < getbdouble(col)         /* get a double brightness value from fin */
723 < COLOR  col;
722 > static int
723 > getbdouble(             /* get a double brightness value from fin */
724 >        COLOR  col
725 > )
726   {
727          double  vd;
728  
729          if (fread((char *)&vd, sizeof(double), 1, fin) != 1)
730                  return(-1);
731 +        if (swapbytes)
732 +                swap64((char *)&vd, 1);
733          setcolor(col, vd, vd, vd);
734          return(0);
735   }
736  
737  
738 < getbfloat(col)          /* get a float brightness value from fin */
739 < COLOR  col;
738 > static int
739 > getbfloat(              /* get a float brightness value from fin */
740 >        COLOR  col
741 > )
742   {
743          float  vf;
744  
745          if (fread((char *)&vf, sizeof(float), 1, fin) != 1)
746                  return(-1);
747 +        if (swapbytes)
748 +                swap32((uint32 *)&vf, 1);
749          setcolor(col, vf, vf, vf);
750          return(0);
751   }
752  
753  
754 < getbint(col)            /* get an int brightness value from fin */
755 < COLOR  col;
754 > static int
755 > getbint(                /* get an int brightness value from fin */
756 >        COLOR  col
757 > )
758   {
759          int  vi;
760          double  d;
# Line 692 | Line 767 | COLOR  col;
767   }
768  
769  
770 < getbbyte(col)           /* get a byte brightness value from fin */
771 < COLOR  col;
770 > static int
771 > getbbyte(               /* get a byte brightness value from fin */
772 >        COLOR  col
773 > )
774   {
775          BYTE  vb;
776          double  d;
# Line 706 | Line 783 | COLOR  col;
783   }
784  
785  
786 < getbword(col)           /* get a 16-bit brightness value from fin */
787 < COLOR  col;
786 > static int
787 > getbword(               /* get a 16-bit brightness value from fin */
788 >        COLOR  col
789 > )
790   {
791          uint16  vw;
792          double  d;
# Line 722 | Line 801 | COLOR  col;
801   }
802  
803  
804 < putcascii(col)                  /* put an ascii color to stdout */
805 < COLOR  col;
804 > static int
805 > putcascii(                      /* put an ascii color to stdout */
806 >        COLOR  col
807 > )
808   {
809          fprintf(stdout, "%15.3e %15.3e %15.3e\n",
810                          colval(col,ord[0]),
# Line 734 | Line 815 | COLOR  col;
815   }
816  
817  
818 < putcfloat(col)                  /* put a float color to stdout */
819 < COLOR  col;
818 > static int
819 > putcfloat(                      /* put a float color to stdout */
820 >        COLOR  col
821 > )
822   {
823          float  vf[3];
824  
825          vf[0] = colval(col,ord[0]);
826          vf[1] = colval(col,ord[1]);
827          vf[2] = colval(col,ord[2]);
828 +        if (swapbytes)
829 +                swap32((uint32 *)vf, 3);
830          fwrite((char *)vf, sizeof(float), 3, stdout);
831  
832          return(ferror(stdout) ? -1 : 0);
833   }
834  
835  
836 < putcdouble(col)                 /* put a double color to stdout */
837 < COLOR  col;
836 > static int
837 > putcdouble(                     /* put a double color to stdout */
838 >        COLOR  col
839 > )
840   {
841          double  vd[3];
842  
843          vd[0] = colval(col,ord[0]);
844          vd[1] = colval(col,ord[1]);
845          vd[2] = colval(col,ord[2]);
846 +        if (swapbytes)
847 +                swap64((char *)vd, 3);
848          fwrite((char *)vd, sizeof(double), 3, stdout);
849  
850          return(ferror(stdout) ? -1 : 0);
851   }
852  
853  
854 < putcint(col)                    /* put an int color to stdout */
855 < COLOR  col;
854 > static int
855 > putcint(                        /* put an int color to stdout */
856 >        COLOR  col
857 > )
858   {
859          fprintf(stdout, "%d %d %d\n",
860                          (int)(colval(col,ord[0])*256.),
# Line 774 | Line 865 | COLOR  col;
865   }
866  
867  
868 < putcbyte(col)                   /* put a byte color to stdout */
869 < COLOR  col;
868 > static int
869 > putcbyte(                       /* put a byte color to stdout */
870 >        COLOR  col
871 > )
872   {
873          long  i;
874          BYTE  vb[3];
# Line 792 | Line 885 | COLOR  col;
885   }
886  
887  
888 < putcword(col)                   /* put a 16-bit color to stdout */
889 < COLOR  col;
888 > static int
889 > putcword(                       /* put a 16-bit color to stdout */
890 >        COLOR  col
891 > )
892   {
893          long  i;
894          uint16  vw[3];
# Line 812 | Line 907 | COLOR  col;
907   }
908  
909  
910 < putbascii(col)                  /* put an ascii brightness to stdout */
911 < COLOR  col;
910 > static int
911 > putbascii(                      /* put an ascii brightness to stdout */
912 >        COLOR  col
913 > )
914   {
915          fprintf(stdout, "%15.3e\n", (*mybright)(col));
916  
# Line 821 | Line 918 | COLOR  col;
918   }
919  
920  
921 < putbfloat(col)                  /* put a float brightness to stdout */
922 < COLOR  col;
921 > static int
922 > putbfloat(                      /* put a float brightness to stdout */
923 >        COLOR  col
924 > )
925   {
926          float  vf;
927  
928          vf = (*mybright)(col);
929 +        if (swapbytes)
930 +                swap32((uint32 *)&vf, 1);
931          fwrite((char *)&vf, sizeof(float), 1, stdout);
932  
933          return(ferror(stdout) ? -1 : 0);
934   }
935  
936  
937 < putbdouble(col)                 /* put a double brightness to stdout */
938 < COLOR  col;
937 > static int
938 > putbdouble(                     /* put a double brightness to stdout */
939 >        COLOR  col
940 > )
941   {
942          double  vd;
943  
944          vd = (*mybright)(col);
945 +        if (swapbytes)
946 +                swap64((char *)&vd, 1);
947          fwrite((char *)&vd, sizeof(double), 1, stdout);
948  
949          return(ferror(stdout) ? -1 : 0);
950   }
951  
952  
953 < putbint(col)                    /* put an int brightness to stdout */
954 < COLOR  col;
953 > static int
954 > putbint(                        /* put an int brightness to stdout */
955 >        COLOR  col
956 > )
957   {
958          fprintf(stdout, "%d\n", (int)((*mybright)(col)*256.));
959  
# Line 854 | Line 961 | COLOR  col;
961   }
962  
963  
964 < putbbyte(col)                   /* put a byte brightness to stdout */
965 < COLOR  col;
964 > static int
965 > putbbyte(                       /* put a byte brightness to stdout */
966 >        COLOR  col
967 > )
968   {
969          register int  i;
970          BYTE  vb;
# Line 868 | Line 977 | COLOR  col;
977   }
978  
979  
980 < putbword(col)                   /* put a 16-bit brightness to stdout */
981 < COLOR  col;
980 > static int
981 > putbword(                       /* put a 16-bit brightness to stdout */
982 >        COLOR  col
983 > )
984   {
985          long  i;
986          uint16  vw;
# Line 884 | Line 995 | COLOR  col;
995   }
996  
997  
998 < putpascii(col)                  /* put an ascii primary to stdout */
999 < COLOR  col;
998 > static int
999 > putpascii(                      /* put an ascii primary to stdout */
1000 >        COLOR  col
1001 > )
1002   {
1003          fprintf(stdout, "%15.3e\n", colval(col,putprim));
1004  
# Line 893 | Line 1006 | COLOR  col;
1006   }
1007  
1008  
1009 < putpfloat(col)                  /* put a float primary to stdout */
1010 < COLOR  col;
1009 > static int
1010 > putpfloat(                      /* put a float primary to stdout */
1011 >        COLOR  col
1012 > )
1013   {
1014          float  vf;
1015  
1016          vf = colval(col,putprim);
1017 +        if (swapbytes)
1018 +                swap32((uint32 *)&vf, 1);
1019          fwrite((char *)&vf, sizeof(float), 1, stdout);
1020  
1021          return(ferror(stdout) ? -1 : 0);
1022   }
1023  
1024  
1025 < putpdouble(col)                 /* put a double primary to stdout */
1026 < COLOR  col;
1025 > static int
1026 > putpdouble(                     /* put a double primary to stdout */
1027 >        COLOR  col
1028 > )
1029   {
1030          double  vd;
1031  
1032          vd = colval(col,putprim);
1033 +        if (swapbytes)
1034 +                swap64((char *)&vd, 1);
1035          fwrite((char *)&vd, sizeof(double), 1, stdout);
1036  
1037          return(ferror(stdout) ? -1 : 0);
1038   }
1039  
1040  
1041 < putpint(col)                    /* put an int primary to stdout */
1042 < COLOR  col;
1041 > static int
1042 > putpint(                        /* put an int primary to stdout */
1043 >        COLOR  col
1044 > )
1045   {
1046          fprintf(stdout, "%d\n", (int)(colval(col,putprim)*256.));
1047  
# Line 926 | Line 1049 | COLOR  col;
1049   }
1050  
1051  
1052 < putpbyte(col)                   /* put a byte primary to stdout */
1053 < COLOR  col;
1052 > static int
1053 > putpbyte(                       /* put a byte primary to stdout */
1054 >        COLOR  col
1055 > )
1056   {
1057          long  i;
1058          BYTE  vb;
# Line 940 | Line 1065 | COLOR  col;
1065   }
1066  
1067  
1068 < putpword(col)                   /* put a 16-bit primary to stdout */
1069 < COLOR  col;
1068 > static int
1069 > putpword(                       /* put a 16-bit primary to stdout */
1070 >        COLOR  col
1071 > )
1072   {
1073          long  i;
1074          uint16  vw;
# Line 956 | Line 1083 | COLOR  col;
1083   }
1084  
1085  
1086 < set_io()                        /* set put and get functions */
1086 > static void
1087 > set_io(void)                    /* set put and get functions */
1088   {
1089          switch (format) {
1090          case 'a':                                       /* ascii */
# Line 1084 | Line 1212 | set_io()                       /* set put and get functions */
1212                  }
1213                  return;
1214          }
1215 < badopt:
1215 > /* badopt: */ /* label not used */
1216          fprintf(stderr, "%s: botched file type\n", progname);
1217          quit(1);
1218   namerr:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines