ref: 41f4c5b80a855a94c1fe72b73230203c3a5c045e
parent: 05a34799bfbbb3ffefe33191bbf4401df954f13d
author: Paul Brossier <piem@piem.org>
date: Wed Oct 7 23:08:06 EDT 2009
src/mathutils.c: indent, add parenthesis and initialise pos in fvec_min_elem needed
--- a/src/mathutils.c
+++ b/src/mathutils.c
@@ -140,7 +140,7 @@
uint_t
fvec_min_elem (fvec_t * s)
{
- uint_t i, j = 0, pos = 0.;
+ uint_t i, j, pos = 0.;
smpl_t tmp = s->data[0][0];
for (i = 0; i < s->channels; i++) {
for (j = 0; j < s->length; j++) {
@@ -154,7 +154,7 @@
uint_t
fvec_max_elem (fvec_t * s)
{
- uint_t i, j, pos;
+ uint_t i, j, pos = 0;
smpl_t tmp = 0.0;
for (i = 0; i < s->channels; i++) {
for (j = 0; j < s->length; j++) {
@@ -410,22 +410,24 @@
}
uint_t
-aubio_is_power_of_two(uint_t a) {
- if ((a & a-1) == 0) {
+aubio_is_power_of_two (uint_t a)
+{
+ if ((a & (a - 1)) == 0) {
return 1;
} else {
- return 0;
+ return 0;
}
}
uint_t
-aubio_next_power_of_two(uint_t a) {
+aubio_next_power_of_two (uint_t a)
+{
uint_t i;
a--;
- for (i = 0; i < sizeof(uint_t) * CHAR_BIT; i++ ) {
+ for (i = 0; i < sizeof (uint_t) * CHAR_BIT; i++) {
a = a | a >> 1;
}
- return a+1;
+ return a + 1;
}
smpl_t