aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/diffraction.cl4
-rw-r--r--src/cell.c2
-rw-r--r--src/image.h1
3 files changed, 4 insertions, 3 deletions
diff --git a/data/diffraction.cl b/data/diffraction.cl
index 63d807c2..a42cfc93 100644
--- a/data/diffraction.cl
+++ b/data/diffraction.cl
@@ -117,14 +117,14 @@ float2 get_sfac(global float2 *sfacs, float16 cell, float4 q)
/* Return a silly value if indices are out of range */
if ( (abs(h) > INDMAX) || (abs(k) > INDMAX) || (abs(l) > INDMAX) ) {
- return 100000.0;
+ return (float2)(100000.0, 0.0);
}
h = (h>=0) ? h : h+IDIM;
k = (k>=0) ? k : k+IDIM;
l = (l>=0) ? l : l+IDIM;
- if ( (h>=IDIM) || (k>=IDIM) || (l>=IDIM) ) return 100000.0;
+ if ( (h>=IDIM) || (k>=IDIM) || (l>=IDIM) ) return (float2)(100000.0, 0.0);
idx = h + (IDIM*k) + (IDIM*IDIM*l);
diff --git a/src/cell.c b/src/cell.c
index c564c3b5..5747ed63 100644
--- a/src/cell.c
+++ b/src/cell.c
@@ -401,7 +401,7 @@ UnitCell *match_cell(UnitCell *cell, UnitCell *template, int verbose)
double angles[3];
struct cvec *cand[3];
UnitCell *new_cell = NULL;
- float best_fom = +HUGE_VALF;
+ float best_fom = +999999999.9; /* Large number.. */
int ncand[3] = {0,0,0};
float ltl = 5.0; /* percent */
float angtol = deg2rad(5.0);
diff --git a/src/image.h b/src/image.h
index 5159d63e..5715d570 100644
--- a/src/image.h
+++ b/src/image.h
@@ -19,6 +19,7 @@
#include <stdint.h>
#include <complex.h>
+#include <sys/types.h>
#include "utils.h"
#include "cell.h"