Mercurial > hg > wm
comparison Meerwald/wm_koch_d.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 |
---|---|
28 | 28 |
29 char signature_name[MAXPATHLEN]; | 29 char signature_name[MAXPATHLEN]; |
30 char input_name[MAXPATHLEN] = "(stdin)"; | 30 char input_name[MAXPATHLEN] = "(stdin)"; |
31 char output_name[MAXPATHLEN] = "(stdout)"; | 31 char output_name[MAXPATHLEN] = "(stdout)"; |
32 | 32 |
33 int i; | |
34 int j; | |
35 int c; | 33 int c; |
36 int n; | 34 int n; |
37 int x; | |
38 int y; | |
39 | 35 |
40 int rows, cols, format; | 36 int rows, cols, format; |
41 gray maxval; | 37 gray maxval; |
42 int row, col; | 38 int row; |
43 | 39 |
44 int seed; | 40 int seed; |
45 int verbose = 0; | 41 int verbose = 0; |
46 | 42 |
47 double quality = 0.0; | 43 double quality = 0.0; |
103 if (argc > 1) { | 99 if (argc > 1) { |
104 usage(); | 100 usage(); |
105 exit(1); | 101 exit(1); |
106 } | 102 } |
107 | 103 |
108 if (argc == 1 && *argv[0] != '-') | 104 if (argc == 1 && *argv[0] != '-') { |
109 if ((in = fopen(argv[0], "rb")) == NULL) { | 105 if ((in = fopen(argv[0], "rb")) == NULL) { |
110 fprintf(stderr, "%s: unable to open input file %s\n", progname, argv[0]); | 106 fprintf(stderr, "%s: unable to open input file %s\n", progname, argv[0]); |
111 exit(1); | 107 exit(1); |
112 } | 108 } |
113 else | 109 else |
114 strcpy(input_name, argv[0]); | 110 strcpy(input_name, argv[0]); |
115 | 111 } |
112 | |
116 if (sig) { | 113 if (sig) { |
117 char line[128]; | 114 char line[128]; |
118 fgets(line, sizeof(line), sig); | 115 fgets(line, sizeof(line), sig); |
119 if (strspn(line, "KCSG") >= 4) { | 116 if (strspn(line, "KCSG") >= 4) { |
120 fscanf(sig, "%d\n", &nbit_signature); | 117 fscanf(sig, "%d\n", &nbit_signature); |
182 while (n < nbit_signature) { | 179 while (n < nbit_signature) { |
183 int xb; | 180 int xb; |
184 int yb; | 181 int yb; |
185 int c1, c2; | 182 int c1, c2; |
186 double v1, v2; | 183 double v1, v2; |
187 double q = 1.0; | |
188 | 184 |
189 do { | 185 do { |
190 xb = random() % (cols / NJPEG); | 186 xb = random() % (cols / NJPEG); |
191 yb = random() % (rows / NJPEG); | 187 yb = random() % (rows / NJPEG); |
192 } while (add_coord(coords, xb, yb) < 0); | 188 } while (add_coord(coords, xb, yb) < 0); |