comparison Meerwald/cmp_xie2_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 acb6967ee76d
children ad1d224896c5
comparison
equal deleted inserted replaced
7:2b350281f8b0 8:f83ef905a63d
31 int filter = 0; 31 int filter = 0;
32 int method = 0; 32 int method = 0;
33 int level = 0; 33 int level = 0;
34 int quant = 0; 34 int quant = 0;
35 double alpha = 0.0; 35 double alpha = 0.0;
36 double intensity = 0.0;
37 int subband = 0;
38 char filter_name[MAXPATHLEN] = ""; 36 char filter_name[MAXPATHLEN] = "";
39 37
40 int seed; 38 int seed;
41 char line[32]; 39 char line[32];
42 40
81 if (argc > 1) { 79 if (argc > 1) {
82 usage(); 80 usage();
83 exit(1); 81 exit(1);
84 } 82 }
85 83
86 if (argc == 1 && *argv[0] != '-') 84 if (argc == 1 && *argv[0] != '-') {
87 if ((in = fopen(argv[0], "r")) == NULL) { 85 if ((in = fopen(argv[0], "r")) == NULL) {
88 fprintf(stderr, "%s: unable to open input file %s\n", progname, argv[0]); 86 fprintf(stderr, "%s: unable to open input file %s\n", progname, argv[0]);
89 exit(1); 87 exit(1);
90 } 88 }
91 else 89 else
92 strcpy(input_name, argv[0]); 90 strcpy(input_name, argv[0]);
93 91 }
92
94 if (sig) { 93 if (sig) {
95 fgets(line, sizeof(line), sig); 94 fgets(line, sizeof(line), sig);
96 if (strspn(line, "XE2SG") >= 5) { 95 if (strspn(line, "XE2SG") >= 5) {
97 fscanf(sig, "%d\n", &nbit_signature1); 96 fscanf(sig, "%d\n", &nbit_signature1);
98 fscanf(sig, "%lf\n", &alpha); 97 fscanf(sig, "%lf\n", &alpha);
109 } 108 }
110 else { 109 else {
111 fprintf(stderr, "%s: invalid signature file %s\n", progname, signature_name); 110 fprintf(stderr, "%s: invalid signature file %s\n", progname, signature_name);
112 exit(1); 111 exit(1);
113 } 112 }
114 close(sig); 113 fclose(sig);
115 } 114 }
116 else { 115 else {
117 fprintf(stderr, "%s: original signature file not specified, use -s file option\n", progname); 116 fprintf(stderr, "%s: original signature file not specified, use -s file option\n", progname);
118 exit(1); 117 exit(1);
119 } 118 }

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