Changeset 34277
- Timestamp:
- Aug 2, 2012, 9:38:03 AM (14 years ago)
- Location:
- trunk/Ohana/src/dvomerge
- Files:
-
- 3 edited
-
include/dvomerge.h (modified) (2 diffs)
-
src/IDmapIO.c (modified) (1 diff)
-
src/dvo_image_merge_dbs.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/dvomerge/include/dvomerge.h
r34260 r34277 42 42 unsigned int *old; 43 43 unsigned int *new; 44 char *notFound; 44 45 } IDmapType; 45 46 … … 128 129 int IDmapSave PROTO((char *filename, IDmapType *IDmap)); 129 130 IDmapType *IDmapLoad PROTO((char *filename)); 131 int create_IDmap_lookup PROTO((IDmapType *IDmap)); -
trunk/Ohana/src/dvomerge/src/IDmapIO.c
r33963 r34277 133 133 fprintf (stderr, "loaded data for %lld images\n", (long long) Nrow); 134 134 135 create_IDmap_lookup (IDmap); 136 135 137 return IDmap; 136 138 } -
trunk/Ohana/src/dvomerge/src/dvo_image_merge_dbs.c
r33963 r34277 54 54 } 55 55 56 create_IDmap_lookup (IDmap); 57 56 58 FREE(TgtIndex); 57 59 FREE(TgtTimes); … … 105 107 } 106 108 109 107 110 // sort IDmap->old,new on the basis of IDmap->old: 108 111 sort_IDmap (IDmap); 112 113 create_IDmap_lookup (IDmap); 109 114 110 115 if (!out[0].swapped) { … … 172 177 newID = dvo_map_image_ID (IDmap, oldID); 173 178 if (newID == 0) { 174 fprintf (stderr, "cannot find image ID "OFF_T_FMT"\n", oldID); 179 if (!IDmap->notFound[oldID]) { 180 fprintf (stderr, "cannot find image ID "OFF_T_FMT"\n", oldID); 181 IDmap->notFound[oldID] = TRUE; 182 // once we discover an imageID is not found, record that fact so we do not complain for every detection 183 } 184 // optionally exit here? or wait until end to report an error? 175 185 // exit (2); 176 186 } … … 242 252 } 243 253 254 // we need a lookup table of length (oldIDmax + 1) to record if a given oldIDmax has not been found in Tgt 255 int create_IDmap_lookup (IDmapType *IDmap) { 256 257 off_t i; 258 unsigned int oldIDmax = 0; 259 260 for (i = 0; i < IDmap->Nmap; i++) { 261 if (oldIDmax > IDmap->old[i]) continue; 262 oldIDmax = IDmap->old[i]; 263 } 264 ALLOCATE (IDmap->notFound, char, oldIDmax + 1); 265 memset (IDmap->notFound, 0, sizeof(char) * (oldIDmax + 1)); 266 return TRUE; 267 }
Note:
See TracChangeset
for help on using the changeset viewer.
