From d47d3c063346c9a47c99bb39dd17344c1bfafdc4 Mon Sep 17 00:00:00 2001 From: Simon Marchetto Date: Fri, 14 Mar 2014 11:11:49 +0100 Subject: [PATCH] scilab: return SWIG_OK or SWIG_ERROR (instead of 0) --- Lib/scilab/scicontainer.swg | 4 ++-- Lib/scilab/scistdcommon.swg | 4 ++-- Lib/scilab/scitypemaps.swg | 14 +++++++------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Lib/scilab/scicontainer.swg b/Lib/scilab/scicontainer.swg index 94a1992fe..c99fbb2d8 100644 --- a/Lib/scilab/scicontainer.swg +++ b/Lib/scilab/scicontainer.swg @@ -216,7 +216,7 @@ namespace swig } else { - return 0; + return SWIG_ERROR; } } @@ -432,7 +432,7 @@ namespace swig { } return traits_from_sequence::set(size, data); } - return 0; + return SWIG_OK; } catch (std::exception& e) { diff --git a/Lib/scilab/scistdcommon.swg b/Lib/scilab/scistdcommon.swg index 2d642088d..f1c8d0b23 100644 --- a/Lib/scilab/scistdcommon.swg +++ b/Lib/scilab/scistdcommon.swg @@ -4,7 +4,7 @@ namespace swig { // Traits that provides the from method template struct traits_from_ptr { static SwigSciObject from(Type *val, int owner = 0) { - return 0; //SWIG_NewPointerObj(val, type_info(), owner); + return SWIG_OK; //SWIG_NewPointerObj(val, type_info(), owner); } }; @@ -153,7 +153,7 @@ namespace swig { %type_error(swig::type_name()); } if (throw_error) throw std::invalid_argument("bad type"); - return 0; + return SWIG_OK; } } }; diff --git a/Lib/scilab/scitypemaps.swg b/Lib/scilab/scitypemaps.swg index 78219201a..5bb7bcc3d 100644 --- a/Lib/scilab/scitypemaps.swg +++ b/Lib/scilab/scitypemaps.swg @@ -34,7 +34,7 @@ %define %scilab_inptr_typemap(TYPEMAPTYPE, FRAGMENTNAME, CTYPE) %typemap(TYPEMAPTYPE, noblock=1, fragment="FRAGMENTNAME") CTYPE { if (FRAGMENTNAME(pvApiCtx, $input, %as_voidptrptr(&$1), fname) != SWIG_OK) { - return 0; + return SWIG_ERROR; } } %enddef @@ -42,7 +42,7 @@ %define %scilab_out_typemap(TYPEMAPTYPE, FRAGMENTNAME, CTYPE) %typemap(TYPEMAPTYPE, noblock=1, fragment="FRAGMENTNAME") CTYPE { if (FRAGMENTNAME(pvApiCtx, $result, $1) != SWIG_OK) { - return 0; + return SWIG_ERROR; } } %enddef @@ -50,7 +50,7 @@ %define %scilab_outptr_typemap(TYPEMAPTYPE, FRAGMENTNAME, CTYPE) %typemap(TYPEMAPTYPE, noblock=1, fragment="FRAGMENTNAME") CTYPE { if (FRAGMENTNAME(pvApiCtx, $result, %as_voidptr($1)) != SWIG_OK) { - return 0; + return SWIG_ERROR; } } %enddef @@ -58,7 +58,7 @@ %define %scilab_varout_typemap(TYPEMAPTYPE, FRAGMENTNAME, CTYPE) %typemap(TYPEMAPTYPE, noblock=1, fragment="FRAGMENTNAME") CTYPE { if (FRAGMENTNAME(pvApiCtx, $result, $value) != SWIG_OK) { - return 0; + return SWIG_ERROR; } } %enddef @@ -66,7 +66,7 @@ %define %scilab_varoutptr_typemap(TYPEMAPTYPE, FRAGMENTNAME, CTYPE) %typemap(TYPEMAPTYPE, noblock=1, fragment="FRAGMENTNAME") CTYPE { if (FRAGMENTNAME(pvApiCtx, $result, %as_voidptr($value)) != SWIG_OK) { - return 0; + return SWIG_ERROR; } } %enddef @@ -74,7 +74,7 @@ %define %scilab_in_typemap(TYPEMAPTYPE, FRAGMENTNAME, CTYPE) %typemap(TYPEMAPTYPE, noblock=1, fragment="FRAGMENTNAME") CTYPE { if (FRAGMENTNAME(pvApiCtx, $input, &$1, fname) != SWIG_OK) { - return 0; + return SWIG_ERROR; } } %enddef @@ -87,7 +87,7 @@ * ----------------------------------------------------------------------------- */ %typemap(in, noblock=1, fragment=SWIG_AsVal_frag(Enum)) enum SWIGTYPE (int val) { if (SWIG_AsVal_dec(Enum)($input, &val) != SWIG_OK) { - return 0; + return SWIG_ERROR; } $1 = %reinterpret_cast(val, $ltype); }