summaryrefslogtreecommitdiff
path: root/src/auxiliaryFunctions
diff options
context:
space:
mode:
authortorset2009-02-13 13:52:38 +0000
committertorset2009-02-13 13:52:38 +0000
commit7b4de8c2a58f828bb42e1a1f1f5b3421363f2556 (patch)
tree159a76f0acf625abf671e354cf966baae51cc8e8 /src/auxiliaryFunctions
parente34893265bb625750dd1176c852cc012b1fb8694 (diff)
downloadscilab2c-7b4de8c2a58f828bb42e1a1f1f5b3421363f2556.tar.gz
scilab2c-7b4de8c2a58f828bb42e1a1f1f5b3421363f2556.tar.bz2
scilab2c-7b4de8c2a58f828bb42e1a1f1f5b3421363f2556.zip
modify isempty headers which make the c files usseless
Diffstat (limited to 'src/auxiliaryFunctions')
-rw-r--r--src/auxiliaryFunctions/includes/isempty.h8
-rw-r--r--src/auxiliaryFunctions/isempty/Makefile.am5
-rw-r--r--src/auxiliaryFunctions/isempty/Makefile.in41
-rw-r--r--src/auxiliaryFunctions/isempty/cisemptya.c23
-rw-r--r--src/auxiliaryFunctions/isempty/disemptya.c23
-rw-r--r--src/auxiliaryFunctions/isempty/sisemptya.c23
-rw-r--r--src/auxiliaryFunctions/isempty/testIsEmpty.c103
-rw-r--r--src/auxiliaryFunctions/isempty/zisemptya.c23
8 files changed, 66 insertions, 183 deletions
diff --git a/src/auxiliaryFunctions/includes/isempty.h b/src/auxiliaryFunctions/includes/isempty.h
index 80285647..daa21fa7 100644
--- a/src/auxiliaryFunctions/includes/isempty.h
+++ b/src/auxiliaryFunctions/includes/isempty.h
@@ -43,21 +43,21 @@
/*
** \brief Float Is Empty function
*/
-float sisemptya(float* x, int size);
+#define sisemptya(in,size) (size==0) ? 1.0f : 0.0f
/*
** \brief Double Is Empty function
*/
-double disemptya(double*x, int size);
+#define disemptya(in,size) (size==0) ? 1.0 : 0.0
/*
** \brief Float Complex Is Empty function
*/
-float cisemptya(floatComplex* z, int size);
+#define cisemptya(in,size) (size==0) ? 1.0f : 0.0f
/*
** \brief Double Complex Is Empty function
*/
-double zisemptya(doubleComplex* z, int size);
+#define zisemptya(in,size) (size==0) ? 1.0 : 0.0
#endif /* !__IS_EMPTY_H__ */
diff --git a/src/auxiliaryFunctions/isempty/Makefile.am b/src/auxiliaryFunctions/isempty/Makefile.am
index 04e6890b..a7c0c0cf 100644
--- a/src/auxiliaryFunctions/isempty/Makefile.am
+++ b/src/auxiliaryFunctions/isempty/Makefile.am
@@ -19,11 +19,6 @@ pkglib_LTLIBRARIES = libIsempty.la
libIsempty_la_SOURCES = $(HEAD) $(SRC)
-SRC = sisemptya.c \
- disemptya.c \
- cisemptya.c \
- zisemptya.c
-
HEAD = ../includes/isempty.h
####
diff --git a/src/auxiliaryFunctions/isempty/Makefile.in b/src/auxiliaryFunctions/isempty/Makefile.in
index 7a139821..3d182869 100644
--- a/src/auxiliaryFunctions/isempty/Makefile.in
+++ b/src/auxiliaryFunctions/isempty/Makefile.in
@@ -54,9 +54,7 @@ pkglibLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(pkglib_LTLIBRARIES)
libIsempty_la_LIBADD =
am__objects_1 =
-am__objects_2 = libIsempty_la-sisemptya.lo libIsempty_la-disemptya.lo \
- libIsempty_la-cisemptya.lo libIsempty_la-zisemptya.lo
-am_libIsempty_la_OBJECTS = $(am__objects_1) $(am__objects_2)
+am_libIsempty_la_OBJECTS = $(am__objects_1)
libIsempty_la_OBJECTS = $(am_libIsempty_la_OBJECTS)
libIsempty_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(libIsempty_la_CFLAGS) \
@@ -203,11 +201,6 @@ libIsempty_la_CFLAGS = -I ../../type \
instdir = $(top_builddir)/lib
pkglib_LTLIBRARIES = libIsempty.la
libIsempty_la_SOURCES = $(HEAD) $(SRC)
-SRC = sisemptya.c \
- disemptya.c \
- cisemptya.c \
- zisemptya.c
-
HEAD = ../includes/isempty.h
####
@@ -307,10 +300,6 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libIsempty_la-cisemptya.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libIsempty_la-disemptya.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libIsempty_la-sisemptya.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libIsempty_la-zisemptya.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testIsEmpty-testIsEmpty.Po@am__quote@
.c.o:
@@ -334,34 +323,6 @@ distclean-compile:
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
-libIsempty_la-sisemptya.lo: sisemptya.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libIsempty_la_CFLAGS) $(CFLAGS) -MT libIsempty_la-sisemptya.lo -MD -MP -MF $(DEPDIR)/libIsempty_la-sisemptya.Tpo -c -o libIsempty_la-sisemptya.lo `test -f 'sisemptya.c' || echo '$(srcdir)/'`sisemptya.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libIsempty_la-sisemptya.Tpo $(DEPDIR)/libIsempty_la-sisemptya.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sisemptya.c' object='libIsempty_la-sisemptya.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libIsempty_la_CFLAGS) $(CFLAGS) -c -o libIsempty_la-sisemptya.lo `test -f 'sisemptya.c' || echo '$(srcdir)/'`sisemptya.c
-
-libIsempty_la-disemptya.lo: disemptya.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libIsempty_la_CFLAGS) $(CFLAGS) -MT libIsempty_la-disemptya.lo -MD -MP -MF $(DEPDIR)/libIsempty_la-disemptya.Tpo -c -o libIsempty_la-disemptya.lo `test -f 'disemptya.c' || echo '$(srcdir)/'`disemptya.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libIsempty_la-disemptya.Tpo $(DEPDIR)/libIsempty_la-disemptya.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='disemptya.c' object='libIsempty_la-disemptya.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libIsempty_la_CFLAGS) $(CFLAGS) -c -o libIsempty_la-disemptya.lo `test -f 'disemptya.c' || echo '$(srcdir)/'`disemptya.c
-
-libIsempty_la-cisemptya.lo: cisemptya.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libIsempty_la_CFLAGS) $(CFLAGS) -MT libIsempty_la-cisemptya.lo -MD -MP -MF $(DEPDIR)/libIsempty_la-cisemptya.Tpo -c -o libIsempty_la-cisemptya.lo `test -f 'cisemptya.c' || echo '$(srcdir)/'`cisemptya.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libIsempty_la-cisemptya.Tpo $(DEPDIR)/libIsempty_la-cisemptya.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cisemptya.c' object='libIsempty_la-cisemptya.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libIsempty_la_CFLAGS) $(CFLAGS) -c -o libIsempty_la-cisemptya.lo `test -f 'cisemptya.c' || echo '$(srcdir)/'`cisemptya.c
-
-libIsempty_la-zisemptya.lo: zisemptya.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libIsempty_la_CFLAGS) $(CFLAGS) -MT libIsempty_la-zisemptya.lo -MD -MP -MF $(DEPDIR)/libIsempty_la-zisemptya.Tpo -c -o libIsempty_la-zisemptya.lo `test -f 'zisemptya.c' || echo '$(srcdir)/'`zisemptya.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libIsempty_la-zisemptya.Tpo $(DEPDIR)/libIsempty_la-zisemptya.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zisemptya.c' object='libIsempty_la-zisemptya.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libIsempty_la_CFLAGS) $(CFLAGS) -c -o libIsempty_la-zisemptya.lo `test -f 'zisemptya.c' || echo '$(srcdir)/'`zisemptya.c
-
testIsEmpty-testIsEmpty.o: testIsEmpty.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testIsEmpty_CFLAGS) $(CFLAGS) -MT testIsEmpty-testIsEmpty.o -MD -MP -MF $(DEPDIR)/testIsEmpty-testIsEmpty.Tpo -c -o testIsEmpty-testIsEmpty.o `test -f 'testIsEmpty.c' || echo '$(srcdir)/'`testIsEmpty.c
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testIsEmpty-testIsEmpty.Tpo $(DEPDIR)/testIsEmpty-testIsEmpty.Po
diff --git a/src/auxiliaryFunctions/isempty/cisemptya.c b/src/auxiliaryFunctions/isempty/cisemptya.c
deleted file mode 100644
index 5f90c4c0..00000000
--- a/src/auxiliaryFunctions/isempty/cisemptya.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2007-2008 - INRIA - Bruno JOFRET
- *
- * 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
- * are also available at
- * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
- *
- */
-
-#include "isempty.h"
-#include <stdio.h>
-
-float cisemptya(floatComplex* x, int size) {
-
- if (size!=0)
- printf("%f\n",creals(x[0]));
-
- return (size==0) ? 1.0f : 0.0f;
-
-}
diff --git a/src/auxiliaryFunctions/isempty/disemptya.c b/src/auxiliaryFunctions/isempty/disemptya.c
deleted file mode 100644
index 50639f28..00000000
--- a/src/auxiliaryFunctions/isempty/disemptya.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2007-2008 - INRIA - Bruno JOFRET
- *
- * 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
- * are also available at
- * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
- *
- */
-
-#include "isempty.h"
-#include <stdio.h>
-
-double disemptya(double* x, int size) {
-
- if (size!=0)
- printf("%f\n",x[0]);
-
- return (size==0) ? 1.0 : 0.0;
-
-}
diff --git a/src/auxiliaryFunctions/isempty/sisemptya.c b/src/auxiliaryFunctions/isempty/sisemptya.c
deleted file mode 100644
index 2cf6218f..00000000
--- a/src/auxiliaryFunctions/isempty/sisemptya.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2007-2008 - INRIA - Bruno JOFRET
- *
- * 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
- * are also available at
- * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
- *
- */
-
-#include "isempty.h"
-#include <stdio.h>
-
-float sisemptya(float* x, int size) {
-
- if (size!=0)
- printf("%f\n",x[0]);
-
- return (size==0) ? 1.0f : 0.0f;
-
-}
diff --git a/src/auxiliaryFunctions/isempty/testIsEmpty.c b/src/auxiliaryFunctions/isempty/testIsEmpty.c
index 15d40b4f..011b5d2f 100644
--- a/src/auxiliaryFunctions/isempty/testIsEmpty.c
+++ b/src/auxiliaryFunctions/isempty/testIsEmpty.c
@@ -14,56 +14,71 @@
int sisemptyaTest() {
int result = 0;
- float empty[5] = {0., 0., 0., 0., 0.};
+ float *empty;
float full[5] = {1., 2., 3., 0., 0.};
-
+ float out;
+
+ empty = NULL;
+ full[4]=0;
+
printf(">> Float array\n");
- if (sisemptya(empty, 0) == 0) {
- printf("ERROR ! : Test Failed (empty array)\n");
+
+ out=sisemptya(empty, 0);
+ if (out == 0) {
+ printf("ERROR1 ! : Test Failed (empty array)\n");
result = ERROR;
}
- assert (sisemptya(empty, 0) == 1);
-
- if (sisemptya(full, 5) == 1) {
- printf("ERROR ! : Test Failed (non empty array)\n");
+ assert (out == 1);
+
+
+ out = sisemptya(full, 5);
+ if ( out == 1) {
+ printf("ERROR2 ! : Test Failed (non empty array)\n");
result = ERROR;
}
- assert(sisemptya(full, 5) == 0);
+ assert(out == 0);
return result;
}
int disemptyaTest() {
int result = 0;
- double empty[5] = {0., 0., 0., 0., 0.};
+ double *empty;
double full[5] = {1., 2., 3., 0., 0.};
-
+ double out;
+
+ empty = NULL;
+ full[4]=0;
+
+
printf(">> Double array\n");
- if (disemptya(empty, 0) == 0) {
- printf("ERROR ! : Test Failed (empty array)\n");
+ out=disemptya(empty, 0);
+ if (out == 0) {
+ printf("ERROR1 ! : Test Failed (empty array)\n");
result = ERROR;
}
- assert(disemptya(empty, 0) == 1);
-
- if (disemptya(full, 5) == 1) {
- printf("ERROR ! : Test Failed (non empty array)\n");
+
+ assert(out == 1);
+
+
+ out=disemptya(full, 5);
+ if (out == 1) {
+ printf("ERROR2 ! : Test Failed (non empty array)\n");
result = ERROR;
}
- assert(disemptya(full, 5) == 0);
+ assert(out == 0);
return result;
}
int cisemptyaTest() {
int result = 0;
- floatComplex empty[5];
+ floatComplex *empty;
floatComplex full[5];
+ float out;
- empty[0] = FloatComplex(0., 0.);
- empty[1] = FloatComplex(0., 0.);
- empty[2] = FloatComplex(0., 0.);
- empty[3] = FloatComplex(0., 0.);
- empty[4] = FloatComplex(0., 0.);
+ empty=NULL;
+
full[0] = FloatComplex(0.,1.);
full[1] = FloatComplex(0., 2.);
full[2] = FloatComplex(0., 3.);
@@ -71,17 +86,21 @@ int cisemptyaTest() {
full[4] = FloatComplex(0., 0.);
printf(">> Float Complex array\n");
- if (cisemptya(empty, 0) == 0) {
- printf("ERROR ! : Test Failed (empty array)\n");
+
+ out = cisemptya(empty, 0);
+ if (out == 0) {
+ printf("ERROR1 ! : Test Failed (empty array)\n");
result = ERROR;
}
- assert (cisemptya(empty, 0) == 1);
+ assert (out == 1);
+
- if (cisemptya(full, 5) == 1) {
- printf("ERROR ! : Test Failed (non empty array)\n");
+ out = cisemptya(full, 5);
+ if (out == 1) {
+ printf("ERROR2 ! : Test Failed (non empty array)\n");
result = ERROR;
}
- assert(cisemptya(full, 5) == 0);
+ assert(out == 0);
return result;
@@ -89,14 +108,11 @@ int cisemptyaTest() {
int zisemptyaTest() {
int result = 0;
- doubleComplex empty[5];
+ doubleComplex *empty;
doubleComplex full[5];
+ double out;
- empty[0] = DoubleComplex(0., 0.);
- empty[1] = DoubleComplex(0., 0.);
- empty[2] = DoubleComplex(0., 0.);
- empty[3] = DoubleComplex(0., 0.);
- empty[4] = DoubleComplex(0., 0.);
+ empty=NULL;
full[0] = DoubleComplex(0.,1.);
full[1] = DoubleComplex(0., 2.);
@@ -105,17 +121,20 @@ int zisemptyaTest() {
full[4] = DoubleComplex(0., 0.);;
printf(">> Double Complex array\n");
- if (zisemptya(empty, 0) == 0) {
- printf("ERROR ! : Test Failed (empty array)\n");
+
+ out = zisemptya(empty, 0);
+ if (out == 0) {
+ printf("ERROR1 ! : Test Failed (empty array)\n");
result = ERROR;
}
- assert (zisemptya(empty, 0) == 1);
+ assert (out == 1);
- if (zisemptya(full, 5) == 1) {
- printf("ERROR ! : Test Failed (non empty array)\n");
+ out = zisemptya(full, 5);
+ if (out == 1) {
+ printf("ERROR2 ! : Test Failed (non empty array)\n");
result = ERROR;
}
- assert(zisemptya(full, 5) == 0);
+ assert(out == 0);
return result;
diff --git a/src/auxiliaryFunctions/isempty/zisemptya.c b/src/auxiliaryFunctions/isempty/zisemptya.c
deleted file mode 100644
index f8bb383f..00000000
--- a/src/auxiliaryFunctions/isempty/zisemptya.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2007-2008 - INRIA - Bruno JOFRET
- *
- * 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
- * are also available at
- * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
- *
- */
-
-#include "isempty.h"
-#include <stdio.h>
-
-double zisemptya(doubleComplex* x, int size) {
-
- if (size!=0)
- printf("%f\n",zreals(x[0]));
-
- return (size==0) ? 1.0 : 0.0;
-
-}