summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJukka Ojanen <jukka.ojanen@linkotec.net>2015-07-06 14:28:45 +0300
committerJukka Ojanen <jukka.ojanen@linkotec.net>2015-07-06 14:28:45 +0300
commita0aa64fdb9a5fcbdf8ad3edfe3f2b1bc4e37c770 (patch)
tree6da24d76d9062d462cdf49838b84ca385509a33b
parent6bf4e36dd29a12136f018c208f830dbaac05f182 (diff)
downloadffts-a0aa64fdb9a5fcbdf8ad3edfe3f2b1bc4e37c770.zip
ffts-a0aa64fdb9a5fcbdf8ad3edfe3f2b1bc4e37c770.tar.gz
To silence warning 'possible loss of data', use explicit casting to float
-rw-r--r--src/ffts_real.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/ffts_real.c b/src/ffts_real.c
index 0dd24d8..f3b5126 100644
--- a/src/ffts_real.c
+++ b/src/ffts_real.c
@@ -361,17 +361,17 @@ ffts_init_1d_real(size_t N, int sign)
if (sign < 0) {
for (i = 0; i < N/2; i++) {
- p->A[2 * i + 0] = 0.5 * ( 1.0 - sin(2.0 * M_PI / (double) N * (double) i));
- p->A[2 * i + 1] = 0.5 * (-1.0 * cos(2.0 * M_PI / (double) N * (double) i));
- p->B[2 * i + 0] = 0.5 * ( 1.0 + sin(2.0 * M_PI / (double) N * (double) i));
- p->B[2 * i + 1] = 0.5 * ( 1.0 * cos(2.0 * M_PI / (double) N * (double) i));
+ p->A[2 * i + 0] = (float) (0.5 * ( 1.0 - sin(2.0 * M_PI / (double) N * (double) i)));
+ p->A[2 * i + 1] = (float) (0.5 * (-1.0 * cos(2.0 * M_PI / (double) N * (double) i)));
+ p->B[2 * i + 0] = (float) (0.5 * ( 1.0 + sin(2.0 * M_PI / (double) N * (double) i)));
+ p->B[2 * i + 1] = (float) (0.5 * ( 1.0 * cos(2.0 * M_PI / (double) N * (double) i)));
}
} else {
for (i = 0; i < N/2; i++) {
- p->A[2 * i + 0] = 1.0 * ( 1.0 - sin(2.0 * M_PI / (double) N * (double) i));
- p->A[2 * i + 1] = 1.0 * (-1.0 * cos(2.0 * M_PI / (double) N * (double) i));
- p->B[2 * i + 0] = 1.0 * ( 1.0 + sin(2.0 * M_PI / (double) N * (double) i));
- p->B[2 * i + 1] = 1.0 * ( 1.0 * cos(2.0 * M_PI / (double) N * (double) i));
+ p->A[2 * i + 0] = (float) (1.0 * ( 1.0 - sin(2.0 * M_PI / (double) N * (double) i)));
+ p->A[2 * i + 1] = (float) (1.0 * (-1.0 * cos(2.0 * M_PI / (double) N * (double) i)));
+ p->B[2 * i + 0] = (float) (1.0 * ( 1.0 + sin(2.0 * M_PI / (double) N * (double) i)));
+ p->B[2 * i + 1] = (float) (1.0 * ( 1.0 * cos(2.0 * M_PI / (double) N * (double) i)));
}
}
OpenPOWER on IntegriCloud