diff options
author | Thomas White <taw@physics.org> | 2011-05-05 10:06:22 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-02-22 15:27:25 +0100 |
commit | d9571cba95338bb1e6b63f68c7420639c2833742 (patch) | |
tree | 4d44bcfeddf1df23048c8f95d1050ba1f6071a80 /src | |
parent | 9275cd4740a3b71c33f3964998209dd07d93b26c (diff) |
Ensure initialisation
Diffstat (limited to 'src')
-rw-r--r-- | src/post-refinement.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/post-refinement.c b/src/post-refinement.c index 0945affd..8e5c0885 100644 --- a/src/post-refinement.c +++ b/src/post-refinement.c @@ -90,7 +90,7 @@ static double gradient(struct image *image, int k, Reflection *refl, double r) { double ds, tt, azi; double nom, den; - double g = 0.0; + double g; double asx, asy, asz; double bsx, bsy, bsz; double csx, csy, csz; @@ -115,6 +115,7 @@ static double gradient(struct image *image, int k, Reflection *refl, double r) get_partial(refl, &r1, &r2, &p, &clamp_low, &clamp_high); /* Calculate the gradient of partiality wrt excitation error. */ + g = 0.0; if ( clamp_low == 0 ) { g += partiality_gradient(r1, r); } @@ -132,6 +133,7 @@ static double gradient(struct image *image, int k, Reflection *refl, double r) return (nom/den) * g; case REF_R : + g = 0.0; if ( clamp_low == 0 ) { g += partiality_rgradient(r1, r); } |