diff options
author | Jukka Ojanen <jukka.ojanen@linkotec.net> | 2015-07-06 14:28:45 +0300 |
---|---|---|
committer | Jukka Ojanen <jukka.ojanen@linkotec.net> | 2015-07-06 14:28:45 +0300 |
commit | a0aa64fdb9a5fcbdf8ad3edfe3f2b1bc4e37c770 (patch) | |
tree | 6da24d76d9062d462cdf49838b84ca385509a33b | |
parent | 6bf4e36dd29a12136f018c208f830dbaac05f182 (diff) | |
download | ffts-a0aa64fdb9a5fcbdf8ad3edfe3f2b1bc4e37c770.zip ffts-a0aa64fdb9a5fcbdf8ad3edfe3f2b1bc4e37c770.tar.gz |
To silence warning 'possible loss of data', use explicit casting to float
-rw-r--r-- | src/ffts_real.c | 16 |
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))); } } |