Changeset 31160 for trunk/Ohana/src/dvomerge
- Timestamp:
- Apr 4, 2011, 1:19:27 PM (15 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/dvomerge/src/dvoverify.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/dvomerge/src/dvoverify.c
r30830 r31160 13 13 # define DEBUG 0 14 14 15 int VERBOSE; 16 int CHECKSORTED; 15 int VERBOSE = FALSE; 17 16 int NNotSorted = 0; 18 17 … … 28 27 // Catalog catalog; 29 28 30 VERBOSE = FALSE; 29 int CHECKSORTED; 30 31 31 if ((N = get_argument (argc, argv, "-v"))) { 32 32 VERBOSE = TRUE; 33 33 remove_argument (N, &argc, argv); 34 34 } 35 if ((N = get_argument (argc, argv, "-verbose"))) { 36 VERBOSE = TRUE; 37 remove_argument (N, &argc, argv); 38 } 35 39 if ((N = get_argument (argc, argv, "-s"))) { 36 40 CHECKSORTED = TRUE; 37 41 remove_argument (N, &argc, argv); 38 42 } 39 43 if ((N = get_argument (argc, argv, "-sorted"))) { 44 CHECKSORTED = TRUE; 45 remove_argument (N, &argc, argv); 46 } 40 47 41 48 // restrict to a portion of the sky … … 57 64 58 65 if (argc != 2) { 59 fprintf (stderr, "USAGE: dvoverify (catdir) [-region Rmin Rmax Dmin Dmax] [-v -s]\n\n -v = verbose \n -s = checks if sorted, return error if not\n"); 60 fprintf (stderr, " catdir : database of interest\n"); 66 fprintf (stderr, "USAGE: dvoverify (catdir) [-region Rmin Rmax Dmin Dmax] [-v] [-s]\n\n"); 67 fprintf (stderr, " -v : VERBOSE\n"); 68 fprintf (stderr, " -s : checks if sorted, return error if not\n"); 69 fprintf (stderr, " (catdir) : database of interest\n"); 61 70 exit (2); 62 71 } … … 96 105 for (i = 0; i < inlist[0].Nregions; i++) { 97 106 if (!inlist[0].regions[i][0].table) continue; 98 if ((NNotSorted > 0) && CHECKSORTED) continue;99 107 if (i % 1000 == 0) fprintf (stderr, "."); 100 108 … … 116 124 if (!CheckCatalogIndexes(catdir, inlist[0].filename[i], inlist[0].regions[i])){ 117 125 Nbad ++; 126 } 127 128 // exit immediately if any file are unsorted and we require sorted tables 129 if (CHECKSORTED && NNotSorted) { 130 fprintf (stderr, "ERROR: files are not sorted\n"); 131 exit (1); 118 132 } 119 133 } … … 123 137 exit (1); 124 138 } 125 if ((NNotSorted > 0) && CHECKSORTED) {126 fprintf (stderr, "ERROR: files are not sorted\n");127 exit (1);128 }129 139 130 140 fprintf (stderr, "SUCCESS: no files are bad\n"); 141 if (NNotSorted) { 142 fprintf (stderr, "NOTE: %d files are not sorted\n", NNotSorted); 143 } 131 144 exit (0); 132 145 }
Note:
See TracChangeset
for help on using the changeset viewer.
