From 7d6f1c3261973ec8d8b2d9f289277f1693cf3cd9 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 17 Nov 2009 13:36:07 +0100 Subject: Tidy up (makes icc happier) --- src/diffraction.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/diffraction.c') diff --git a/src/diffraction.c b/src/diffraction.c index 9fcde28b..a4a03b64 100644 --- a/src/diffraction.c +++ b/src/diffraction.c @@ -62,7 +62,7 @@ static double lattice_factor(struct threevec q, double ax, double ay, double az, /* Look up f1 and f2 for this atom at this energy (in J/photon) */ -static complex get_sfac(const char *n, double en) +static double complex get_sfac(const char *n, double en) { FILE *fh; char filename[64]; @@ -104,7 +104,7 @@ static complex get_sfac(const char *n, double en) last_f2 = f2; } else { - double f; + float f; float actual_f1, actual_f2; f = (en - last_E) / (E - last_E); @@ -128,8 +128,8 @@ static complex get_sfac(const char *n, double en) } -static complex molecule_factor(struct molecule *mol, struct threevec q, - double en) +static double complex molecule_factor(struct molecule *mol, struct threevec q, + double en) { int i; double F = 0.0; @@ -183,7 +183,7 @@ static struct molecule *load_molecule() do { char el[4]; - int i, r; + int j, r; int done = 0; float x, y, z, occ, B; char *coords; @@ -211,24 +211,23 @@ static struct molecule *load_molecule() abort(); } - for ( i=0; in_species; i++ ) { + for ( j=0; jn_species; j++ ) { struct mol_species *spec; int n; - spec = mol->species[i]; + spec = mol->species[j]; if ( strcmp(spec->species, el) != 0 ) continue; - - n = mol->species[i]->n_atoms; + n = mol->species[j]->n_atoms; spec->x[n] = x; spec->y[n] = y; spec->z[n] = z; spec->occ[n] = occ; spec->B[n] = B; - mol->species[i]->n_atoms++; + mol->species[j]->n_atoms++; done = 1; @@ -285,13 +284,14 @@ void get_diffraction(struct image *image, UnitCell *cell) &bx, &by, &bz, &cx, &cy, &cz); - image->sfacs = malloc(image->width * image->height * sizeof(complex)); + image->sfacs = malloc(image->width * image->height + * sizeof(double complex)); for ( x=0; xwidth; x++ ) { for ( y=0; yheight; y++ ) { double f_lattice; - complex f_molecule; + double complex f_molecule; struct threevec q; q = image->qvecs[x + image->width*y]; -- cgit v1.2.3