Mercurial > hg > wm
comparison Meerwald/wm_cox_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 |
---|---|
1 #include "wm.h" | 1 #include "wm.h" |
2 #include "dct.h" | 2 #include "dct.h" |
3 #include "pgm.h" | 3 #include "pgm.h" |
4 #include "sort.h" | |
4 | 5 |
5 char *progname; | 6 char *progname; |
6 | 7 |
7 void usage(void) { | 8 void usage(void) { |
8 fprintf(stderr, "usage: %s [-a n] [-h] [-n n] [-o file] [-s file] [-v n] -i file file\n\n", progname); | 9 fprintf(stderr, "usage: %s [-a n] [-h] [-n n] [-o file] [-s file] [-v n] -i file file\n\n", progname); |
30 char output_name[MAXPATHLEN] = "(stdout)"; | 31 char output_name[MAXPATHLEN] = "(stdout)"; |
31 char input_name[MAXPATHLEN] = "(stdin)"; | 32 char input_name[MAXPATHLEN] = "(stdin)"; |
32 char orig_name[MAXPATHLEN]; | 33 char orig_name[MAXPATHLEN]; |
33 | 34 |
34 int c; | 35 int c; |
35 int r; | |
36 int i, j; | 36 int i, j; |
37 int n = 100; | 37 int n = 100; |
38 | 38 |
39 double a = 0.3; | 39 double a = 0.3; |
40 | 40 |
44 int in_rows, in_cols, in_format; | 44 int in_rows, in_cols, in_format; |
45 gray in_maxval; | 45 gray in_maxval; |
46 int orig_rows, orig_cols, orig_format; | 46 int orig_rows, orig_cols, orig_format; |
47 gray orig_maxval; | 47 gray orig_maxval; |
48 int rows, cols; | 48 int rows, cols; |
49 int row, col; | 49 int row; |
50 | 50 |
51 double threshold; | 51 double threshold; |
52 double *largest; | 52 double *largest; |
53 | 53 |
54 double **input_dcts; | 54 double **input_dcts; |
119 if (argc > 1) { | 119 if (argc > 1) { |
120 usage(); | 120 usage(); |
121 exit(1); | 121 exit(1); |
122 } | 122 } |
123 | 123 |
124 if (argc == 1 && *argv[0] != '-') | 124 if (argc == 1 && *argv[0] != '-') { |
125 if ((in = fopen(argv[0], "rb")) == NULL) { | 125 if ((in = fopen(argv[0], "rb")) == NULL) { |
126 fprintf(stderr, "%s: unable to open input file %s\n", progname, argv[0]); | 126 fprintf(stderr, "%s: unable to open input file %s\n", progname, argv[0]); |
127 exit(1); | 127 exit(1); |
128 } | 128 } |
129 else | 129 else |
130 strcpy(input_name, argv[0]); | 130 strcpy(input_name, argv[0]); |
131 | 131 } |
132 | |
132 if (!orig) { | 133 if (!orig) { |
133 fprintf(stderr, "%s: original image file not specified, use -i file option\n", progname); | 134 fprintf(stderr, "%s: original image file not specified, use -i file option\n", progname); |
134 exit(1); | 135 exit(1); |
135 } | 136 } |
136 | 137 |