diff Meerwald/cmp_dct8x8.c @ 8:f83ef905a63d

fixing many warnings increase capacity for coordinates in bruyn fix some uninit. variables
author Peter Meerwald <pmeerw@cosy.sbg.ac.at>
date Tue, 22 Apr 2008 13:36:05 +0200
parents be303a3f5ea8
children bd669312f068
line wrap: on
line diff
--- a/Meerwald/cmp_dct8x8.c	Wed Apr 16 15:55:52 2008 +0200
+++ b/Meerwald/cmp_dct8x8.c	Tue Apr 22 13:36:05 2008 +0200
@@ -97,14 +97,15 @@
     exit(1);
   }
 
-  if (argc == 1 && *argv[0] != '-')
+  if (argc == 1 && *argv[0] != '-') {
     if ((in = fopen(argv[0], "rb")) == NULL) {
       fprintf(stderr, "%s: unable to open input file %s\n", progname, argv[0]);
       exit(1);
     }
     else
       strcpy(input_name, argv[0]);
-
+  } 
+  
   if (!orig) {
     fprintf(stderr, "%s: original image file not specified, use -i file option\n", progname);
     exit(1);
@@ -119,6 +120,11 @@
     exit(1);
   }
 
+  cols = in_cols;
+  rows = in_rows;
+  format = in_format;
+  maxval = in_maxval;
+
   if (cols % NJPEG) {
     fprintf(stderr, "%s: image width %d not a multiple of %d\n", progname, cols, NJPEG);
     exit(1);
@@ -129,11 +135,6 @@
     exit(1);
   }
 
-  cols = in_cols;
-  rows = in_rows;
-  format = in_format;
-  maxval = in_maxval;
-
   input_image = pgm_allocarray(cols, NJPEG);
   orig_image = pgm_allocarray(cols, NJPEG);
 

Repositories maintained by Peter Meerwald, pmeerw@pmeerw.net.