diff options
author | Simon Marchetto <simon.marchetto@scilab-enterprises.com> | 2016-03-14 17:49:05 +0100 |
---|---|---|
committer | Simon Marchetto <simon.marchetto@scilab-enterprises.com> | 2016-03-14 17:49:05 +0100 |
commit | 2e556a4cda97f089c97dc0940de4735c41c9e680 (patch) | |
tree | 796d7c1a2cbb0a86959a793856d0dfb6f6b5dc54 /Lib/scilab | |
parent | 46a8acb5381e721923a5820b488cb5cd54fa926e (diff) | |
download | swig-2e556a4cda97f089c97dc0940de4735c41c9e680.tar.gz |
scilab: fix warnings
Diffstat (limited to 'Lib/scilab')
-rw-r--r-- | Lib/scilab/scicontainer.swg | 17 | ||||
-rw-r--r-- | Lib/scilab/scisequence.swg | 14 |
2 files changed, 15 insertions, 16 deletions
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<T>::asval(_seq, piSeqAddr, _index); - } - catch (std::exception& e) - { - SWIG_exception(SWIG_RuntimeError, e.what()); - } + return traits_asval_sequenceitem<T>::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 <typename T> struct traits_as_sequence { static int check(SwigSciObject obj) { - SWIG_Error(SWIG_TypeError, type_name<T>()); + throw std::invalid_argument("The container data type is not supported."); } static int get(SwigSciObject obj, void **sequence) { - SWIG_Error(SWIG_TypeError, type_name<T>()); + throw std::invalid_argument("The container data type is not supported."); } static int size(SwigSciObject obj, int *size) { - SWIG_Error(SWIG_TypeError, type_name<T>()); + throw std::invalid_argument("The container data type is not supported."); } }; template <typename T> struct traits_from_sequence { static int create(int size, void **sequence) { - SWIG_Error(SWIG_TypeError, type_name<T>()); + throw std::invalid_argument("The container data type is not supported."); } static SwigSciObject set(int size, void *sequence) { - SWIG_Error(SWIG_TypeError, type_name<T>()); + 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 <typename T> struct traits_asval_sequenceitem { static T asval(SwigSciObject obj, void *pSequence, int iItemIndex) { - SWIG_Error(SWIG_TypeError, type_name<T>()); + throw std::invalid_argument("The container data type is not supported."); } }; template <typename T> struct traits_from_sequenceitem { static int from(void *pSequence, int iItemIndex, T itemValue) { - SWIG_Error(SWIG_TypeError, type_name<T>()); + throw std::invalid_argument("The container data type is not supported."); } }; |