diff options
author | Thomas White <taw@physics.org> | 2014-10-24 17:05:26 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2014-10-24 17:05:26 +0200 |
commit | 5b1bd4c46b6137a78ce9641c7113baac704db42a (patch) | |
tree | b09e2d93f078c10089020530536bd0ab301d4ee5 /src/hdfsee.c | |
parent | 8ca1b8127f53088e04a046a93d10a07d2dc5e2d0 (diff) |
hdfsee: Avoid passing empty beam parameters structure
Diffstat (limited to 'src/hdfsee.c')
-rw-r--r-- | src/hdfsee.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/hdfsee.c b/src/hdfsee.c index 1ef21559..cc35b6e0 100644 --- a/src/hdfsee.c +++ b/src/hdfsee.c @@ -131,7 +131,8 @@ int main(int argc, char *argv[]) int n_rings = -1; int median_filter = 0; struct detector *det_geom = NULL; - struct beam_params beam; + struct beam_params cbeam; + struct beam_params *beam = NULL; /* Long options */ const struct option longopts[] = { @@ -153,8 +154,8 @@ int main(int argc, char *argv[]) }; /* Default beam parameters */ - beam.photon_energy = 0.0; - beam.photon_energy_from = NULL; + cbeam.photon_energy = 0.0; + cbeam.photon_energy_from = NULL; /* This isn't great, but necessary to make the command-line UI and file * formats consistent with the other programs, which all use the C @@ -212,12 +213,13 @@ int main(int argc, char *argv[]) break; case 'g' : - det_geom = get_detector_geometry(optarg, &beam); + det_geom = get_detector_geometry(optarg, &cbeam); if ( det_geom == NULL ) { ERROR("Failed to read detector geometry from '%s'\n", optarg); return 1; } + beam = &cbeam; break; case 2 : @@ -296,7 +298,7 @@ int main(int argc, char *argv[]) config_noisefilter, config_calibmode, colscale, element, - det_geom, &beam, + det_geom, beam, config_showrings, ring_radii, n_rings, |