changeset 155:21c5ad2a812e

Add explicit casts to malloc() calls for C++ compatibility
author Jamie Bullock <jamie@jamiebullock.com>
date Thu, 14 Mar 2013 13:03:12 +0000
parents 826eb46b2f91
children 32b78d95f7fd
files examples/simpletest/simpletest.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/examples/simpletest/simpletest.c	Thu Jan 10 22:41:03 2013 +0000
+++ b/examples/simpletest/simpletest.c	Thu Mar 14 13:03:12 2013 +0000
@@ -71,10 +71,10 @@
 
     /* compute the MFCCs */
     mel_filters.n_filters = MFCC_FREQ_BANDS;
-    mel_filters.filters   = malloc(MFCC_FREQ_BANDS * sizeof(double *));
+    mel_filters.filters   = (double **)malloc(MFCC_FREQ_BANDS * sizeof(double *));
     for(n = 0; n < MFCC_FREQ_BANDS; ++n)
     {
-        mel_filters.filters[n] = malloc(BLOCKSIZE * sizeof(double));
+        mel_filters.filters[n] = (double *)malloc(BLOCKSIZE * sizeof(double));
     }
 
     xtract_init_mfcc(BLOCKSIZE >> 1, SAMPLERATE >> 1, XTRACT_EQUAL_GAIN, MFCC_FREQ_MIN, MFCC_FREQ_MAX, mel_filters.n_filters, mel_filters.filters);