From e295e00053fff65f53e45ebb6b149d65225d04a8 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 8 Aug 2012 11:59:46 +0200 Subject: Fix buglets spotted by new compiler on Fedora 17 --- src/check_hkl.c | 4 ---- src/compare_hkl.c | 6 ------ src/dw-hdfsee.c | 12 ++++-------- src/get_hkl.c | 4 +--- src/im-sandbox.c | 3 +-- src/powder_plot.c | 4 ++-- src/process_hkl.c | 7 +------ 7 files changed, 9 insertions(+), 31 deletions(-) (limited to 'src') diff --git a/src/check_hkl.c b/src/check_hkl.c index fbc29f00..a1688ad2 100644 --- a/src/check_hkl.c +++ b/src/check_hkl.c @@ -68,8 +68,6 @@ static void show_help(const char *s) static void plot_shells(RefList *list, UnitCell *cell, const SymOpList *sym, double rmin_fix, double rmax_fix) { - double num[NBINS]; - int cts[NBINS]; int possible[NBINS]; unsigned int measurements[NBINS]; unsigned int measured[NBINS]; @@ -104,8 +102,6 @@ static void plot_shells(RefList *list, UnitCell *cell, const SymOpList *sym, } for ( i=0; ipixbufs != NULL ) { int i; for ( i=0; in_pixbufs; i++ ) { - gdk_pixbuf_unref(dw->pixbufs[i]); + g_object_unref(dw->pixbufs[i]); } free(dw->pixbufs); } if ( dw->col_scale != NULL ) { - gdk_pixbuf_unref(dw->col_scale); + g_object_unref(dw->col_scale); } if ( dw->image != NULL ) { @@ -189,12 +189,8 @@ static void show_ring(cairo_t *cr, DisplayWindow *dw, static void show_simple_ring(cairo_t *cr, DisplayWindow *dw, double d, cairo_matrix_t *basic_m) { - struct detector *det; - if ( !dw->use_geom ) return; - det = dw->image->det; - cairo_identity_matrix(cr); cairo_translate(cr, -dw->min_x/dw->binning, dw->max_y/dw->binning); @@ -431,7 +427,7 @@ static void set_window_size(DisplayWindow *dw) static void update_colscale(DisplayWindow *dw) { if ( dw->col_scale != NULL ) { - gdk_pixbuf_unref(dw->col_scale); + g_object_unref(dw->col_scale); } dw->col_scale = render_get_colour_scale(20, dw->height, dw->scale); } @@ -446,7 +442,7 @@ static void displaywindow_update(DisplayWindow *dw) if ( dw->pixbufs != NULL ) { int i; for ( i=0; in_pixbufs; i++ ) { - gdk_pixbuf_unref(dw->pixbufs[i]); + g_object_unref(dw->pixbufs[i]); } free(dw->pixbufs); } diff --git a/src/get_hkl.c b/src/get_hkl.c index e298680d..00de38a5 100644 --- a/src/get_hkl.c +++ b/src/get_hkl.c @@ -270,10 +270,8 @@ static RefList *expand_reflections(RefList *in, const SymOpList *target, signed int h, k, l; int n, j; - double intensity; get_indices(refl, &h, &k, &l); - intensity = get_intensity(refl); special_position(initial, m, h, k, l); n = num_equivs(initial, m); @@ -298,7 +296,7 @@ static RefList *expand_reflections(RefList *in, const SymOpList *target, /* FIXME: Make phase negative if the reflection is * separated from the original via an inversion */ - get_phase(refl, &have_phase); + ph = get_phase(refl, &have_phase); if ( have_phase ) set_phase(new, -ph); } diff --git a/src/im-sandbox.c b/src/im-sandbox.c index fdbbf3a3..c9ad5300 100644 --- a/src/im-sandbox.c +++ b/src/im-sandbox.c @@ -840,7 +840,6 @@ void create_sandbox(struct index_args *iargs, int n_proc, char *prefix, char results[1024]; char *rval; int fd; - int n; char *eptr; if ( !sb->running[i] ) { @@ -863,7 +862,7 @@ void create_sandbox(struct index_args *iargs, int n_proc, char *prefix, chomp(results); - n = strtol(results, &eptr, 10); + strtol(results, &eptr, 10); if ( eptr == results ) { if ( strlen(results) > 0 ) { ERROR("Invalid result '%s'\n", results); diff --git a/src/powder_plot.c b/src/powder_plot.c index 049b9c0e..84f292a3 100644 --- a/src/powder_plot.c +++ b/src/powder_plot.c @@ -725,7 +725,7 @@ int main(int argc, char *argv[]) unsigned int n_patterns = 0; unsigned int n_peaks = 0; - int c, rval, file_type, data_type; + int c, file_type, data_type; int config_satcorr = 1; int need_geometry = 0; int need_beam = 0; @@ -953,7 +953,7 @@ int main(int argc, char *argv[]) return 1; } /* Use wavelength from first chunk */ - rval = read_chunk(fh, &image); + read_chunk(fh, &image); rewind(fh); } else if (file_type == FILE_H5) { hdfile = hdfile_open(filename); diff --git a/src/process_hkl.c b/src/process_hkl.c index e06270bc..28d54360 100644 --- a/src/process_hkl.c +++ b/src/process_hkl.c @@ -356,7 +356,6 @@ int main(int argc, char *argv[]) unsigned int n_total_patterns; char *sym_str = NULL; SymOpList *sym; - char *pdb = NULL; char *histo = NULL; signed int hist_h, hist_k, hist_l; signed int hist_nbins=50; @@ -387,7 +386,7 @@ int main(int argc, char *argv[]) }; /* Short options */ - while ((c = getopt_long(argc, argv, "hi:e:o:p:y:g:f:b:z:", + while ((c = getopt_long(argc, argv, "hi:e:o:y:g:f:b:z:", longopts, NULL)) != -1) { switch (c) { @@ -411,10 +410,6 @@ int main(int argc, char *argv[]) config_startafter = atoi(optarg); break; - case 'p' : - pdb = strdup(optarg); - break; - case 'y' : sym_str = strdup(optarg); break; -- cgit v1.2.3