summaryrefslogtreecommitdiff
path: root/gobject/gobjectmodule.c
diff options
context:
space:
mode:
authorJohan Dahlin <johan@gnome.org>2008-07-27 09:39:21 +0000
committerJohan Dahlin <johan@src.gnome.org>2008-07-27 09:39:21 +0000
commit37fe32b72d4b2530aaf28bd343c424898e45ab2c (patch)
tree065d4b705e476f72d282b0239bd31182e34eb15a /gobject/gobjectmodule.c
parent5ffb6e17bf5ea51abe9c9f440e7cfdd8920d143a (diff)
downloadpygobject-37fe32b72d4b2530aaf28bd343c424898e45ab2c.tar.gz
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/gobjectmodule.c')
-rw-r--r--gobject/gobjectmodule.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/gobject/gobjectmodule.c b/gobject/gobjectmodule.c
index d3e40976..0ec1382b 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)
{