Commit e295e000 authored by Thomas White's avatar Thomas White
Browse files

Fix buglets spotted by new compiler on Fedora 17

parent 7903f6c3
......@@ -895,7 +895,7 @@ UnitCell *match_cell_ab(UnitCell *cell, UnitCell *template)
int used[3];
struct rvec real_a, real_b, real_c;
struct rvec params[3];
double alen, blen, clen;
double alen, blen;
float ltl = 5.0; /* percent */
int have_real_a;
int have_real_b;
......@@ -911,7 +911,6 @@ UnitCell *match_cell_ab(UnitCell *cell, UnitCell *template)
}
alen = modulus(ax, ay, az);
blen = modulus(bx, by, bz);
clen = modulus(cx, cy, cz);
/* Get the lengths from the cell and turn them into anonymous vectors */
if ( cell_get_cartesian(cell, &ax, &ay, &az,
......
......@@ -750,7 +750,6 @@ struct detector *get_detector_geometry(const char *filename)
char line[1024];
struct badregion *badregion = NULL;
struct panel *panel = NULL;
char *key;
char wholeval[1024];
rval = fgets(line, 1023, fh);
......@@ -802,8 +801,6 @@ struct detector *get_detector_geometry(const char *filename)
}
}
key = path[1];
if ( panel != NULL ) {
if ( parse_field_for_panel(panel, path[1],
wholeval, det) )
......
......@@ -467,7 +467,6 @@ static void find_candidates(struct reax_private *p,
const char *rg, struct detector *det)
{
int i;
double th, ph;
for ( i=0; i<s->n_search; i++ ) {
s->search[i].cand = calloc(MAX_CANDIDATES,
......@@ -475,7 +474,6 @@ static void find_candidates(struct reax_private *p,
s->search[i].n_cand = 0;
}
th = 0.0; ph = 0.0;
for ( i=0; i<p->n_dir; i++ ) {
check_dir(&p->directions[i], flist,
p->nel, pmax, fft_in, fft_out, p->plan,
......@@ -492,7 +490,10 @@ static void find_candidates(struct reax_private *p,
int j;
sv = &s->search[i];
refine_vector(flist, &sv->cand[j].v);
for ( j=0; j<sv->n_cand; j++ ) {
refine_vector(flist, &sv->cand[j].v);
}
}
......@@ -593,7 +594,6 @@ static void refine_rigid_group(struct image *image, UnitCell *cell,
double bx, by, bz, mb;
double cx, cy, cz, mc;
double pha, phb, phc;
struct panel *p;
int i, j;
fftw_complex *r_fft_in;
fftw_complex *r_fft_out;
......@@ -618,13 +618,6 @@ static void refine_rigid_group(struct image *image, UnitCell *cell,
pr->nel, pmax, fft_in, fft_out, plan,
smin, smax, rg, det);
for ( i=0; i<det->n_panels; i++ ) {
if ( det->panels[i].rigid_group == rg ) {
p = &det->panels[i];
break;
}
}
r_fft_in = fftw_malloc(pr->cw*pr->ch*sizeof(fftw_complex));
r_fft_out = fftw_malloc(pr->cw*pr->ch*sizeof(fftw_complex));
for ( i=0; i<pr->cw; i++ ) {
......
......@@ -335,7 +335,6 @@ int read_chunk(FILE *fh, struct image *image)
int have_bs = 0;
int have_cs = 0;
int have_filename = 0;
int have_cell = 0;
int have_ev = 0;
if ( find_start_of_chunk(fh) ) return 1;
......@@ -410,7 +409,6 @@ int read_chunk(FILE *fh, struct image *image)
image->indexed_cell = cell_new_from_reciprocal_axes(as,
bs,
cs);
have_cell = 1;
have_as = 0; have_bs = 0; have_cs = 0;
}
......
......@@ -1275,8 +1275,7 @@ SymOpList *get_ambiguities(const SymOpList *source, const SymOpList *target)
SymOpList *src_reordered;
SymOpMask *used;
char *name;
int index;
n_src = num_ops(source);
n_tgt = num_ops(target);
......@@ -1290,8 +1289,7 @@ SymOpList *get_ambiguities(const SymOpList *source, const SymOpList *target)
ERROR("Subgroup index would be fractional.\n");
return NULL;
}
index = n_src / n_tgt;
src_reordered = new_symoplist();
used = new_symopmask(source);
......
......@@ -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; i<NBINS; i++ ) {
num[i] = 0.0;
cts[i] = 0;
possible[i] = 0;
measured[i] = 0;
snr_measured[i] = 0;
......
......@@ -96,12 +96,9 @@ static void plot_shells(RefList *list1, RefList *list2, double scale,
{
double num[NBINS];
int cts[NBINS];
unsigned int measurements[NBINS];
unsigned int measured[NBINS];
double total_vol, vol_per_shell;
double rmins[NBINS];
double rmaxs[NBINS];
double snr[NBINS];
double rmin, rmax;
int i;
Reflection *refl1;
......@@ -119,9 +116,6 @@ static void plot_shells(RefList *list1, RefList *list2, double scale,
num[i] = 0.0;
den[i] = 0.0;
cts[i] = 0;
measured[i] = 0;
measurements[i] = 0;
snr[i] = 0;
}
/* Find resolution limits */
......
......@@ -77,13 +77,13 @@ static gint displaywindow_closed(GtkWidget *window, DisplayWindow *dw)
if ( dw->pixbufs != NULL ) {
int i;
for ( i=0; i<dw->n_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; i<dw->n_pixbufs; i++ ) {
gdk_pixbuf_unref(dw->pixbufs[i]);
g_object_unref(dw->pixbufs[i]);
}
free(dw->pixbufs);
}
......
......@@ -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);
}
......
......@@ -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);
......
......@@ -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);
......
......@@ -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;
......
......@@ -225,10 +225,6 @@ static int test_gradients(struct image *image, double incr_val, int refine,
double r1, r2, p;
int cl, ch;
double tt, dstar;
dstar = 2.0 * resolution(image->indexed_cell, h, k, l),
tt = 2.0*asin(image->lambda/(2.0/dstar));
grad1 = (vals[1][i] - vals[0][i]) / incr_val;
grad2 = (vals[2][i] - vals[1][i]) / incr_val;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment