From 07fab90f63443a4b048008298ecad2c53a5276bc Mon Sep 17 00:00:00 2001 From: Valerio Mariani Date: Mon, 26 Jan 2015 18:09:27 +0100 Subject: Fussiness --- libcrystfel/src/detector.c | 43 +++++++++++++++++++++---------------------- libcrystfel/src/detector.h | 3 +-- libcrystfel/src/stream.c | 3 +-- 3 files changed, 23 insertions(+), 26 deletions(-) (limited to 'libcrystfel/src') diff --git a/libcrystfel/src/detector.c b/libcrystfel/src/detector.c index ecb0ea99..7c7e5cd6 100644 --- a/libcrystfel/src/detector.c +++ b/libcrystfel/src/detector.c @@ -230,8 +230,8 @@ static int count_trailing_spaces(const char *string) { } -static void build_output_line (const char *line, char *new_line, - const char *string_to_write) +static void build_output_line(const char *line, char *new_line, + const char *string_to_write) { int nsp, i, w, ww; int trailsp; @@ -615,7 +615,6 @@ struct rg_collection *find_rigid_group_collection_by_name(struct detector *det, } return NULL; - } @@ -761,16 +760,14 @@ static struct rg_collection *find_or_add_rg_coll(struct detector *det, struct rg_collection *rgc; for ( i=0; in_rg_collections; i++ ) { - - if ( strcmp(det->rigid_group_collections[i]->name, name) == 0 ) { + if ( strcmp(det->rigid_group_collections[i]->name, name) == 0 ) + { return det->rigid_group_collections[i]; } - } new = realloc(det->rigid_group_collections, - (1+det->n_rg_collections)* - sizeof(struct rg_collection *)); + (1+det->n_rg_collections)*sizeof(struct rg_collection *)); if ( new == NULL ) return NULL; det->rigid_group_collections = new; @@ -819,7 +816,9 @@ static void add_to_rigid_group_coll(struct rg_collection *rgc, rgc->rigid_groups[rgc->n_rigid_groups++] = rg; } -static void rigid_groups_free(struct detector *det) + +/* Free all rigid groups in detector */ +static void free_all_rigid_groups(struct detector *det) { int i; @@ -832,7 +831,9 @@ static void rigid_groups_free(struct detector *det) free(det->rigid_groups); } -static void rigid_groups_collection_free(struct detector *det) + +/* Free all rigid groups in detector */ +static void free_all_rigid_group_collections(struct detector *det) { int i; @@ -858,7 +859,6 @@ static struct rigid_group *find_rigid_group_by_name(struct detector *det, } return NULL; - } @@ -998,8 +998,8 @@ static int parse_field_bad(struct badregion *panel, const char *key, static void parse_toplevel(struct detector *det, struct beam_params *beam, - const char *key, const char *val, - struct rg_definition ***rg_defl, + const char *key, const char *val, + struct rg_definition ***rg_defl, struct rgc_definition ***rgc_defl, int *n_rg_defs, int *n_rgc_defs) { @@ -1038,8 +1038,9 @@ static void parse_toplevel(struct detector *det, struct beam_params *beam, if ( beam != NULL ) { beam->photon_energy_scale = atof(val); } - } else if (strncmp(key, "rigid_group", 11) == 0 && - strncmp(key, "rigid_group_collection", 22) != 0 ) { + + } else if (strncmp(key, "rigid_group", 11) == 0 + && strncmp(key, "rigid_group_collection", 22) != 0 ) { struct rg_definition **new; @@ -1579,7 +1580,7 @@ out: } free(rg_defl); - for ( rgci=0; rgcin_panels; i++ ) { free(det->panels[i].clen_from); diff --git a/libcrystfel/src/detector.h b/libcrystfel/src/detector.h index 87fcc890..489087ec 100644 --- a/libcrystfel/src/detector.h +++ b/libcrystfel/src/detector.h @@ -81,7 +81,6 @@ struct rg_collection struct panel { - char name[1024]; /* Name for this panel */ /* Position of panel in the data block in memory (see below) */ @@ -238,7 +237,7 @@ extern struct panel *find_panel_by_name(struct detector *det, const char *name); extern int write_detector_geometry(const char *geometry_filename, const char *output_filename, - struct detector *det, + struct detector *det, const char *additional_comment, int write_panel_coffset); diff --git a/libcrystfel/src/stream.c b/libcrystfel/src/stream.c index 3eb1d783..55ff73fe 100644 --- a/libcrystfel/src/stream.c +++ b/libcrystfel/src/stream.c @@ -1148,7 +1148,7 @@ int read_chunk_2(Stream *st, struct image *image, StreamReadFlags srf) } } - if (strncmp(line, "hdf5", 3) == 0 ) { + if ( strncmp(line, "hdf5", 3) == 0 ) { char **new_fields; @@ -1178,7 +1178,6 @@ int read_chunk_2(Stream *st, struct image *image, StreamReadFlags srf) } - if ( (srf & STREAM_READ_PEAKS) && strcmp(line, PEAK_LIST_START_MARKER) == 0 ) { -- cgit v1.2.3