summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjofret2009-04-22 06:23:45 +0000
committerjofret2009-04-22 06:23:45 +0000
commitc13651b0f53465466265ea6e05d37de5816fbed0 (patch)
tree6b04773a0cd92bb23accc997243470e5adae54f3 /src
parentf5ef103eaad2c4657d76e48e363e4d8aef174540 (diff)
downloadscilab2c-c13651b0f53465466265ea6e05d37de5816fbed0.tar.gz
scilab2c-c13651b0f53465466265ea6e05d37de5816fbed0.tar.bz2
scilab2c-c13651b0f53465466265ea6e05d37de5816fbed0.zip
malloc
Diffstat (limited to 'src')
-rw-r--r--src/signalProcessing/ifft/cifftma.c4
-rw-r--r--src/signalProcessing/ifft/difftma.c13
-rw-r--r--src/signalProcessing/ifft/difftmx.c15
-rw-r--r--src/signalProcessing/ifft/sifftma.c13
-rw-r--r--src/signalProcessing/ifft/zifftma.c9
5 files changed, 29 insertions, 25 deletions
diff --git a/src/signalProcessing/ifft/cifftma.c b/src/signalProcessing/ifft/cifftma.c
index 620b1609..47bca867 100644
--- a/src/signalProcessing/ifft/cifftma.c
+++ b/src/signalProcessing/ifft/cifftma.c
@@ -11,9 +11,9 @@
*/
-
-#include "ifft.h"
+#include <malloc.h>
#include <stdio.h>
+#include "ifft.h"
void cifftma ( floatComplex* in , int rows, int cols, floatComplex* out)
{
diff --git a/src/signalProcessing/ifft/difftma.c b/src/signalProcessing/ifft/difftma.c
index d878b33a..e716c4b0 100644
--- a/src/signalProcessing/ifft/difftma.c
+++ b/src/signalProcessing/ifft/difftma.c
@@ -1,7 +1,7 @@
/*
* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
* Copyright (C) 2008 - INRIA - Arnaud Torset
- *
+ *
* This file must be used under the terms of the CeCILL.
* This source file is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -10,6 +10,7 @@
*
*/
+#include <malloc.h>
#include "ifft.h"
#include "zeros.h"
@@ -19,13 +20,13 @@ void difftma ( double* in , int rows, int cols, double* out){
doubleComplex* inCpx;
doubleComplex* outCpx;
- ZEROS = malloc((uint)(rows*cols)*sizeof(double));
- outCpx = malloc((uint)(rows*cols)*sizeof(doubleComplex));
-
+ ZEROS = malloc((unsigned int)(rows*cols)*sizeof(double));
+ outCpx = malloc((unsigned int)(rows*cols)*sizeof(doubleComplex));
+
dzerosa(ZEROS,rows,cols);
inCpx=DoubleComplexMatrix(in,ZEROS,rows*cols);
-
+
zifftma(inCpx,rows,cols,outCpx);
-
+
zreala(outCpx, rows*cols, out);
}
diff --git a/src/signalProcessing/ifft/difftmx.c b/src/signalProcessing/ifft/difftmx.c
index 29604c49..a4aef2d4 100644
--- a/src/signalProcessing/ifft/difftmx.c
+++ b/src/signalProcessing/ifft/difftmx.c
@@ -10,6 +10,7 @@
*
*/
+#include <stdlib.h>
#include <math.h>
#include "max.h"
#include "min.h"
@@ -110,7 +111,7 @@ static int mulByRotationFactor (void );
static int post_sqFactor2NormlOrder (void);
static void single_sqFactor2NormlOrder (void);
static int multi_sqFactor2NormlOrder (void);
-
+
/* End Prototypes */
@@ -281,7 +282,7 @@ switch ( nfac[i-1] )
k = nfac[i-1] ;
kspnn = kspan ;
kspan = kspan / k ;
-
+
factorOf3Transform ( ) ;
break ;
@@ -301,7 +302,7 @@ switch ( nfac[i-1] )
kspan = kspan / k ;
if ( nfac[i-1] != jf) preFOtherTransform ( ) ;
-
+
factorOfOtherTransform ( ) ;
break ;
}
@@ -346,7 +347,7 @@ static void permute_stage2 (void)
/*permutation for square-free facotrs of n */
nonSqFactor2NormOrder () ;
-
+
/*determine the permutation cycles of length greater than 1*/
detPermutCycles ();
@@ -426,7 +427,7 @@ static int factorOf2Transform (void)
kk = k2 + kspan;
}while ( kk < nt );
-
+
k2 = kk - nt;
c1 = -c1;
kk = k1 - k2;
@@ -646,11 +647,11 @@ static void factorOf3Transform (void)
a[k1-1] = ak - bj ;
b[k1-1] = bk + aj ;
a[k2-1] = ak + bj ;
- b[k2-1] = bk - aj ;
+ b[k2-1] = bk - aj ;
kk = k2 + kspan ;
} while (kk < nn);
-
+
kk -= nn ;
}while (kk <= kspan);
diff --git a/src/signalProcessing/ifft/sifftma.c b/src/signalProcessing/ifft/sifftma.c
index 8e1e118c..0c9c2dd1 100644
--- a/src/signalProcessing/ifft/sifftma.c
+++ b/src/signalProcessing/ifft/sifftma.c
@@ -1,7 +1,7 @@
/*
* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
* Copyright (C) 2008 - INRIA - Arnaud Torset
- *
+ *
* This file must be used under the terms of the CeCILL.
* This source file is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -10,6 +10,7 @@
*
*/
+#include <malloc.h>
#include "ifft.h"
#include "zeros.h"
@@ -19,13 +20,13 @@ void sifftma ( float* in , int rows, int cols, float* out){
floatComplex* inCpx;
floatComplex* outCpx;
- ZEROS = malloc((uint)(rows*cols)*sizeof(float));
- outCpx = malloc((uint)(rows*cols)*sizeof(floatComplex));
-
+ ZEROS = malloc((unsigned int)(rows*cols)*sizeof(float));
+ outCpx = malloc((unsigned int)(rows*cols)*sizeof(floatComplex));
+
szerosa(ZEROS,rows,cols);
inCpx=FloatComplexMatrix(in,ZEROS,rows*cols);
-
+
cifftma(inCpx,rows,cols,outCpx);
-
+
creala(outCpx, rows*cols, out);
}
diff --git a/src/signalProcessing/ifft/zifftma.c b/src/signalProcessing/ifft/zifftma.c
index b02f0fed..3b1de4cb 100644
--- a/src/signalProcessing/ifft/zifftma.c
+++ b/src/signalProcessing/ifft/zifftma.c
@@ -12,6 +12,7 @@
#define IFFT842 1
#define DFFT2 0
+#include <malloc.h>
#include <math.h>
#include "ifft.h"
#include "lapack.h"
@@ -32,13 +33,13 @@ void zifftma ( doubleComplex* in , int rows, int cols, doubleComplex* out)
int ierr = 0 ;
int isn = 1;
int i = 0;
-
+
int increment=1;
double* realIn = (double*) malloc ( sizeof (double) * (unsigned int) size );
double* imagIn = (double*) malloc ( sizeof (double) * (unsigned int) size );
doubleComplex* inCopy = (doubleComplex*) malloc ( sizeof (doubleComplex) * (unsigned int) size );
-
+
doubleComplex* inTemp = (doubleComplex*) malloc ( sizeof (doubleComplex) * (unsigned int) size );
@@ -46,7 +47,7 @@ void zifftma ( doubleComplex* in , int rows, int cols, doubleComplex* out)
zimaga ( in , size , imagIn) ;
zreala ( in , size , realIn) ;
for (i=0;i<size;i++) inCopy[i]=in[i];
-
+
if ( rows == 1 || cols == 1 )
{
@@ -147,7 +148,7 @@ void zifftma ( doubleComplex* in , int rows, int cols, doubleComplex* out)
}
}
-
+
free(realIn);
free(imagIn);
free(inCopy);