From 2e556a4cda97f089c97dc0940de4735c41c9e680 Mon Sep 17 00:00:00 2001 From: Simon Marchetto Date: Mon, 14 Mar 2016 17:49:05 +0100 Subject: scilab: fix warnings --- Lib/scilab/scicontainer.swg | 17 ++++++++--------- Lib/scilab/scisequence.swg | 14 +++++++------- 2 files changed, 15 insertions(+), 16 deletions(-) (limited to 'Lib/scilab') diff --git a/Lib/scilab/scicontainer.swg b/Lib/scilab/scicontainer.swg index 529d27888..2cc44b8e5 100644 --- a/Lib/scilab/scicontainer.swg +++ b/Lib/scilab/scicontainer.swg @@ -60,14 +60,7 @@ namespace swig operator T () const { - try - { - return traits_asval_sequenceitem::asval(_seq, piSeqAddr, _index); - } - catch (std::exception& e) - { - SWIG_exception(SWIG_RuntimeError, e.what()); - } + return traits_asval_sequenceitem::asval(_seq, piSeqAddr, _index); } SciSequence_Ref& operator=(const T& v) @@ -391,14 +384,19 @@ namespace swig { } else { - return true; + return SWIG_ERROR; } } catch (std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); + return SWIG_ERROR; } } + else + { + return SWIG_ERROR; + } } }; @@ -438,6 +436,7 @@ namespace swig { catch (std::exception& e) { SWIG_exception(SWIG_RuntimeError, e.what()); + return SWIG_ERROR; } } }; diff --git a/Lib/scilab/scisequence.swg b/Lib/scilab/scisequence.swg index cc9da1fab..5fe0fdbe2 100644 --- a/Lib/scilab/scisequence.swg +++ b/Lib/scilab/scisequence.swg @@ -47,21 +47,21 @@ namespace swig { // Error returned for sequence containers of default item type template struct traits_as_sequence { static int check(SwigSciObject obj) { - SWIG_Error(SWIG_TypeError, type_name()); + throw std::invalid_argument("The container data type is not supported."); } static int get(SwigSciObject obj, void **sequence) { - SWIG_Error(SWIG_TypeError, type_name()); + throw std::invalid_argument("The container data type is not supported."); } static int size(SwigSciObject obj, int *size) { - SWIG_Error(SWIG_TypeError, type_name()); + throw std::invalid_argument("The container data type is not supported."); } }; template struct traits_from_sequence { static int create(int size, void **sequence) { - SWIG_Error(SWIG_TypeError, type_name()); + throw std::invalid_argument("The container data type is not supported."); } static SwigSciObject set(int size, void *sequence) { - SWIG_Error(SWIG_TypeError, type_name()); + throw std::invalid_argument("The container data type is not supported."); } }; @@ -136,12 +136,12 @@ namespace swig { // Error returned for sequence containers of default item type template struct traits_asval_sequenceitem { static T asval(SwigSciObject obj, void *pSequence, int iItemIndex) { - SWIG_Error(SWIG_TypeError, type_name()); + throw std::invalid_argument("The container data type is not supported."); } }; template struct traits_from_sequenceitem { static int from(void *pSequence, int iItemIndex, T itemValue) { - SWIG_Error(SWIG_TypeError, type_name()); + throw std::invalid_argument("The container data type is not supported."); } }; -- cgit v1.2.1