[Kst] kdeextragear-2/kst/plugins/autocorrelation

Andrew Walker arwalker at sumusltd.com
Tue Dec 16 00:57:42 CET 2003


CVS commit by arwalker: 

Removed compiler warnings


  M +26 -18    autocorrelation.c   1.2


--- kdeextragear-2/kst/plugins/autocorrelation/autocorrelation.c  #1.1:1.2
@@ -9,4 +9,6 @@
 #include <math.h>
 
+#define KST_UNUSED(x) if(x){};
+
 int autocorrelation( const double *const inArrays[], const int inArrayLens[],
                 const double is[],
@@ -15,15 +17,18 @@ int autocorrelation( const double *const
 
 int autocorrelation( const double *const inArrays[], const int inArrayLens[],
-                const double is[],
+                const double inScalars[],
                 double *outArrays[], int outArrayLens[],
                 double outScalars[] )
 {
+    KST_UNUSED( inScalars )
+    KST_UNUSED( outScalars )
+    
     int iRetVal = -1;
       
     if( inArrayLens[0] > 0 )
     {
-        double  dSum;
+        double  dSum  = 0.0;
         double  dAvg;
-        double  dSumSq;
+        double  dSumSq = 0.0;
         double  dStd;
         double  dCor            = 0.0;
@@ -51,4 +56,6 @@ int autocorrelation( const double *const
         }
 
+        if( iNumPoints > 0 )
+        {
         dAvg = dSum / iNumPoints;
         dStd = sqrt( ( dSumSq / (double)iNumPoints ) - ( dAvg * dAvg ) );
@@ -72,4 +79,5 @@ int autocorrelation( const double *const
         }        
     }
+    }
     
     return iRetVal;





More information about the Kst mailing list