diff --git a/auto/Wrap/libBornAgainCore.py b/auto/Wrap/libBornAgainCore.py index 9edbc33490779cda80469a2377afe9b8efc56b8a..1ed54f2c05c20355c5a78a7754a18841992ee09e 100644 --- a/auto/Wrap/libBornAgainCore.py +++ b/auto/Wrap/libBornAgainCore.py @@ -1,5 +1,5 @@ # This file was automatically generated by SWIG (http://www.swig.org). -# Version 4.0.1 +# Version 4.0.2 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. diff --git a/auto/Wrap/libBornAgainCore_wrap.cpp b/auto/Wrap/libBornAgainCore_wrap.cpp index 6c3c7ec63cb6ec5eafc2870a34df2639b6e15144..93033e5a9848bff418bc7de1b9677a3c8e11653a 100644 --- a/auto/Wrap/libBornAgainCore_wrap.cpp +++ b/auto/Wrap/libBornAgainCore_wrap.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.1 + * Version 4.0.2 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make @@ -809,15 +809,19 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { SWIGINTERN char* SWIG_Python_str_AsChar(PyObject *str) { -#if PY_VERSION_HEX >= 0x03000000 +#if PY_VERSION_HEX >= 0x03030000 + return (char *)PyUnicode_AsUTF8(str); +#elif PY_VERSION_HEX >= 0x03000000 char *newstr = 0; str = PyUnicode_AsUTF8String(str); if (str) { char *cstr; Py_ssize_t len; - PyBytes_AsStringAndSize(str, &cstr, &len); - newstr = (char *) malloc(len+1); - memcpy(newstr, cstr, len+1); + if (PyBytes_AsStringAndSize(str, &cstr, &len) != -1) { + newstr = (char *) malloc(len+1); + if (newstr) + memcpy(newstr, cstr, len+1); + } Py_XDECREF(str); } return newstr; @@ -826,10 +830,10 @@ SWIG_Python_str_AsChar(PyObject *str) #endif } -#if PY_VERSION_HEX >= 0x03000000 -# define SWIG_Python_str_DelForPy3(x) free( (void*) (x) ) +#if PY_VERSION_HEX >= 0x03030000 || PY_VERSION_HEX < 0x03000000 +# define SWIG_Python_str_DelForPy3(x) #else -# define SWIG_Python_str_DelForPy3(x) +# define SWIG_Python_str_DelForPy3(x) free( (void*) (x) ) #endif @@ -1244,6 +1248,19 @@ SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssi } } +SWIGINTERN int +SWIG_Python_CheckNoKeywords(PyObject *kwargs, const char *name) { + int no_kwargs = 1; + if (kwargs) { + assert(PyDict_Check(kwargs)); + if (PyDict_Size(kwargs) > 0) { + PyErr_Format(PyExc_TypeError, "%s() does not take keyword arguments", name); + no_kwargs = 0; + } + } + return no_kwargs; +} + /* A functor is a function object with one single object argument */ #define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL); @@ -1757,6 +1774,12 @@ SwigPyObject_TypeOnce(void) { #if PY_VERSION_HEX >= 0x03040000 0, /* tp_finalize */ #endif +#if PY_VERSION_HEX >= 0x03080000 + 0, /* tp_vectorcall */ +#endif +#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) + 0, /* tp_print */ +#endif #ifdef COUNT_ALLOCS 0, /* tp_allocs */ 0, /* tp_frees */ @@ -1918,6 +1941,12 @@ SwigPyPacked_TypeOnce(void) { #if PY_VERSION_HEX >= 0x03040000 0, /* tp_finalize */ #endif +#if PY_VERSION_HEX >= 0x03080000 + 0, /* tp_vectorcall */ +#endif +#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) + 0, /* tp_print */ +#endif #ifdef COUNT_ALLOCS 0, /* tp_allocs */ 0, /* tp_frees */ @@ -2244,8 +2273,10 @@ SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) } } #else - PyObject *key = SWIG_This(); - PyObject_SetAttr(inst, key, swig_this); + if (PyObject_SetAttr(inst, SWIG_This(), swig_this) == -1) { + Py_DECREF(inst); + inst = 0; + } #endif } } else { @@ -2257,8 +2288,12 @@ SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) inst = ((PyTypeObject *)data->newargs)->tp_new((PyTypeObject *)data->newargs, empty_args, empty_kwargs); Py_DECREF(empty_kwargs); if (inst) { - PyObject_SetAttr(inst, SWIG_This(), swig_this); - Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG; + if (PyObject_SetAttr(inst, SWIG_This(), swig_this) == -1) { + Py_DECREF(inst); + inst = 0; + } else { + Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG; + } } } Py_DECREF(empty_args); @@ -2275,25 +2310,21 @@ SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) return inst; } -SWIGRUNTIME void +SWIGRUNTIME int SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this) { - PyObject *dict; #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS) - PyObject **dictptr = _PyObject_GetDictPtr(inst); - if (dictptr != NULL) { - dict = *dictptr; - if (dict == NULL) { - dict = PyDict_New(); - *dictptr = dict; - } - PyDict_SetItem(dict, SWIG_This(), swig_this); - return; - } + PyObject **dictptr = _PyObject_GetDictPtr(inst); + if (dictptr != NULL) { + PyObject *dict = *dictptr; + if (dict == NULL) { + dict = PyDict_New(); + *dictptr = dict; + } + return PyDict_SetItem(dict, SWIG_This(), swig_this); + } #endif - dict = PyObject_GetAttrString(inst, "__dict__"); - PyDict_SetItem(dict, SWIG_This(), swig_this); - Py_DECREF(dict); + return PyObject_SetAttr(inst, SWIG_This(), swig_this); } @@ -2307,7 +2338,8 @@ SWIG_Python_InitShadowInstance(PyObject *args) { if (sthis) { SwigPyObject_append((PyObject*) sthis, obj[1]); } else { - SWIG_Python_SetSwigThis(obj[0], obj[1]); + if (SWIG_Python_SetSwigThis(obj[0], obj[1]) != 0) + return NULL; } return SWIG_Py_Void(); } @@ -3428,7 +3460,7 @@ static swig_module_info swig_module = {swig_types, 339, 0, 0, 0, 0}; #endif #define SWIG_name "_libBornAgainCore" -#define SWIGVERSION 0x040001 +#define SWIGVERSION 0x040002 #define SWIG_VERSION SWIGVERSION @@ -4166,11 +4198,20 @@ namespace swig { template <class Type> struct traits_asptr { static int asptr(PyObject *obj, Type **val) { - Type *p = 0; + int res = SWIG_ERROR; swig_type_info *descriptor = type_info<Type>(); - int res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; - if (SWIG_IsOK(res)) { - if (val) *val = p; + if (val) { + Type *p = 0; + int newmem = 0; + res = descriptor ? SWIG_ConvertPtrAndOwn(obj, (void **)&p, descriptor, 0, &newmem) : SWIG_ERROR; + if (SWIG_IsOK(res)) { + if (newmem & SWIG_CAST_NEW_MEMORY) { + res |= SWIG_NEWOBJMASK; + } + *val = p; + } + } else { + res = descriptor ? SWIG_ConvertPtr(obj, 0, descriptor, 0) : SWIG_ERROR; } return res; } @@ -5370,7 +5411,7 @@ namespace swig { struct container_owner { // By default, do not add the back-reference (for value types) // Specialization below will check the reference for pointer types. - static bool back_reference(PyObject* child, PyObject* owner) { + static bool back_reference(PyObject* /*child*/, PyObject* /*owner*/) { return false; } }; @@ -5387,8 +5428,7 @@ namespace swig { static bool back_reference(PyObject* child, PyObject* owner) { SwigPyObject* swigThis = SWIG_Python_GetSwigThis(child); if (swigThis && (swigThis->own & SWIG_POINTER_OWN) != SWIG_POINTER_OWN) { - PyObject_SetAttr(child, container_owner_attribute(), owner); - return true; + return PyObject_SetAttr(child, container_owner_attribute(), owner) != -1; } return false; } @@ -5892,7 +5932,7 @@ SWIG_AsVal_std_complex_Sl_double_Sg_ (PyObject *o, std::complex<double>* val) SWIGINTERNINLINE PyObject* -SWIG_From_std_complex_Sl_double_Sg_ (/*@SWIG:/usr/share/swig4.0/typemaps/swigmacros.swg,104,%ifcplusplus@*/ +SWIG_From_std_complex_Sl_double_Sg_ (/*@SWIG:/usr/local/share/swig/4.0.2/typemaps/swigmacros.swg,104,%ifcplusplus@*/ const std::complex<double>& @@ -6068,9 +6108,11 @@ SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) if (alloc) *alloc = SWIG_NEWOBJ; #endif - PyBytes_AsStringAndSize(obj, &cstr, &len); + if (PyBytes_AsStringAndSize(obj, &cstr, &len) == -1) + return SWIG_TypeError; #else - PyString_AsStringAndSize(obj, &cstr, &len); + if (PyString_AsStringAndSize(obj, &cstr, &len) == -1) + return SWIG_TypeError; #endif if (cptr) { if (alloc) { @@ -6445,7 +6487,7 @@ SWIGINTERN void std_vector_Sl_std_string_Sg__insert__SWIG_1(std::vector< std::st res = get_pair(first, second, val); } } else { - value_type *p; + value_type *p = 0; swig_type_info *descriptor = swig::type_info<value_type>(); res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; if (SWIG_IsOK(res) && val) *val = p; @@ -6607,7 +6649,7 @@ SWIGINTERN void std_vector_Sl_std_string_Sg__insert__SWIG_1(std::vector< std::st #endif res = traits_asptr_stdseq<map_type, std::pair<K, T> >::asptr(items, val); } else { - map_type *p; + map_type *p = 0; swig_type_info *descriptor = swig::type_info<map_type>(); res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR; if (SWIG_IsOK(res) && val) *val = p; @@ -138381,6 +138423,12 @@ extern "C" { #if PY_VERSION_HEX >= 0x03040000 0, /* tp_finalize */ #endif +#if PY_VERSION_HEX >= 0x03080000 + 0, /* tp_vectorcall */ +#endif +#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) + 0, /* tp_print */ +#endif #ifdef COUNT_ALLOCS 0, /* tp_allocs */ 0, /* tp_frees */ diff --git a/auto/Wrap/libBornAgainCore_wrap.h b/auto/Wrap/libBornAgainCore_wrap.h index 8fbe15520695e753a7dce723eac7ac3bdd8a19b2..03bab1484a299bbe427052758ddbf03c7ca168fe 100644 --- a/auto/Wrap/libBornAgainCore_wrap.h +++ b/auto/Wrap/libBornAgainCore_wrap.h @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.1 + * Version 4.0.2 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make diff --git a/auto/Wrap/swig_runtime.h b/auto/Wrap/swig_runtime.h index abc07c95740d46e9e4eb7d3bfbd4bfa71a1b9c11..2c4fcac1df35cbb0539ee3a9ddfc3a0645eeb96a 100644 --- a/auto/Wrap/swig_runtime.h +++ b/auto/Wrap/swig_runtime.h @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.1 + * Version 4.0.2 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make @@ -759,15 +759,19 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { SWIGINTERN char* SWIG_Python_str_AsChar(PyObject *str) { -#if PY_VERSION_HEX >= 0x03000000 +#if PY_VERSION_HEX >= 0x03030000 + return (char *)PyUnicode_AsUTF8(str); +#elif PY_VERSION_HEX >= 0x03000000 char *newstr = 0; str = PyUnicode_AsUTF8String(str); if (str) { char *cstr; Py_ssize_t len; - PyBytes_AsStringAndSize(str, &cstr, &len); - newstr = (char *) malloc(len+1); - memcpy(newstr, cstr, len+1); + if (PyBytes_AsStringAndSize(str, &cstr, &len) != -1) { + newstr = (char *) malloc(len+1); + if (newstr) + memcpy(newstr, cstr, len+1); + } Py_XDECREF(str); } return newstr; @@ -776,10 +780,10 @@ SWIG_Python_str_AsChar(PyObject *str) #endif } -#if PY_VERSION_HEX >= 0x03000000 -# define SWIG_Python_str_DelForPy3(x) free( (void*) (x) ) +#if PY_VERSION_HEX >= 0x03030000 || PY_VERSION_HEX < 0x03000000 +# define SWIG_Python_str_DelForPy3(x) #else -# define SWIG_Python_str_DelForPy3(x) +# define SWIG_Python_str_DelForPy3(x) free( (void*) (x) ) #endif @@ -1190,6 +1194,19 @@ SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssi } } +SWIGINTERN int +SWIG_Python_CheckNoKeywords(PyObject *kwargs, const char *name) { + int no_kwargs = 1; + if (kwargs) { + assert(PyDict_Check(kwargs)); + if (PyDict_Size(kwargs) > 0) { + PyErr_Format(PyExc_TypeError, "%s() does not take keyword arguments", name); + no_kwargs = 0; + } + } + return no_kwargs; +} + /* A functor is a function object with one single object argument */ #define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL); @@ -1703,6 +1720,12 @@ SwigPyObject_TypeOnce(void) { #if PY_VERSION_HEX >= 0x03040000 0, /* tp_finalize */ #endif +#if PY_VERSION_HEX >= 0x03080000 + 0, /* tp_vectorcall */ +#endif +#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) + 0, /* tp_print */ +#endif #ifdef COUNT_ALLOCS 0, /* tp_allocs */ 0, /* tp_frees */ @@ -1864,6 +1887,12 @@ SwigPyPacked_TypeOnce(void) { #if PY_VERSION_HEX >= 0x03040000 0, /* tp_finalize */ #endif +#if PY_VERSION_HEX >= 0x03080000 + 0, /* tp_vectorcall */ +#endif +#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) + 0, /* tp_print */ +#endif #ifdef COUNT_ALLOCS 0, /* tp_allocs */ 0, /* tp_frees */ @@ -2190,8 +2219,10 @@ SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) } } #else - PyObject *key = SWIG_This(); - PyObject_SetAttr(inst, key, swig_this); + if (PyObject_SetAttr(inst, SWIG_This(), swig_this) == -1) { + Py_DECREF(inst); + inst = 0; + } #endif } } else { @@ -2203,8 +2234,12 @@ SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) inst = ((PyTypeObject *)data->newargs)->tp_new((PyTypeObject *)data->newargs, empty_args, empty_kwargs); Py_DECREF(empty_kwargs); if (inst) { - PyObject_SetAttr(inst, SWIG_This(), swig_this); - Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG; + if (PyObject_SetAttr(inst, SWIG_This(), swig_this) == -1) { + Py_DECREF(inst); + inst = 0; + } else { + Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG; + } } } Py_DECREF(empty_args); @@ -2221,25 +2256,21 @@ SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) return inst; } -SWIGRUNTIME void +SWIGRUNTIME int SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this) { - PyObject *dict; #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS) - PyObject **dictptr = _PyObject_GetDictPtr(inst); - if (dictptr != NULL) { - dict = *dictptr; - if (dict == NULL) { - dict = PyDict_New(); - *dictptr = dict; - } - PyDict_SetItem(dict, SWIG_This(), swig_this); - return; - } -#endif - dict = PyObject_GetAttrString(inst, "__dict__"); - PyDict_SetItem(dict, SWIG_This(), swig_this); - Py_DECREF(dict); + PyObject **dictptr = _PyObject_GetDictPtr(inst); + if (dictptr != NULL) { + PyObject *dict = *dictptr; + if (dict == NULL) { + dict = PyDict_New(); + *dictptr = dict; + } + return PyDict_SetItem(dict, SWIG_This(), swig_this); + } +#endif + return PyObject_SetAttr(inst, SWIG_This(), swig_this); } @@ -2253,7 +2284,8 @@ SWIG_Python_InitShadowInstance(PyObject *args) { if (sthis) { SwigPyObject_append((PyObject*) sthis, obj[1]); } else { - SWIG_Python_SetSwigThis(obj[0], obj[1]); + if (SWIG_Python_SetSwigThis(obj[0], obj[1]) != 0) + return NULL; } return SWIG_Py_Void(); }