fix empty map bug
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6980 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
693487a845
commit
8dd4c07eeb
2 changed files with 12 additions and 12 deletions
|
|
@ -39,8 +39,8 @@
|
|||
|
||||
static PyObject *from(const map_type& map) {
|
||||
size_type size = map.size();
|
||||
int pysize = size <= INT_MAX ? (int) size : 0;
|
||||
if (!pysize) {
|
||||
int pysize = (size <= (size_type) INT_MAX) ? (int) size : -1;
|
||||
if (pysize < 0) {
|
||||
PyErr_SetString(PyExc_OverflowError,
|
||||
"map size not valid in python");
|
||||
Py_INCREF(Py_None);
|
||||
|
|
@ -89,8 +89,8 @@
|
|||
|
||||
PyObject* keys() {
|
||||
Map::size_type size = self->size();
|
||||
int pysize = size <= INT_MAX ? (int) size : 0;
|
||||
if (!pysize) {
|
||||
int pysize = (size <= (Map::size_type) INT_MAX) ? (int) size : -1;
|
||||
if (pysize < 0) {
|
||||
PyErr_SetString(PyExc_OverflowError,
|
||||
"map size not valid in python");
|
||||
Py_INCREF(Py_None);
|
||||
|
|
@ -106,8 +106,8 @@
|
|||
|
||||
PyObject* values() {
|
||||
Map::size_type size = self->size();
|
||||
int pysize = size <= INT_MAX ? (int) size : 0;
|
||||
if (!pysize) {
|
||||
int pysize = (size <= (Map::size_type) INT_MAX) ? (int) size : -1;
|
||||
if (pysize < 0) {
|
||||
PyErr_SetString(PyExc_OverflowError,
|
||||
"map size not valid in python");
|
||||
Py_INCREF(Py_None);
|
||||
|
|
@ -123,8 +123,8 @@
|
|||
|
||||
PyObject* items() {
|
||||
Map::size_type size = self->size();
|
||||
int pysize = size <= INT_MAX ? (int) size : 0;
|
||||
if (!pysize) {
|
||||
int pysize = (size <= (Map::size_type) INT_MAX) ? (int) size : -1;
|
||||
if (pysize < 0) {
|
||||
PyErr_SetString(PyExc_OverflowError,
|
||||
"map size not valid in python");
|
||||
Py_INCREF(Py_None);
|
||||
|
|
@ -145,8 +145,8 @@
|
|||
|
||||
PyObject* __iter__() {
|
||||
Map::size_type size = self->size();
|
||||
int pysize = size <= INT_MAX ? (int) size : 0;
|
||||
if (!pysize) {
|
||||
int pysize = (size <= (Map::size_type) INT_MAX) ? (int) size : -1;
|
||||
if (pysize < 0) {
|
||||
PyErr_SetString(PyExc_OverflowError,
|
||||
"map size not valid in python");
|
||||
Py_INCREF(Py_None);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue