From 5b1bd4c46b6137a78ce9641c7113baac704db42a Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 24 Oct 2014 17:05:26 +0200 Subject: hdfsee: Avoid passing empty beam parameters structure --- src/hdfsee.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/hdfsee.c') 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, -- cgit v1.2.3