aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2009-11-19 16:42:29 +0100
committerThomas White <taw@physics.org>2009-11-19 16:42:29 +0100
commit377810c338e2f84d0ebc4b44086eb8ecf5f6741d (patch)
tree23881e8c3ada29a19f6e480d64e3d8c4886fc2c1
parentbee783eed9fcbcfa6b0d5be0bb98709757261b7a (diff)
Add explicit casts when converting types
-rw-r--r--src/detector.c4
-rw-r--r--src/utils.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/detector.c b/src/detector.c
index 6ca5e8e7..8467a322 100644
--- a/src/detector.c
+++ b/src/detector.c
@@ -125,7 +125,7 @@ static uint16_t *bloom(double *hdr_in, int width, int height)
/* Turn into integer array of counts */
for ( x=0; x<width; x++ ) {
for ( y=0; y<height; y++ ) {
- data[x + width*y] = tmp[x + width*y];
+ data[x + width*y] = (uint16_t)tmp[x + width*y];
}
}
@@ -163,7 +163,7 @@ void record_image(struct image *image)
double complex val;
val = image->sfacs[x + image->width*y];
- intensity = val * conj(val);
+ intensity = (double)(val * conj(val));
/* What solid angle is subtended by this pixel? */
sa = sa_per_pixel * cos(image->twotheta[x + image->width*y]);
diff --git a/src/utils.c b/src/utils.c
index 2868ef08..e33defd4 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -166,7 +166,7 @@ void progress_bar(int val, int total)
char s[1024];
frac = (double)val/total;
- n = frac*80;
+ n = (int)(frac*80);
for ( i=0; i<n; i++ ) s[i] = '=';
for ( i=n; i<80; i++ ) s[i] = '.';