some fixes

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2009-sploving@11589 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Baozeng Ding 2009-08-16 15:56:32 +00:00
commit 8ee9175b6e
8 changed files with 576 additions and 214 deletions

View file

@ -9,7 +9,6 @@ srcdir = @srcdir@
top_srcdir = @top_srcdir@ top_srcdir = @top_srcdir@
top_builddir = @top_builddir@ top_builddir = @top_builddir@
include $(srcdir)/../common.mk include $(srcdir)/../common.mk
# Overridden variables here # Overridden variables here
@ -37,7 +36,7 @@ run_testcase = \
# Clean: remove the generated .sci file # Clean: remove the generated .sci file
%.clean: %.clean:
@rm -f $*.sci *_wrap.c *.i *.h @rm -f $*.sci *_wrap.c *.i *.h *_wrap.cxx
clean: clean:
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile scilab_clean $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile scilab_clean

View file

@ -1,13 +0,0 @@
exec loader.sce;
if signed_char_identity(-13) <> -13 then pause, end
if unsigned_char_identity(251) <> 251 then pause, end
if signed_short_identity(-31000) <> -31000 then pause, end
if unsigned_short_identity(61000) <> 61000 then pause, end
if signed_int_identity(42) <> 42 then pause, end
if unsigned_int_identity(123456) <> 123456 then pause, end
if signed_long_identity(65537) <> 65537 then pause, end
if unsigned_long_identity(654321) <> 654321 then pause, end
exit

View file

@ -1,6 +1,5 @@
%include <typemaps/swigmacros.swg> %include <typemaps/swigmacros.swg>
%include <typemaps/fragments.swg> %include <typemaps/fragments.swg>
%include <sciruntime.swg> %include <sciruntime.swg>
%include <sciprimtypes.swg>
%include <scitypemaps.swg> %include <scitypemaps.swg>

View file

@ -1 +0,0 @@

View file

@ -1,10 +1,15 @@
%insert(runtime) "swigrun.swg"; %insert(runtime) "swigrun.swg";
%insert(runtime) "swigerrors.swg"; %insert(runtime) "swigerrors.swg";
%insert(runtime) %{ %insert(runtime) %{
#ifdef __cplusplus
extern "C" {
#endif
void SWIG_Error(int code, const char *msg) { void SWIG_Error(int code, const char *msg) {
Scierror(code, _("%s\n"), msg); Scierror(code, _("%s\n"), msg);
} }
#ifdef __cplusplus
}
#endif
#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(999, msg); } else #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(999, msg); } else

File diff suppressed because it is too large Load diff

View file

@ -188,7 +188,7 @@ public:
if (overloaded) if (overloaded)
Append(overname, Getattr(n, "sym:overname")); Append(overname, Getattr(n, "sym:overname"));
Printv(f->def, "int ", overname, " (char *fname,unsigned long fname_len) {\n", NIL); Printv(f->def, "int ", overname, " (char *fname, unsigned long fname_len) {\n", NIL);
/* Emit all of the local variables for holding arguments */ /* Emit all of the local variables for holding arguments */
emit_parameter_variables(l, f); emit_parameter_variables(l, f);
@ -361,7 +361,7 @@ public:
String *dispatch = Swig_overload_dispatch(n, "return %s(fname, fname_len);", &maxargs); String *dispatch = Swig_overload_dispatch(n, "return %s(fname, fname_len);", &maxargs);
String *tmp = NewString(""); String *tmp = NewString("");
Printv(f->def, "int ", wname, " (char *fname,unsigned long fname_len) {\n", NIL); Printv(f->def, "int ", wname, " (char *fname, unsigned long fname_len) {\n", NIL);
Wrapper_add_local(f, "argc", "int argc = Rhs;"); Wrapper_add_local(f, "argc", "int argc = Rhs;");
//Printf(tmp, "octave_value_ref argv[%d]={", maxargs); //Printf(tmp, "octave_value_ref argv[%d]={", maxargs);
//for (int j = 0; j < maxargs; ++j) //for (int j = 0; j < maxargs; ++j)
@ -369,7 +369,7 @@ public:
//Printf(tmp, "}"); //Printf(tmp, "}");
//Wrapper_add_local(f, "argv", tmp); //Wrapper_add_local(f, "argv", tmp);
Printv(f->code, dispatch, "\n", NIL); Printv(f->code, dispatch, "\n", NIL);
Printf(f->code, "error(\"No matching function for overload\");\n", iname); Printf(f->code, "Scierror(999, _(\"No matching function for overload\"));\n");
Printf(f->code, "return 0;\n"); Printf(f->code, "return 0;\n");
Printv(f->code, "}\n", NIL); Printv(f->code, "}\n", NIL);
@ -418,7 +418,7 @@ public:
Printf(globalVar, "int %s = 0;\n\n", iscomplexname); Printf(globalVar, "int %s = 0;\n\n", iscomplexname);
else else
Printf(globalVar, "\n"); Printf(globalVar, "\n");
Printv(setf->def, "int ", setname, " (char *fname,unsigned long fname_len) {\n", NIL); Printv(setf->def, "int ", setname, " (char *fname, unsigned long fname_len) {\n", NIL);
/* Check the number of input and output */ /* Check the number of input and output */
Printf(setf->def, "CheckRhs(1, 1);\n"); Printf(setf->def, "CheckRhs(1, 1);\n");
@ -453,7 +453,7 @@ public:
/* deal with the get function */ /* deal with the get function */
Setattr(n, "wrap:name", getname); Setattr(n, "wrap:name", getname);
int addfail = 0; int addfail = 0;
Printv(getf->def, "int ", getname, " (char *fname,unsigned long fname_len){\n", NIL); Printv(getf->def, "int ", getname, " (char *fname, unsigned long fname_len){\n", NIL);
/* Check the number of input and output */ /* Check the number of input and output */
Printf(getf->def, "CheckRhs(0, 0);\n"); Printf(getf->def, "CheckRhs(0, 0);\n");
@ -519,7 +519,7 @@ public:
String *getname = Swig_name_get(iname); String *getname = Swig_name_get(iname);
Setattr(n, "wrap:name", getname); Setattr(n, "wrap:name", getname);
int addfail = 0; int addfail = 0;
Printv(getf->def, "int ", getname, " (char *fname,unsigned long fname_len){\n", NIL); Printv(getf->def, "int ", getname, " (char *fname, unsigned long fname_len){\n", NIL);
/* Check the number of input and output */ /* Check the number of input and output */
Printf(getf->def, "CheckRhs(0, 0);\n"); Printf(getf->def, "CheckRhs(0, 0);\n");