diff options
author | Thomas White <taw@physics.org> | 2011-02-08 19:10:27 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-02-22 15:27:13 +0100 |
commit | e980ed54dc29e025587aba47390727c500aec8f1 (patch) | |
tree | a818f47cf8f00c034c59e7df8d825965d217d1c9 /src/templates.c | |
parent | 606a2cd5432fe342d73ab8f37a1b383142c52fdb (diff) |
Work on making iteration work
Diffstat (limited to 'src/templates.c')
-rw-r--r-- | src/templates.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/templates.c b/src/templates.c index 9abbcb17..79e60aec 100644 --- a/src/templates.c +++ b/src/templates.c @@ -232,13 +232,14 @@ static double integrate_all_rot(struct image *image, RefList *reflections, double cosr, sinr; int num_int = 0; Reflection *refl; + RefListIterator *iter; cosr = cos(rot); sinr = sin(rot); - for ( refl = first_refl(reflections); + for ( refl = first_refl(reflections, &iter); refl != NULL; - refl = next_refl(refl) ) { + refl = next_refl(refl, iter) ) { float xp, yp; double x, y; @@ -266,14 +267,15 @@ static double mean_distance(struct image *image, RefList *reflections, double cosr, sinr; int num_dist = 0; Reflection *refl; + RefListIterator *iter; cosr = cos(rot); sinr = sin(rot); /* For each template peak */ - for ( refl = first_refl(reflections); + for ( refl = first_refl(reflections, &iter); refl != NULL; - refl = next_refl(refl) ) { + refl = next_refl(refl, iter) ) { float xp, yp; int j; |