comparison examples/simpletest/simpletest.c @ 156:32b78d95f7fd

Remove erroneous casts to void * in xtract() function calls
author Jamie Bullock <jamie@jamiebullock.com>
date Fri, 15 Mar 2013 10:29:08 +0000
parents 21c5ad2a812e
children 19e5ef005bdb
comparison
equal deleted inserted replaced
155:21c5ad2a812e 156:32b78d95f7fd
48 { 48 {
49 input[n] = ((n % PERIOD) / (double)PERIOD) - .5; 49 input[n] = ((n % PERIOD) / (double)PERIOD) - .5;
50 } 50 }
51 51
52 /* get the mean of the input */ 52 /* get the mean of the input */
53 xtract[XTRACT_MEAN]((void *)&input, BLOCKSIZE, NULL, (void *)&mean); 53 xtract[XTRACT_MEAN](input, BLOCKSIZE, NULL, &mean);
54 printf("\nInput mean = %.2f\n\n", mean); 54 printf("\nInput mean = %.2f\n\n", mean);
55 55
56 /* get the spectrum */ 56 /* get the spectrum */
57 argd[0] = SAMPLERATE / (double)BLOCKSIZE; 57 argd[0] = SAMPLERATE / (double)BLOCKSIZE;
58 argd[1] = XTRACT_MAGNITUDE_SPECTRUM; 58 argd[1] = XTRACT_MAGNITUDE_SPECTRUM;
59 argd[2] = 0.f; /* No DC component */ 59 argd[2] = 0.f; /* No DC component */
60 argd[3] = 0.f; /* No Normalisation */ 60 argd[3] = 0.f; /* No Normalisation */
61 61
62 xtract_init_fft(BLOCKSIZE, XTRACT_SPECTRUM); 62 xtract_init_fft(BLOCKSIZE, XTRACT_SPECTRUM);
63 xtract[XTRACT_SPECTRUM]((void *)&input, BLOCKSIZE, &argd[0], (void *)&spectrum[0]); 63 xtract[XTRACT_SPECTRUM](input, BLOCKSIZE, &argd[0], spectrum);
64 64
65 /* print the spectral bins */ 65 /* print the spectral bins */
66 printf("\nSpectral bins:\n"); 66 printf("\nSpectral bins:\n");
67 for(n = 0; n < (BLOCKSIZE >> 1); ++n){ 67 for(n = 0; n < (BLOCKSIZE >> 1); ++n){
68 printf("freq: %.1f\tamp: %.6f\n", spectrum[n + (BLOCKSIZE >> 1)], spectrum[n]); 68 printf("freq: %.1f\tamp: %.6f\n", spectrum[n + (BLOCKSIZE >> 1)], spectrum[n]);