aboutsummaryrefslogtreecommitdiff
path: root/src/scalar.c
diff options
context:
space:
mode:
authorJamie Bullock <jamie@postlude.co.uk>2011-03-30 10:05:07 +0000
committerJamie Bullock <jamie@postlude.co.uk>2011-03-30 10:05:07 +0000
commitd43418e0293c2f1f9954e193a9dcc5b82f5ce0c3 (patch)
treee4fb4598c77970dc64f530d98691f03ced44db99 /src/scalar.c
parentd128e363fe30da5109d3344232ede924b62606ed (diff)
downloadLibXtract-d43418e0293c2f1f9954e193a9dcc5b82f5ce0c3.tar.gz
LibXtract-d43418e0293c2f1f9954e193a9dcc5b82f5ce0c3.tar.bz2
LibXtract-d43418e0293c2f1f9954e193a9dcc5b82f5ce0c3.zip
- fixed typos in *result initialisation potentially fixing horrible bug
Diffstat (limited to 'src/scalar.c')
-rw-r--r--src/scalar.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/scalar.c b/src/scalar.c
index d2bc317..de1ac03 100644
--- a/src/scalar.c
+++ b/src/scalar.c
@@ -74,7 +74,7 @@ int xtract_variance(const float *data, const int N, const void *argv, float *res
int n = N;
- *result += 0.f;
+ *result = 0.f;
while(n--)
*result += powf(data[n] - *(float *)argv, 2);
@@ -95,7 +95,7 @@ int xtract_average_deviation(const float *data, const int N, const void *argv, f
int n = N;
- *result += 0.f;
+ *result = 0.f;
while(n--)
*result += fabsf(data[n] - *(float *)argv);
@@ -111,7 +111,7 @@ int xtract_skewness(const float *data, const int N, const void *argv, float *re
float temp = 0.f;
- *result += 0.f;
+ *result = 0.f;
while(n--){
temp = (data[n] - ((float *)argv)[0]) / ((float *)argv)[1];
@@ -130,7 +130,7 @@ int xtract_kurtosis(const float *data, const int N, const void *argv, float *re
float temp = 0.f;
- *result += 0.f;
+ *result = 0.f;
while(n--){
temp = (data[n] - ((float *)argv)[0]) / ((float *)argv)[1];
@@ -183,7 +183,7 @@ int xtract_spectral_variance(const float *data, const int N, const void *argv, f
amps = data;
freqs = data + m;
- *result += 0.f;
+ *result = 0.f;
while(m--){
A += amps[m];
@@ -213,7 +213,7 @@ int xtract_spectral_average_deviation(const float *data, const int N, const void
amps = data;
freqs = data + m;
- *result += 0.f;
+ *result = 0.f;
while(m--){
A += amps[m];
@@ -236,7 +236,7 @@ int xtract_spectral_skewness(const float *data, const int N, const void *argv,
amps = data;
freqs = data + m;
- *result += 0.f;
+ *result = 0.f;
while(m--){
A += amps[m];
@@ -261,7 +261,7 @@ int xtract_spectral_kurtosis(const float *data, const int N, const void *argv,
amps = data;
freqs = data + m;
- *result += 0.f;
+ *result = 0.f;
while(m--){
A += amps[m];
@@ -763,7 +763,7 @@ int xtract_nonzero_count(const float *data, const int N, const void *argv, float
int n = N;
- *result += 0.f;
+ *result = 0.f;
while(n--)
*result += (*data++ ? 1 : 0);