Permalink
Browse files

Merge pull request #330 from rgommers/ticket-1737-llvmgcc-fftpack

BUG: fix segfault in fftpack on OS X >=10.7 when compiling with llvm-gcc...
  • Loading branch information...
2 parents 1aee114 + 61fbbb6 commit bb436fa2644d7217d2d6ed11e7ec57129e7bb5b6 @rgommers rgommers committed Oct 30, 2012
Showing with 6 additions and 4 deletions.
  1. +6 −4 scipy/fftpack/src/zfft.c
View
@@ -57,8 +57,9 @@ void zfft(complex_double * inout, int n, int direction, int howmany,
if (normalize) {
ptr = inout;
for (i = n * howmany - 1; i >= 0; --i) {
- *((double *) (ptr)) /= n;
- *((double *) (ptr++) + 1) /= n;
+ ptr->r /= n;
+ ptr->i /= n;
+ ptr++;
}
}
}
@@ -92,8 +93,9 @@ void cfft(complex_float * inout, int n, int direction, int howmany,
if (normalize) {
ptr = inout;
for (i = n * howmany - 1; i >= 0; --i) {
- *((float *) (ptr)) /= n;
- *((float *) (ptr++) + 1) /= n;
+ ptr->r /= n;
+ ptr->i /= n;
+ ptr++;
}
}
}

0 comments on commit bb436fa

Please sign in to comment.