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/pygflags.c | |
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/pygflags.c')
-rw-r--r-- | gobject/pygflags.c | 24 |
1 files changed, 12 insertions, 12 deletions
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; |