From b7928ad9b90c45ff227bb6124c3a365283f11db4 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 4 Jul 2011 11:24:36 +0200 Subject: Tidy up a bit --- src/partialator.c | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/partialator.c b/src/partialator.c index 101fe29f..367d3a6e 100644 --- a/src/partialator.c +++ b/src/partialator.c @@ -316,10 +316,13 @@ int main(int argc, char *argv[]) for ( i=0; idet = det; + + if ( read_chunk(fh, cur) != 0 ) { /* Should not happen, because we counted the patterns * earlier. */ ERROR("Failed to read chunk from the input stream.\n"); @@ -327,33 +330,32 @@ int main(int argc, char *argv[]) } /* Won't be needing this, if it exists */ - image_feature_list_free(images[n_usable_patterns].features); - images[n_usable_patterns].features = NULL; + image_feature_list_free(cur->features); + cur->features = NULL; /* "n_usable_patterns" will not be incremented in this case */ - if ( images[n_usable_patterns].indexed_cell == NULL ) continue; + if ( cur->indexed_cell == NULL ) continue; /* Fill in initial estimates of stuff */ - images[n_usable_patterns].div = beam->divergence; - images[n_usable_patterns].bw = beam->bandwidth; - images[n_usable_patterns].width = det->max_fs; - images[n_usable_patterns].height = det->max_ss; - images[n_usable_patterns].osf = 1.0; - images[n_usable_patterns].profile_radius = 0.0001e9; - images[n_usable_patterns].pr_dud = 0; + cur->div = beam->divergence; + cur->bw = beam->bandwidth; + cur->width = det->max_fs; + cur->height = det->max_ss; + cur->osf = 1.0; + cur->profile_radius = 0.0001e9; + cur->pr_dud = 0; /* Muppet proofing */ - images[n_usable_patterns].data = NULL; - images[n_usable_patterns].flags = NULL; - images[n_usable_patterns].beam = NULL; + cur->data = NULL; + cur->flags = NULL; + cur->beam = NULL; /* This is the raw list of reflections */ - as = asymmetric_indices(images[n_usable_patterns].reflections, - sym); - reflist_free(images[n_usable_patterns].reflections); - images[n_usable_patterns].reflections = as; + as = asymmetric_indices(cur->reflections, sym); + reflist_free(cur->reflections); + cur->reflections = as; - update_partialities(&images[n_usable_patterns], sym, scalable, + update_partialities(cur, sym, scalable, &n_expected, &n_found, &n_notfound); progress_bar(i, n_total_patterns-1, "Loading pattern data"); -- cgit v1.2.3