aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2014-11-10 19:09:49 +0100
committerThomas White <taw@physics.org>2014-11-10 19:09:49 +0100
commit35ab2f314a551568ca2db485bba1199bb67148f5 (patch)
treeeb466c8a46935307a15bcbd1ca3fd065a7bb3357
parente3135a2154b1aa1c137664030972a09e50b7f1d8 (diff)
Fussiness
-rw-r--r--libcrystfel/src/detector.c20
-rw-r--r--libcrystfel/src/detector.h3
-rw-r--r--libcrystfel/src/stream.c3
-rw-r--r--src/dw-hdfsee.c10
-rw-r--r--src/dw-hdfsee.h8
5 files changed, 26 insertions, 18 deletions
diff --git a/libcrystfel/src/detector.c b/libcrystfel/src/detector.c
index 39a84b6c..f220d755 100644
--- a/libcrystfel/src/detector.c
+++ b/libcrystfel/src/detector.c
@@ -1604,10 +1604,10 @@ void get_pixel_extents(struct detector *det,
}
-int write_detector_geometry(const char* geometry_filename,
+int write_detector_geometry(const char *geometry_filename,
const char *output_filename, struct detector *det)
{
- FILE *ifh;
+ FILE *ifh;
FILE *fh;
if ( geometry_filename == NULL ) return 2;
@@ -1641,13 +1641,21 @@ int write_detector_geometry(const char* geometry_filename,
p = find_panel_by_name(det, bits[0]);
if ( strncmp(bits[1], "fs = ", 5) == 0) {
- fprintf(fh, "%s/fs = %+fx %+fy\n", p->name, p->fsx, p->fsy);
+ fprintf(fh, "%s/fs = %+fx %+fy\n",
+ p->name, p->fsx, p->fsy);
+
} else if ( strncmp(bits[1], "ss = ", 5) == 0) {
- fprintf(fh, "%s/ss = %+fx %+fy\n", p->name, p->ssx, p->ssy);
+ fprintf(fh, "%s/ss = %+fx %+fy\n",
+ p->name, p->ssx, p->ssy);
+
} else if ( strncmp(bits[1], "corner_x = ", 11) == 0) {
- fprintf(fh, "%s/corner_x = %g\n", p->name, p->cnx);
+ fprintf(fh, "%s/corner_x = %g\n",
+ p->name, p->cnx);
+
} else if ( strncmp(bits[1], "corner_y = ", 11) == 0) {
- fprintf(fh, "%s/corner_y = %g\n", p->name, p->cny);
+ fprintf(fh, "%s/corner_y = %g\n",
+ p->name, p->cny);
+
} else {
fputs(line, fh);
}
diff --git a/libcrystfel/src/detector.h b/libcrystfel/src/detector.h
index 2cec61c2..9db695d9 100644
--- a/libcrystfel/src/detector.h
+++ b/libcrystfel/src/detector.h
@@ -222,7 +222,8 @@ extern double smallest_q(struct image *image);
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);
+ const char *output_filename,
+ struct detector *det);
extern void mark_resolution_range_as_bad(struct image *image,
diff --git a/libcrystfel/src/stream.c b/libcrystfel/src/stream.c
index 988570bc..dfa1bebe 100644
--- a/libcrystfel/src/stream.c
+++ b/libcrystfel/src/stream.c
@@ -266,12 +266,11 @@ static RefList *read_stream_reflections_2_3(FILE *fh, struct detector *det)
double ph;
char *v;
struct panel *p;
- float write_fs = 0;
- float write_ss = 0;
refl = add_refl(out, h, k, l);
set_intensity(refl, intensity);
if ( det != NULL ) {
+ double write_fs, write_ss;
p = find_panel_by_name(det,pn);
write_fs = fs - p->orig_min_fs + p->min_fs;
write_ss = ss - p->orig_min_ss + p->min_ss;
diff --git a/src/dw-hdfsee.c b/src/dw-hdfsee.c
index e9b6ee86..4bb60b8d 100644
--- a/src/dw-hdfsee.c
+++ b/src/dw-hdfsee.c
@@ -1176,7 +1176,7 @@ static gint displaywindow_about(GtkWidget *widget, DisplayWindow *dw)
static int save_geometry_file(DisplayWindow *dw)
{
GtkWidget *d;
- gchar * output_filename;
+ gchar *output_filename;
int w;
d = gtk_file_chooser_dialog_new("Save Detector Geometry",
@@ -1186,10 +1186,10 @@ static int save_geometry_file(DisplayWindow *dw)
GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
NULL);
- gtk_dialog_run (GTK_DIALOG (d));
+ gtk_dialog_run(GTK_DIALOG(d));
output_filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER (d));
w = write_detector_geometry(dw->geom_filename, output_filename,
- dw->image->det);
+ dw->image->det);
gtk_widget_destroy(d);
g_free(output_filename);
return w;
@@ -2538,7 +2538,6 @@ DisplayWindow *displaywindow_open(char *filename, char *geom_filename,
}
if ( check ) {
ERROR("Couldn't load file\n");
- free(dw->geom_filename);
hdfile_close(dw->hdfile);
free(dw->geom_filename);
return NULL;
@@ -2626,7 +2625,8 @@ DisplayWindow *displaywindow_open(char *filename, char *geom_filename,
displaywindow_update_menus(dw, element);
} else {
if ( dw->multi_event != 0 ) {
- displaywindow_update_event_menu(dw, dw->ev_list, dw->curr_event);
+ displaywindow_update_event_menu(dw, dw->ev_list,
+ dw->curr_event);
}
}
diff --git a/src/dw-hdfsee.h b/src/dw-hdfsee.h
index 14c17287..b7a49462 100644
--- a/src/dw-hdfsee.h
+++ b/src/dw-hdfsee.h
@@ -3,12 +3,12 @@
*
* Quick yet non-crappy HDF viewer
*
- * Copyright © 2012 Deutsches Elektronen-Synchrotron DESY,
- * a research centre of the Helmholtz Association.
+ * Copyright © 2012-2014 Deutsches Elektronen-Synchrotron DESY,
+ * a research centre of the Helmholtz Association.
* Copyright © 2012 Richard Kirian
*
* Authors:
- * 2009-2012 Thomas White <taw@physics.org>
+ * 2009-2014 Thomas White <taw@physics.org>
* 2014 Valerio Mariani
* 2014 Takanori Nakane <nakane.t@gmail.com>
* 2012 Richard Kirian
@@ -90,7 +90,7 @@ typedef struct {
int not_ready_yet;
- struct detector* simple_geom;
+ struct detector *simple_geom;
struct hdfile *hdfile;
struct image *image;