shithub: aubio

Download patch

ref: 23493b5899b2e52a43362b2945cd301b573d2857
parent: 69f74f001cc87e957b49aedec8ccd71a944f18bd
author: Paul Brossier <piem@piem.org>
date: Thu Apr 21 15:11:55 EDT 2016

src/temporal/: add const qualifiers

--- a/src/temporal/filter.c
+++ b/src/temporal/filter.c
@@ -39,7 +39,7 @@
 };
 
 void
-aubio_filter_do_outplace (aubio_filter_t * f, fvec_t * in, fvec_t * out)
+aubio_filter_do_outplace (aubio_filter_t * f, const fvec_t * in, fvec_t * out)
 {
   fvec_copy (in, out);
   aubio_filter_do (f, out);
@@ -93,25 +93,25 @@
 }
 
 lvec_t *
-aubio_filter_get_feedback (aubio_filter_t * f)
+aubio_filter_get_feedback (const aubio_filter_t * f)
 {
   return f->a;
 }
 
 lvec_t *
-aubio_filter_get_feedforward (aubio_filter_t * f)
+aubio_filter_get_feedforward (const aubio_filter_t * f)
 {
   return f->b;
 }
 
 uint_t
-aubio_filter_get_order (aubio_filter_t * f)
+aubio_filter_get_order (const aubio_filter_t * f)
 {
   return f->order;
 }
 
 uint_t
-aubio_filter_get_samplerate (aubio_filter_t * f)
+aubio_filter_get_samplerate (const aubio_filter_t * f)
 {
   return f->samplerate;
 }
--- a/src/temporal/filter.h
+++ b/src/temporal/filter.h
@@ -86,7 +86,7 @@
   \param out output vector to store filtered input
 
 */
-void aubio_filter_do_outplace (aubio_filter_t * f, fvec_t * in, fvec_t * out);
+void aubio_filter_do_outplace (aubio_filter_t * f, const fvec_t * in, fvec_t * out);
 
 /** filter input vector forward and backward
 
@@ -104,7 +104,7 @@
   \return a pointer to the \f$ a_0 ... a_i ... a_P \f$ coefficients
 
 */
-lvec_t *aubio_filter_get_feedback (aubio_filter_t * f);
+lvec_t *aubio_filter_get_feedback (const aubio_filter_t * f);
 
 /** returns a pointer to feedforward coefficients \f$ b_i \f$
 
@@ -113,7 +113,7 @@
   \return a pointer to the \f$ b_0 ... b_i ... b_P \f$ coefficients
 
 */
-lvec_t *aubio_filter_get_feedforward (aubio_filter_t * f);
+lvec_t *aubio_filter_get_feedforward (const aubio_filter_t * f);
 
 /** get order of the filter
 
@@ -122,7 +122,7 @@
   \return the order of the filter
 
 */
-uint_t aubio_filter_get_order (aubio_filter_t * f);
+uint_t aubio_filter_get_order (const aubio_filter_t * f);
 
 /** get sampling rate of the filter
 
@@ -131,7 +131,7 @@
   \return the sampling rate of the filter, in Hz
 
 */
-uint_t aubio_filter_get_samplerate (aubio_filter_t * f);
+uint_t aubio_filter_get_samplerate (const aubio_filter_t * f);
 
 /** get sampling rate of the filter
 
--- a/src/temporal/resampler.c
+++ b/src/temporal/resampler.c
@@ -61,7 +61,7 @@
 }
 
 void
-aubio_resampler_do (aubio_resampler_t * s, fvec_t * input, fvec_t * output)
+aubio_resampler_do (aubio_resampler_t * s, const fvec_t * input, fvec_t * output)
 {
   s->proc->input_frames = input->length;
   s->proc->output_frames = output->length;
@@ -92,7 +92,7 @@
 }
 
 void
-aubio_resampler_do (aubio_resampler_t * s UNUSED, fvec_t * input UNUSED, fvec_t * output UNUSED)
+aubio_resampler_do (aubio_resampler_t * s UNUSED, const fvec_t * input UNUSED, fvec_t * output UNUSED)
 {
 }
 #endif /* HAVE_SAMPLERATE */
--- a/src/temporal/resampler.h
+++ b/src/temporal/resampler.h
@@ -55,7 +55,7 @@
   \param output output buffer of size N*ratio
 
 */
-void aubio_resampler_do (aubio_resampler_t * s, fvec_t * input,
+void aubio_resampler_do (aubio_resampler_t * s, const fvec_t * input,
     fvec_t * output);
 
 #ifdef __cplusplus