diff options
author | Thomas White <taw@physics.org> | 2011-10-12 12:24:51 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-02-22 15:27:39 +0100 |
commit | 13257c9d5e5c0d06df4ed0bdcdbc2ba6c7acc6cd (patch) | |
tree | 7e4307d5fbf6dc49c26ada1a555e21e892ecf743 /src/reflist.c | |
parent | c479780bc2b15e2d095cdb13d69f372933a06597 (diff) |
Rationalise handling of phases in RefList
Diffstat (limited to 'src/reflist.c')
-rw-r--r-- | src/reflist.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/reflist.c b/src/reflist.c index fc61a7e4..33a8d60e 100644 --- a/src/reflist.c +++ b/src/reflist.c @@ -78,6 +78,7 @@ struct _refldata { /* Phase */ double phase; + int have_phase; /* Redundancy */ int redundancy; @@ -451,12 +452,14 @@ double get_esd_intensity(const Reflection *refl) /** * get_phase: * @refl: A %Reflection + * @have_phase: Place to store a non-zero value if the phase is set, or NULL. * * Returns: the phase for this reflection. * **/ -double get_phase(const Reflection *refl) +double get_phase(const Reflection *refl, int *have_phase) { + if ( have_phase != NULL ) *have_phase = refl->data.have_phase; return refl->data.phase; } @@ -631,6 +634,7 @@ void set_esd_intensity(Reflection *refl, double esd) void set_ph(Reflection *refl, double phase) { refl->data.phase = phase; + refl->data.have_phase = 1; } |