diff options
author | torset | 2009-01-16 16:23:22 +0000 |
---|---|---|
committer | torset | 2009-01-16 16:23:22 +0000 |
commit | 25211248348e0488a0e830bfafc3f3bd9061224a (patch) | |
tree | 15f0b3c1276be57c4ee23d6b414c132cdc71ccea /src/auxiliaryFunctions/find/sfinda.c | |
parent | 6336fd8c8f24e474913ce7e85fbb2d0fad6283df (diff) | |
download | scilab2c-25211248348e0488a0e830bfafc3f3bd9061224a.tar.gz scilab2c-25211248348e0488a0e830bfafc3f3bd9061224a.tar.bz2 scilab2c-25211248348e0488a0e830bfafc3f3bd9061224a.zip |
Update with Scilab2C modifs (maybe some errors)
Diffstat (limited to 'src/auxiliaryFunctions/find/sfinda.c')
-rw-r--r-- | src/auxiliaryFunctions/find/sfinda.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/auxiliaryFunctions/find/sfinda.c b/src/auxiliaryFunctions/find/sfinda.c index 74fd3cf8..67324cda 100644 --- a/src/auxiliaryFunctions/find/sfinda.c +++ b/src/auxiliaryFunctions/find/sfinda.c @@ -12,18 +12,15 @@ #include "find.h" -float* sfinda(float* x, int size) { +void sfinda(float* x, int size, float* out, int *indiceOut) { int i = 0; - int indiceOut = 0; - float* out=NULL; + *indiceOut = 0; for (i = 0; i < size ; ++i) { if (x[i] != 0) { - out = realloc(out, (uint)(indiceOut+1)*sizeof(float)); - out[indiceOut] = (float)i; - indiceOut++; + out[*indiceOut] = (float)(i+1); + (*indiceOut)++; } } - return out; } |