shithub: aubio

Download patch

ref: 55d1fa4a8e6a7dac222190203dd6937a1ee2341c
parent: e9bd0228f178ad25912784a0e45031c2463a4fc6
author: Paul Brossier <piem@piem.org>
date: Thu Apr 21 15:08:17 EDT 2016

src/utils/: add const qualifiers

--- a/src/utils/hist.c
+++ b/src/utils/hist.c
@@ -137,7 +137,7 @@
   }
 }
 
-smpl_t aubio_hist_mean (aubio_hist_t *s) {
+smpl_t aubio_hist_mean (const aubio_hist_t *s) {
   uint_t j;
   smpl_t tmp = 0.0;
   for (j=0; j < s->nelems; j++)
--- a/src/utils/hist.h
+++ b/src/utils/hist.h
@@ -50,7 +50,7 @@
 /** compute the histogram ignoring null elements */
 void aubio_hist_do_notnull(aubio_hist_t *s, fvec_t * input);
 /** compute the mean of the histogram */
-smpl_t aubio_hist_mean(aubio_hist_t *s);
+smpl_t aubio_hist_mean(const aubio_hist_t *s);
 /** weight the histogram */
 void aubio_hist_weight(aubio_hist_t *s);
 /** compute dynamic histogram for non-null elements */
--- a/src/utils/parameter.c
+++ b/src/utils/parameter.c
@@ -84,7 +84,7 @@
   return err;
 }
 
-smpl_t aubio_parameter_get_current_value ( aubio_parameter_t * s )
+smpl_t aubio_parameter_get_current_value ( const aubio_parameter_t * s )
 {
   return s->current_value;
 }
@@ -109,7 +109,7 @@
   return AUBIO_OK;
 }
 
-uint_t aubio_parameter_get_steps ( aubio_parameter_t * param )
+uint_t aubio_parameter_get_steps ( const aubio_parameter_t * param )
 {
   return param->steps;
 }
@@ -120,7 +120,7 @@
   return AUBIO_OK;
 }
 
-smpl_t aubio_parameter_get_min_value ( aubio_parameter_t * param )
+smpl_t aubio_parameter_get_min_value ( const aubio_parameter_t * param )
 {
   return param->min_value;
 }
@@ -131,7 +131,7 @@
   return AUBIO_OK;
 }
 
-smpl_t aubio_parameter_get_max_value ( aubio_parameter_t * param )
+smpl_t aubio_parameter_get_max_value ( const aubio_parameter_t * param )
 {
   return param->max_value;
 }
--- a/src/utils/parameter.h
+++ b/src/utils/parameter.h
@@ -76,7 +76,7 @@
   \return current value
 
 */
-smpl_t aubio_parameter_get_current_value ( aubio_parameter_t * param );
+smpl_t aubio_parameter_get_current_value ( const aubio_parameter_t * param );
 
 /** set current parameter value, skipping interpolation
 
@@ -105,7 +105,7 @@
   \return number of steps
 
 */
-uint_t aubio_parameter_get_steps ( aubio_parameter_t * param);
+uint_t aubio_parameter_get_steps ( const aubio_parameter_t * param);
 
 /** set minimum value of this parameter
 
@@ -124,7 +124,7 @@
   \return minimum value
 
 */
-smpl_t aubio_parameter_get_min_value ( aubio_parameter_t * param );
+smpl_t aubio_parameter_get_min_value ( const aubio_parameter_t * param );
 
 /** set maximum value of this parameter
 
@@ -143,7 +143,7 @@
   \return maximum value
 
 */
-smpl_t aubio_parameter_get_max_value ( aubio_parameter_t * param );
+smpl_t aubio_parameter_get_max_value ( const aubio_parameter_t * param );
 
 /** destroy ::aubio_parameter_t object
 
--- a/src/utils/scale.c
+++ b/src/utils/scale.c
@@ -37,7 +37,7 @@
      */
 };
 
-aubio_scale_t * new_aubio_scale (smpl_t ilow, smpl_t ihig, 
+aubio_scale_t * new_aubio_scale (smpl_t ilow, smpl_t ihig,
     smpl_t olow, smpl_t ohig) {
   aubio_scale_t * s = AUBIO_NEW(aubio_scale_t);
   aubio_scale_set_limits (s, ilow, ihig, olow, ohig);