Mercurial > hg > wm
comparison Meerwald/gen_bruyn_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 |
|---|---|
| 129 usage(); | 129 usage(); |
| 130 exit(1); | 130 exit(1); |
| 131 } | 131 } |
| 132 | 132 |
| 133 if (b % 2 > 0 || b <= 2) { | 133 if (b % 2 > 0 || b <= 2) { |
| 134 fprintf(stderr, "%s: block size has to be even and greater than 2\n"); | 134 fprintf(stderr, "%s: block size has to be even and greater than 2\n", progname); |
| 135 exit(1); | 135 exit(1); |
| 136 } | 136 } |
| 137 | 137 |
| 138 if (argc == 1 && *argv[0] != '-') | 138 if (argc == 1 && *argv[0] != '-') { |
| 139 if ((in = fopen(argv[0], "rb")) == NULL) { | 139 if ((in = fopen(argv[0], "rb")) == NULL) { |
| 140 fprintf(stderr, "%s: unable to open input file %s\n", progname, argv[0]); | 140 fprintf(stderr, "%s: unable to open input file %s\n", progname, argv[0]); |
| 141 exit(1); | 141 exit(1); |
| 142 } | 142 } |
| 143 else | 143 else |
| 144 strcpy(input_name, argv[0]); | 144 strcpy(input_name, argv[0]); |
| 145 } | |
| 145 | 146 |
| 146 // read signature file and set options | 147 // read signature file and set options |
| 147 // command line options override signature file options | 148 // command line options override signature file options |
| 148 if (sig) { | 149 if (sig) { |
| 149 char line[128]; | 150 char line[128]; |
| 219 fprintf(out, "%d\n", p2); | 220 fprintf(out, "%d\n", p2); |
| 220 fprintf(out, "%f\n", q); | 221 fprintf(out, "%f\n", q); |
| 221 fprintf(out, "%f\n", t1); | 222 fprintf(out, "%f\n", t1); |
| 222 fprintf(out, "%f\n", t2); | 223 fprintf(out, "%f\n", t2); |
| 223 fprintf(out, "%d\n", b); | 224 fprintf(out, "%d\n", b); |
| 224 fprintf(out, "%d\n", random()); | 225 fprintf(out, "%ld\n", random()); |
| 225 fwrite(signature, sizeof(char), nb, out); | 226 fwrite(signature, sizeof(char), nb, out); |
| 226 fprintf(out, "\n"); | 227 fprintf(out, "\n"); |
| 227 | 228 |
| 228 fclose(out); | 229 fclose(out); |
| 229 | 230 |
