diff options
author | Johan Dahlin <johan@gnome.org> | 2008-07-27 09:39:21 +0000 |
---|---|---|
committer | Johan Dahlin <johan@src.gnome.org> | 2008-07-27 09:39:21 +0000 |
commit | 37fe32b72d4b2530aaf28bd343c424898e45ab2c (patch) | |
tree | 065d4b705e476f72d282b0239bd31182e34eb15a /gobject | |
parent | 5ffb6e17bf5ea51abe9c9f440e7cfdd8920d143a (diff) | |
download | pygobject-37fe32b72d4b2530aaf28bd343c424898e45ab2c.tar.gz pygobject-37fe32b72d4b2530aaf28bd343c424898e45ab2c.tar.xz pygobject-37fe32b72d4b2530aaf28bd343c424898e45ab2c.zip |
Use _PyLong macros.
2008-07-27 Johan Dahlin <johan@gnome.org>
* gobject/gobjectmodule.c (pyg_param_spec_from_object),
(add_properties), (pyg_signal_new), (pyg_signal_list_ids),
(pyg_signal_lookup), (pyg_signal_query):
* gobject/pygenum.c (pyg_enum_richcompare), (pyg_enum_new),
(pyg_enum_from_gtype), (pyg_enum_add), (pyg_enum_reduce),
(pygobject_enum_register_types):
* gobject/pygflags.c (pyg_flags_richcompare), (pyg_flags_new),
(pyg_flags_from_gtype), (pyg_flags_add), (pyg_flags_and),
(pyg_flags_or), (pyg_flags_xor), (pygobject_flags_register_types):
* gobject/pygobject-private.h:
* gobject/pygobject.c (pygobject_disconnect_by_func),
(pygobject_handler_block_by_func),
(pygobject_handler_unblock_by_func), (pygobject_get_refcount):
* gobject/pygparamspec.c (pyg_param_spec_getattr):
* gobject/pygtype.c (_wrap_g_type_wrapper__get_depth),
(pyg_type_from_object), (pyg_enum_get_value),
(pyg_flags_get_value), (pyg_value_from_pyobject),
(pyg_value_as_pyobject):
Use _PyLong macros.
svn path=/trunk/; revision=884
Diffstat (limited to 'gobject')
-rw-r--r-- | gobject/gobjectmodule.c | 20 | ||||
-rw-r--r-- | gobject/pygenum.c | 20 | ||||
-rw-r--r-- | gobject/pygflags.c | 24 | ||||
-rw-r--r-- | gobject/pygobject-private.h | 4 | ||||
-rw-r--r-- | gobject/pygobject.c | 8 | ||||
-rw-r--r-- | gobject/pygparamspec.c | 16 | ||||
-rw-r--r-- | gobject/pygtype.c | 40 |
7 files changed, 66 insertions, 66 deletions
diff --git a/gobject/gobjectmodule.c b/gobject/gobjectmodule.c index d3e4097..0ec1382 100644 --- a/gobject/gobjectmodule.c +++ b/gobject/gobjectmodule.c @@ -784,7 +784,7 @@ pyg_param_spec_from_object (PyObject *tuple) } item = PyTuple_GetItem(tuple, val_length-1); - if (!PyInt_Check(item)) { + if (!_PyLong_Check(item)) { PyErr_SetString(PyExc_TypeError, "last element in tuple must be an int"); return NULL; @@ -794,7 +794,7 @@ pyg_param_spec_from_object (PyObject *tuple) slice = PySequence_GetSlice(tuple, 4, val_length-1); pspec = create_property(prop_name, prop_type, nick, blurb, slice, - PyInt_AsLong(item)); + _PyLong_AsLong(item)); return pspec; } @@ -858,13 +858,13 @@ add_properties (GType instance_type, PyObject *properties) break; } item = PyTuple_GetItem(value, val_length-1); - if (!PyInt_Check(item)) { + if (!_PyLong_Check(item)) { PyErr_SetString(PyExc_TypeError, "last element in __gproperties__ value tuple must be an int"); ret = FALSE; break; } - flags = PyInt_AsLong(item); + flags = _PyLong_AsLong(item); /* slice is the extra items in the tuple */ slice = PySequence_GetSlice(value, 3, val_length-1); @@ -1349,7 +1349,7 @@ pyg_signal_new(PyObject *self, PyObject *args) return_type, n_params, param_types); g_free(param_types); if (signal_id != 0) - return PyInt_FromLong(signal_id); + return _PyLong_FromLong(signal_id); PyErr_SetString(PyExc_RuntimeError, "could not create signal"); return NULL; } @@ -1450,7 +1450,7 @@ pyg_signal_list_ids (PyObject *self, PyObject *args, PyObject *kwargs) } for (i = 0; i < n; i++) - PyTuple_SetItem(list, i, PyInt_FromLong(ids[i])); + PyTuple_SetItem(list, i, _PyLong_FromLong(ids[i])); g_free(ids); if (class) g_type_class_unref(class); @@ -1498,7 +1498,7 @@ pyg_signal_lookup (PyObject *self, PyObject *args, PyObject *kwargs) g_type_class_unref(class); else g_type_default_interface_unref(iface); - return PyInt_FromLong(id); + return _PyLong_FromLong(id); } static PyObject * @@ -1586,10 +1586,10 @@ pyg_signal_query (PyObject *self, PyObject *args, PyObject *kwargs) goto done; } - PyTuple_SET_ITEM(py_query, 0, PyInt_FromLong(query.signal_id)); + PyTuple_SET_ITEM(py_query, 0, _PyLong_FromLong(query.signal_id)); PyTuple_SET_ITEM(py_query, 1, _PyUnicode_FromString(query.signal_name)); PyTuple_SET_ITEM(py_query, 2, pyg_type_wrapper_new(query.itype)); - PyTuple_SET_ITEM(py_query, 3, PyInt_FromLong(query.signal_flags)); + PyTuple_SET_ITEM(py_query, 3, _PyLong_FromLong(query.signal_flags)); PyTuple_SET_ITEM(py_query, 4, pyg_type_wrapper_new(query.return_type)); for (i = 0; i < query.n_params; i++) { PyTuple_SET_ITEM(params_list, i, @@ -2306,7 +2306,7 @@ pyg_set_object_has_new_constructor(GType type) g_type_set_qdata(type, pygobject_has_updated_constructor_key, GINT_TO_POINTER(1)); } -#define GET_INT(x) (((PyIntObject*)x)->ob_ival) +#define GET_INT(x) (((_PyLongObject*)x)->ob_ival) PyObject * pyg_integer_richcompare(PyObject *v, PyObject *w, int op) { diff --git a/gobject/pygenum.c b/gobject/pygenum.c index fadb7cf..bf40cc1 100644 --- a/gobject/pygenum.c +++ b/gobject/pygenum.c @@ -37,7 +37,7 @@ pyg_enum_richcompare(PyGEnum *self, PyObject *other, int op) { static char warning[256]; - if (!PyInt_Check(other)) { + if (!_PyLong_Check(other)) { Py_INCREF(Py_NotImplemented); return Py_NotImplemented; } @@ -132,7 +132,7 @@ pyg_enum_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) g_type_class_unref(eclass); - intvalue = PyInt_FromLong(value); + intvalue = _PyLong_FromLong(value); ret = PyDict_GetItem(values, intvalue); Py_DECREF(intvalue); Py_DECREF(values); @@ -155,12 +155,12 @@ pyg_enum_from_gtype (GType gtype, int value) if (pyclass == NULL) { pyclass = pyg_enum_add(NULL, g_type_name(gtype), NULL, gtype); if (!pyclass) - return PyInt_FromLong(value); + return _PyLong_FromLong(value); } values = PyDict_GetItemString(((PyTypeObject *)pyclass)->tp_dict, "__enum_values__"); - intvalue = PyInt_FromLong(value); + intvalue = _PyLong_FromLong(value); retval = PyDict_GetItem(values, intvalue); Py_DECREF(intvalue); if (!retval) { @@ -168,9 +168,9 @@ pyg_enum_from_gtype (GType gtype, int value) retval = ((PyTypeObject *)pyclass)->tp_alloc((PyTypeObject *)pyclass, 0); g_assert(retval != NULL); - ((PyIntObject*)retval)->ob_ival = value; + ((_PyLongObject*)retval)->ob_ival = value; ((PyGFlags*)retval)->gtype = gtype; - //return PyInt_FromLong(value); + //return _PyLong_FromLong(value); } Py_INCREF(retval); @@ -236,10 +236,10 @@ pyg_enum_add (PyObject * module, PyObject *item, *intval; item = ((PyTypeObject *)stub)->tp_alloc((PyTypeObject *)stub, 0); - ((PyIntObject*)item)->ob_ival = eclass->values[i].value; + ((_PyLongObject*)item)->ob_ival = eclass->values[i].value; ((PyGEnum*)item)->gtype = gtype; - intval = PyInt_FromLong(eclass->values[i].value); + intval = _PyLong_FromLong(eclass->values[i].value); PyDict_SetItem(values, intval, item); Py_DECREF(intval); @@ -270,7 +270,7 @@ pyg_enum_reduce(PyObject *self, PyObject *args) if (!PyArg_ParseTuple(args, ":GEnum.__reduce__")) return NULL; - return Py_BuildValue("(O(i)O)", self->ob_type, PyInt_AsLong(self), + return Py_BuildValue("(O(i)O)", self->ob_type, _PyLong_AsLong(self), PyObject_GetAttrString(self, "__dict__")); } @@ -327,7 +327,7 @@ pygobject_enum_register_types(PyObject *d) { pygenum_class_key = g_quark_from_static_string("PyGEnum::class"); - PyGEnum_Type.tp_base = &PyInt_Type; + PyGEnum_Type.tp_base = &_PyLong_Type; PyGEnum_Type.tp_repr = (reprfunc)pyg_enum_repr; PyGEnum_Type.tp_str = (reprfunc)pyg_enum_repr; PyGEnum_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE; diff --git a/gobject/pygflags.c b/gobject/pygflags.c index 3108378..f419161 100644 --- a/gobject/pygflags.c +++ b/gobject/pygflags.c @@ -33,14 +33,14 @@ GQuark pygflags_class_key; PYGLIB_DEFINE_TYPE("gobject.GFlags", PyGFlags_Type, PyGFlags); -#define GET_INT_VALUE(x) (((PyIntObject*)x)->ob_ival) +#define GET_INT_VALUE(x) (((_PyLongObject*)x)->ob_ival) static PyObject * pyg_flags_richcompare(PyGFlags *self, PyObject *other, int op) { static char warning[256]; - if (!PyInt_Check(other)) { + if (!_PyLong_Check(other)) { Py_INCREF(Py_NotImplemented); return Py_NotImplemented; } @@ -153,7 +153,7 @@ pyg_flags_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) g_type_class_unref(eclass); - pyint = PyInt_FromLong(value); + pyint = _PyLong_FromLong(value); ret = PyDict_GetItem(values, pyint); Py_DECREF(pyint); Py_DECREF(values); @@ -176,13 +176,13 @@ pyg_flags_from_gtype (GType gtype, int value) if (pyclass == NULL) { pyclass = pyg_flags_add(NULL, g_type_name(gtype), NULL, gtype); if (!pyclass) - return PyInt_FromLong(value); + return _PyLong_FromLong(value); } values = PyDict_GetItemString(((PyTypeObject *)pyclass)->tp_dict, "__flags_values__"); - pyint = PyInt_FromLong(value); + pyint = _PyLong_FromLong(value); retval = PyDict_GetItem(values, pyint); Py_DECREF(pyint); @@ -192,7 +192,7 @@ pyg_flags_from_gtype (GType gtype, int value) retval = ((PyTypeObject *)pyclass)->tp_alloc((PyTypeObject *)pyclass, 0); g_assert(retval != NULL); - ((PyIntObject*)retval)->ob_ival = value; + ((_PyLongObject*)retval)->ob_ival = value; ((PyGFlags*)retval)->gtype = gtype; } else { Py_INCREF(retval); @@ -257,10 +257,10 @@ pyg_flags_add (PyObject * module, PyObject *item, *intval; item = ((PyTypeObject *)stub)->tp_alloc((PyTypeObject *)stub, 0); - ((PyIntObject*)item)->ob_ival = eclass->values[i].value; + ((_PyLongObject*)item)->ob_ival = eclass->values[i].value; ((PyGFlags*)item)->gtype = gtype; - intval = PyInt_FromLong(eclass->values[i].value); + intval = _PyLong_FromLong(eclass->values[i].value); PyDict_SetItem(values, intval, item); Py_DECREF(intval); @@ -290,7 +290,7 @@ static PyObject * pyg_flags_and(PyGFlags *a, PyGFlags *b) { if (!PyGFlags_Check(a) || !PyGFlags_Check(b)) - return PyInt_Type.tp_as_number->nb_and((PyObject*)a, + return _PyLong_Type.tp_as_number->nb_and((PyObject*)a, (PyObject*)b); return pyg_flags_from_gtype(a->gtype, @@ -301,7 +301,7 @@ static PyObject * pyg_flags_or(PyGFlags *a, PyGFlags *b) { if (!PyGFlags_Check(a) || !PyGFlags_Check(b)) - return PyInt_Type.tp_as_number->nb_or((PyObject*)a, + return _PyLong_Type.tp_as_number->nb_or((PyObject*)a, (PyObject*)b); return pyg_flags_from_gtype(a->gtype, GET_INT_VALUE(a) | GET_INT_VALUE(b)); @@ -311,7 +311,7 @@ static PyObject * pyg_flags_xor(PyGFlags *a, PyGFlags *b) { if (!PyGFlags_Check(a) || !PyGFlags_Check(b)) - return PyInt_Type.tp_as_number->nb_xor((PyObject*)a, + return _PyLong_Type.tp_as_number->nb_xor((PyObject*)a, (PyObject*)b); return pyg_flags_from_gtype(a->gtype, @@ -466,7 +466,7 @@ pygobject_flags_register_types(PyObject *d) { pygflags_class_key = g_quark_from_static_string("PyGFlags::class"); - PyGFlags_Type.tp_base = &PyInt_Type; + PyGFlags_Type.tp_base = &_PyLong_Type; PyGFlags_Type.tp_repr = (reprfunc)pyg_flags_repr; PyGFlags_Type.tp_as_number = &pyg_flags_as_number; PyGFlags_Type.tp_str = (reprfunc)pyg_flags_repr; diff --git a/gobject/pygobject-private.h b/gobject/pygobject-private.h index aebe4c5..3d4f877 100644 --- a/gobject/pygobject-private.h +++ b/gobject/pygobject-private.h @@ -194,7 +194,7 @@ const gchar * pyg_constant_strip_prefix(const gchar *name, const gchar *strip_pr /* pygflags */ typedef struct { - PyIntObject parent; + _PyLongObject parent; GType gtype; } PyGFlags; @@ -213,7 +213,7 @@ extern PyObject * pyg_flags_from_gtype (GType gtype, #define PyGEnum_Check(x) (g_type_is_a(((PyGFlags*)x)->gtype, G_TYPE_ENUM)) typedef struct { - PyIntObject parent; + _PyLongObject parent; GType gtype; } PyGEnum; diff --git a/gobject/pygobject.c b/gobject/pygobject.c index 24fc4b2..720fad9 100644 --- a/gobject/pygobject.c +++ b/gobject/pygobject.c @@ -1827,7 +1827,7 @@ pygobject_disconnect_by_func(PyGObject *self, PyObject *args) 0, 0, closure, NULL, NULL); - return PyInt_FromLong(retval); + return _PyLong_FromLong(retval); } static PyObject * @@ -1859,7 +1859,7 @@ pygobject_handler_block_by_func(PyGObject *self, PyObject *args) 0, 0, closure, NULL, NULL); - return PyInt_FromLong(retval); + return _PyLong_FromLong(retval); } static PyObject * @@ -1891,7 +1891,7 @@ pygobject_handler_unblock_by_func(PyGObject *self, PyObject *args) 0, 0, closure, NULL, NULL); - return PyInt_FromLong(retval); + return _PyLong_FromLong(retval); } static PyMethodDef pygobject_methods[] = { @@ -1946,7 +1946,7 @@ pygobject_get_dict(PyGObject *self, void *closure) static PyObject * pygobject_get_refcount(PyGObject *self, void *closure) { - return PyInt_FromLong(self->obj->ref_count); + return _PyLong_FromLong(self->obj->ref_count); } static int diff --git a/gobject/pygparamspec.c b/gobject/pygparamspec.c index a6e225e..c52efeb 100644 --- a/gobject/pygparamspec.c +++ b/gobject/pygparamspec.c @@ -121,7 +121,7 @@ pyg_param_spec_getattr(PyGParamSpec *self, const gchar *attr) } else if (!strcmp(attr, "blurb") || !strcmp(attr, "__doc__")) { return Py_BuildValue("s", g_param_spec_get_blurb(pspec)); } else if (!strcmp(attr, "flags")) { - return PyInt_FromLong(pspec->flags); + return _PyLong_FromLong(pspec->flags); } else if (!strcmp(attr, "value_type")) { return pyg_type_wrapper_new(pspec->value_type); } else if (!strcmp(attr, "owner_type")) { @@ -138,9 +138,9 @@ pyg_param_spec_getattr(PyGParamSpec *self, const gchar *attr) return _PyUnicode_FromFormat( "%c", G_PARAM_SPEC_CHAR(pspec)->default_value); } else if (!strcmp(attr, "minimum")) { - return PyInt_FromLong(G_PARAM_SPEC_CHAR(pspec)->minimum); + return _PyLong_FromLong(G_PARAM_SPEC_CHAR(pspec)->minimum); } else if (!strcmp(attr, "maximum")) { - return PyInt_FromLong(G_PARAM_SPEC_CHAR(pspec)->maximum); + return _PyLong_FromLong(G_PARAM_SPEC_CHAR(pspec)->maximum); } } else if (G_IS_PARAM_SPEC_UCHAR(pspec)) { if (!strcmp(attr, "__members__")) { @@ -153,9 +153,9 @@ pyg_param_spec_getattr(PyGParamSpec *self, const gchar *attr) return _PyUnicode_FromFormat( "%c", G_PARAM_SPEC_UCHAR(pspec)->default_value); } else if (!strcmp(attr, "minimum")) { - return PyInt_FromLong(G_PARAM_SPEC_UCHAR(pspec)->minimum); + return _PyLong_FromLong(G_PARAM_SPEC_UCHAR(pspec)->minimum); } else if (!strcmp(attr, "maximum")) { - return PyInt_FromLong(G_PARAM_SPEC_UCHAR(pspec)->maximum); + return _PyLong_FromLong(G_PARAM_SPEC_UCHAR(pspec)->maximum); } } else if (G_IS_PARAM_SPEC_BOOLEAN(pspec)) { if (!strcmp(attr, "__members__")) { @@ -173,11 +173,11 @@ pyg_param_spec_getattr(PyGParamSpec *self, const gchar *attr) "flags", "maximum", "minimum", "name", "nick", "owner_type", "value_type"); } else if (!strcmp(attr, "default_value")) { - return PyInt_FromLong(G_PARAM_SPEC_INT(pspec)->default_value); + return _PyLong_FromLong(G_PARAM_SPEC_INT(pspec)->default_value); } else if (!strcmp(attr, "minimum")) { - return PyInt_FromLong(G_PARAM_SPEC_INT(pspec)->minimum); + return _PyLong_FromLong(G_PARAM_SPEC_INT(pspec)->minimum); } else if (!strcmp(attr, "maximum")) { - return PyInt_FromLong(G_PARAM_SPEC_INT(pspec)->maximum); + return _PyLong_FromLong(G_PARAM_SPEC_INT(pspec)->maximum); } } else if (G_IS_PARAM_SPEC_UINT(pspec)) { if (!strcmp(attr, "__members__")) { diff --git a/gobject/pygtype.c b/gobject/pygtype.c index 184b96b..d04b550 100644 --- a/gobject/pygtype.c +++ b/gobject/pygtype.c @@ -139,7 +139,7 @@ _wrap_g_type_wrapper__get_interfaces(PyGTypeWrapper *self, void *closure) static PyObject * _wrap_g_type_wrapper__get_depth(PyGTypeWrapper *self, void *closure) { - return PyInt_FromLong(g_type_depth(self->type)); + return _PyLong_FromLong(g_type_depth(self->type)); } static PyGetSetDef _PyGTypeWrapper_getsets[] = { @@ -323,7 +323,7 @@ pyg_type_from_object(PyObject *obj) if (PyType_Check(obj)) { PyTypeObject *tp = (PyTypeObject *)obj; - if (tp == &PyInt_Type) + if (tp == &_PyLong_Type) return G_TYPE_INT; else if (tp == &PyBool_Type) return G_TYPE_BOOLEAN; @@ -393,8 +393,8 @@ pyg_enum_get_value(GType enum_type, PyObject *obj, gint *val) if (!obj) { *val = 0; res = 0; - } else if (PyInt_Check(obj)) { - *val = PyInt_AsLong(obj); + } else if (_PyLong_Check(obj)) { + *val = _PyLong_AsLong(obj); res = 0; if (PyObject_TypeCheck(obj, &PyGEnum_Type) && ((PyGEnum *) obj)->gtype != enum_type) { @@ -456,8 +456,8 @@ pyg_flags_get_value(GType flag_type, PyObject *obj, gint *val) if (!obj) { *val = 0; res = 0; - } else if (PyInt_Check(obj)) { - *val = PyInt_AsLong(obj); + } else if (_PyLong_Check(obj)) { + *val = _PyLong_AsLong(obj); res = 0; } else if (PyLong_Check(obj)) { *val = PyLong_AsLongLong(obj); @@ -691,7 +691,7 @@ pyg_value_from_pyobject(GValue *value, PyObject *obj) g_value_set_boolean(value, PyObject_IsTrue(obj)); break; case G_TYPE_INT: - g_value_set_int(value, PyInt_AsLong(obj)); + g_value_set_int(value, _PyLong_AsLong(obj)); if (PyErr_Occurred()) { g_value_unset(value); PyErr_Clear(); @@ -700,10 +700,10 @@ pyg_value_from_pyobject(GValue *value, PyObject *obj) break; case G_TYPE_UINT: { - if (PyInt_Check(obj)) { + if (_PyLong_Check(obj)) { glong val; - val = PyInt_AsLong(obj); + val = _PyLong_AsLong(obj); if (val >= 0 && val <= G_MAXUINT) g_value_set_uint(value, (guint)val); else @@ -719,7 +719,7 @@ pyg_value_from_pyobject(GValue *value, PyObject *obj) } break; case G_TYPE_LONG: - g_value_set_long(value, PyInt_AsLong(obj)); + g_value_set_long(value, _PyLong_AsLong(obj)); if (PyErr_Occurred()) { g_value_unset(value); PyErr_Clear(); @@ -728,10 +728,10 @@ pyg_value_from_pyobject(GValue *value, PyObject *obj) break; case G_TYPE_ULONG: { - if (PyInt_Check(obj)) { + if (_PyLong_Check(obj)) { glong val; - val = PyInt_AsLong(obj); + val = _PyLong_AsLong(obj); if (val >= 0) g_value_set_ulong(value, (gulong)val); else @@ -755,8 +755,8 @@ pyg_value_from_pyobject(GValue *value, PyObject *obj) } break; case G_TYPE_UINT64: - if (PyInt_Check(obj)) - g_value_set_uint64(value, PyInt_AsLong(obj)); + if (_PyLong_Check(obj)) + g_value_set_uint64(value, _PyLong_AsLong(obj)); else if (PyLong_Check(obj)) g_value_set_uint64(value, PyLong_AsUnsignedLongLong(obj)); else @@ -926,7 +926,7 @@ pyg_value_as_pyobject(const GValue *value, gboolean copy_boxed) return PyBool_FromLong(g_value_get_boolean(value)); } case G_TYPE_INT: - return PyInt_FromLong(g_value_get_int(value)); + return _PyLong_FromLong(g_value_get_int(value)); case G_TYPE_UINT: { /* in Python, the Int object is backed by a long. If a @@ -934,19 +934,19 @@ pyg_value_as_pyobject(const GValue *value, gboolean copy_boxed) an Int. Otherwise, use a Long object to avoid overflow. This matches the ULongArg behavior in codegen/argtypes.h */ #if (G_MAXUINT <= G_MAXLONG) - return PyInt_FromLong((glong) g_value_get_uint(value)); + return _PyLong_FromLong((glong) g_value_get_uint(value)); #else return PyLong_FromUnsignedLong((gulong) g_value_get_uint(value)); #endif } case G_TYPE_LONG: - return PyInt_FromLong(g_value_get_long(value)); + return _PyLong_FromLong(g_value_get_long(value)); case G_TYPE_ULONG: { gulong val = g_value_get_ulong(value); if (val <= G_MAXLONG) - return PyInt_FromLong((glong) val); + return _PyLong_FromLong((glong) val); else return PyLong_FromUnsignedLong(val); } @@ -955,7 +955,7 @@ pyg_value_as_pyobject(const GValue *value, gboolean copy_boxed) gint64 val = g_value_get_int64(value); if (G_MINLONG <= val && val <= G_MAXLONG) - return PyInt_FromLong((glong) val); + return _PyLong_FromLong((glong) val); else return PyLong_FromLongLong(val); } @@ -964,7 +964,7 @@ pyg_value_as_pyobject(const GValue *value, gboolean copy_boxed) guint64 val = g_value_get_uint64(value); if (val <= G_MAXLONG) - return PyInt_FromLong((glong) val); + return _PyLong_FromLong((glong) val); else return PyLong_FromUnsignedLongLong(val); } |