diff Meerwald/cmp_dugad_sig.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
line wrap: on
line diff
--- a/Meerwald/cmp_dugad_sig.c	Wed Apr 16 15:55:52 2008 +0200
+++ b/Meerwald/cmp_dugad_sig.c	Tue Apr 22 13:36:05 2008 +0200
@@ -15,7 +15,6 @@
 
   FILE *in = stdin;
   FILE *out = stdout;
-  FILE *sig = NULL;
 
   char output_name[MAXPATHLEN] = "(stdout)";
   char input_name[MAXPATHLEN] = "(stdin)";
@@ -28,7 +27,6 @@
 
   int correlation_only = 0;
   int verbose = 0;
-  double corr;
 	
   progname = argv[0];
 
@@ -68,14 +66,15 @@
     exit(1);
   }
 
-  if (argc == 1 && *argv[0] != '-')
+  if (argc == 1 && *argv[0] != '-') {
     if ((in = fopen(argv[0], "r")) == NULL) {
       fprintf(stderr, "%s: unable to open input file %s\n", progname, argv[0]);
       exit(1);
     }
     else
       strcpy(input_name, argv[0]);
-
+  }
+  
   fgets(line, sizeof(line), in);
   if (strspn(line, "DGWM") < 4) {
     fprintf(stderr, "%s: watermark file %s invalid\n", progname, input_name);
@@ -94,11 +93,12 @@
 
     // HL subband
     fscanf(in, "%d %lf %lf\n", &m, &z, &v);
-    if (verbose && !correlation_only)
+    if (verbose && !correlation_only) {
       if (m)
         fprintf(out, "%f %f\n",  z /  (double) m, (v * alpha) / (double) (1.0 * m));
       else
         fprintf(out, "0.0 0.0\n");
+    }
     if (m) {
       ok += (z > v * alpha / (double) 1.0) ? 1 : 0;
       diff += ((z - v * alpha) / (double) (1.0 * m)); 
@@ -108,11 +108,12 @@
 
     // LH subband
     fscanf(in, "%d %lf %lf\n", &m, &z, &v);
-    if (verbose && !correlation_only)
+    if (verbose && !correlation_only) {
       if (m)
         fprintf(out, "%f %f\n", z / (double) m, (v * alpha) / (double) (1.0 * m));
       else
         fprintf(out, "0.0 0.0\n");
+    }
     if (m) {
       ok += (z > v * alpha / (double) 1.0) ? 1 : 0;
       diff += ((z - v * alpha) / (double) (1.0 * m)); 
@@ -122,12 +123,13 @@
 
     // HH subband
     fscanf(in, "%d %lf %lf\n", &m, &z, &v);
-    if (verbose && !correlation_only)
+    if (verbose && !correlation_only) {
       if (m)
         fprintf(out, "%f %f\n", z / (double) m, (v * alpha) / (double) (1.0 * m));
       else
         fprintf(out, "0.0 0.0\n");
- 
+    }
+    
     if (m) {
       ok += (z > v * alpha / (double) 1.0) ? 1 : 0;
       diff += ((z - v * alpha) / (double) (1.0 * m)); 

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