comparison Meerwald/cmp_frid2_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 4987db85cfae
comparison
equal deleted inserted replaced
7:2b350281f8b0 8:f83ef905a63d
27 27
28 int c, i; 28 int c, i;
29 int corr1 = 0, match1 = 0; 29 int corr1 = 0, match1 = 0;
30 int corr2 = 0, match2 = 0; 30 int corr2 = 0, match2 = 0;
31 int verbose = 0; 31 int verbose = 0;
32 char filter_name[MAXPATHLEN] = "";
33 32
34 int seed; 33 char line[1024];
35 char line[32];
36 34
37 progname = argv[0]; 35 progname = argv[0];
38 36
39 while ((c = getopt(argc, argv, "h?Co:s:v:")) != EOF) { 37 while ((c = getopt(argc, argv, "h?Co:s:v:")) != EOF) {
40 switch (c) { 38 switch (c) {
75 if (argc > 1) { 73 if (argc > 1) {
76 usage(); 74 usage();
77 exit(1); 75 exit(1);
78 } 76 }
79 77
80 if (argc == 1 && *argv[0] != '-') 78 if (argc == 1 && *argv[0] != '-') {
81 if ((in = fopen(argv[0], "r")) == NULL) { 79 if ((in = fopen(argv[0], "r")) == NULL) {
82 fprintf(stderr, "%s: unable to open input file %s\n", progname, argv[0]); 80 fprintf(stderr, "%s: unable to open input file %s\n", progname, argv[0]);
83 exit(1); 81 exit(1);
84 } 82 }
85 else 83 else
86 strcpy(input_name, argv[0]); 84 strcpy(input_name, argv[0]);
87 85 }
86
88 if (sig) { 87 if (sig) {
89 fgets(line, sizeof(line), sig); 88 fgets(line, sizeof(line), sig);
90 if (strspn(line, "FR2SG") >= 5) { 89 if (strspn(line, "FR2SG") >= 5) {
91 fscanf(sig, "%d\n", &nbit_signature); 90 fscanf(sig, "%d\n", &nbit_signature);
92 fscanf(sig, "%*lf\n"); 91 fscanf(sig, "%*lf\n");
98 } 97 }
99 else { 98 else {
100 fprintf(stderr, "%s: invalid signature file %s\n", progname, signature_name); 99 fprintf(stderr, "%s: invalid signature file %s\n", progname, signature_name);
101 exit(1); 100 exit(1);
102 } 101 }
103 close(sig); 102 fclose(sig);
104 } 103 }
105 else { 104 else {
106 fprintf(stderr, "%s: original signature file not specified, use -s file option\n", progname); 105 fprintf(stderr, "%s: original signature file not specified, use -s file option\n", progname);
107 exit(1); 106 exit(1);
108 } 107 }

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