[examples] remove unneeded cast
[aubio.git] / examples / aubiomfcc.c
index d8bb910..f333d63 100644 (file)
@@ -48,6 +48,7 @@ void process_print (void)
 }
 
 int main(int argc, char **argv) {
+  int ret = 0;
   // change some default params
   buffer_size  = 512;
   hop_size = 256;
@@ -62,15 +63,19 @@ int main(int argc, char **argv) {
   fftgrain = new_cvec (buffer_size);
   mfcc = new_aubio_mfcc(buffer_size, n_filters, n_coefs, samplerate);
   mfcc_out = new_fvec(n_coefs);
+  if (pv == NULL || fftgrain == NULL || mfcc == NULL || mfcc_out == NULL) {
+    ret = 1;
+    goto beach;
+  }
 
-  examples_common_process((aubio_process_func_t)process_block, process_print);
+  examples_common_process(process_block, process_print);
 
   del_aubio_pvoc (pv);
   del_cvec (fftgrain);
   del_aubio_mfcc(mfcc);
   del_fvec(mfcc_out);
 
+beach:
   examples_common_del();
-  return 0;
+  return ret;
 }
-