diff options
author | John Ehresman <jpe@wingware.com> | 2010-04-16 15:08:54 -0400 |
---|---|---|
committer | John Ehresman <jpe@wingware.com> | 2010-04-16 15:08:54 -0400 |
commit | 7b5007d63a72ba6bb7f087a67af890bf987e42cb (patch) | |
tree | 0f2f156049003a8a04bbaeb8f4d4e88d9288abbf /glib | |
parent | 9debda32a5877b582e93592c9a2f750d1cac9c20 (diff) | |
download | pygobject-7b5007d63a72ba6bb7f087a67af890bf987e42cb.tar.gz |
Rename _PyLong macros to PYGLIB_PyLong
Diffstat (limited to 'glib')
-rw-r--r-- | glib/glibmodule.c | 14 | ||||
-rw-r--r-- | glib/pygiochannel.c | 20 | ||||
-rw-r--r-- | glib/pyglib-python-compat.h | 24 | ||||
-rw-r--r-- | glib/pyglib.c | 10 | ||||
-rw-r--r-- | glib/pygsource.c | 12 | ||||
-rw-r--r-- | glib/pygspawn.c | 18 |
6 files changed, 49 insertions, 49 deletions
diff --git a/glib/glibmodule.c b/glib/glibmodule.c index 39aa2382..80efb38c 100644 --- a/glib/glibmodule.c +++ b/glib/glibmodule.c @@ -80,7 +80,7 @@ get_handler_priority(gint *priority, PyObject *kwargs) return -1; } - *priority = _PyLong_AsLong(val); + *priority = PYGLIB_PyLong_AsLong(val); if (PyErr_Occurred()) { PyErr_Clear(); PyErr_SetString(PyExc_ValueError, "could not get priority value"); @@ -135,7 +135,7 @@ pyglib_idle_add(PyObject *self, PyObject *args, PyObject *kwargs) handler_id = g_idle_add_full(priority, _pyglib_handler_marshal, data, _pyglib_destroy_notify); - return _PyLong_FromLong(handler_id); + return PYGLIB_PyLong_FromLong(handler_id); } @@ -175,7 +175,7 @@ pyglib_timeout_add(PyObject *self, PyObject *args, PyObject *kwargs) handler_id = g_timeout_add_full(priority, interval, _pyglib_handler_marshal, data, _pyglib_destroy_notify); - return _PyLong_FromLong(handler_id); + return PYGLIB_PyLong_FromLong(handler_id); } static PyObject * @@ -214,7 +214,7 @@ pyglib_timeout_add_seconds(PyObject *self, PyObject *args, PyObject *kwargs) handler_id = g_timeout_add_seconds_full(priority, interval, _pyglib_handler_marshal, data, _pyglib_destroy_notify); - return _PyLong_FromLong(handler_id); + return PYGLIB_PyLong_FromLong(handler_id); } static gboolean @@ -305,7 +305,7 @@ pyglib_io_add_watch(PyObject *self, PyObject *args, PyObject *kwargs) (GDestroyNotify)_pyglib_destroy_notify); g_io_channel_unref(iochannel); - return _PyLong_FromLong(handler_id); + return PYGLIB_PyLong_FromLong(handler_id); } static PyObject * @@ -385,7 +385,7 @@ pyglib_child_watch_add(PyObject *unused, PyObject *args, PyObject *kwargs) Py_INCREF(child_data->data); id = g_child_watch_add_full(priority, pid, child_watch_func, child_data, child_watch_dnotify); - return _PyLong_FromLong(id); + return PYGLIB_PyLong_FromLong(id); } static PyObject * @@ -479,7 +479,7 @@ pyglib_get_user_special_dir(PyObject *unused, PyObject *args, PyObject *kwargs) static PyObject * pyglib_main_depth(PyObject *unused) { - return _PyLong_FromLong(g_main_depth()); + return PYGLIB_PyLong_FromLong(g_main_depth()); } static PyObject * diff --git a/glib/pygiochannel.c b/glib/pygiochannel.c index d588862e..0dea769c 100644 --- a/glib/pygiochannel.c +++ b/glib/pygiochannel.c @@ -92,7 +92,7 @@ py_io_channel_shutdown(PyGIOChannel* self, PyObject *args, PyObject *kwargs) if (pyglib_error_check(&error)) return NULL; - return _PyLong_FromLong(ret); + return PYGLIB_PyLong_FromLong(ret); } /* character encoding conversion involved functions. @@ -116,7 +116,7 @@ py_io_channel_set_buffer_size(PyGIOChannel* self, PyObject *args, PyObject *kwar static PyObject* py_io_channel_get_buffer_size(PyGIOChannel* self) { - return _PyLong_FromLong(g_io_channel_get_buffer_size(self->channel)); + return PYGLIB_PyLong_FromLong(g_io_channel_get_buffer_size(self->channel)); } static PyObject* @@ -137,7 +137,7 @@ py_io_channel_set_buffered(PyGIOChannel* self, PyObject *args, PyObject *kwargs) static PyObject* py_io_channel_get_buffered(PyGIOChannel* self) { - return _PyLong_FromLong(g_io_channel_get_buffered(self->channel)); + return PYGLIB_PyLong_FromLong(g_io_channel_get_buffered(self->channel)); } static PyObject* @@ -272,7 +272,7 @@ py_io_channel_write_chars(PyGIOChannel* self, PyObject *args, PyObject *kwargs) if (pyglib_error_check(&error)) return NULL; - return _PyLong_FromLong(count); + return PYGLIB_PyLong_FromLong(count); } static PyObject* @@ -335,7 +335,7 @@ py_io_channel_flush(PyGIOChannel* self) if (pyglib_error_check(&error)) return NULL; - return _PyLong_FromLong(status); + return PYGLIB_PyLong_FromLong(status); } static PyObject* @@ -354,19 +354,19 @@ py_io_channel_set_flags(PyGIOChannel* self, PyObject *args, PyObject *kwargs) if (pyglib_error_check(&error)) return NULL; - return _PyLong_FromLong(status); + return PYGLIB_PyLong_FromLong(status); } static PyObject* py_io_channel_get_flags(PyGIOChannel* self) { - return _PyLong_FromLong(g_io_channel_get_flags(self->channel)); + return PYGLIB_PyLong_FromLong(g_io_channel_get_flags(self->channel)); } static PyObject* py_io_channel_get_buffer_condition(PyGIOChannel* self) { - return _PyLong_FromLong(g_io_channel_get_buffer_condition(self->channel)); + return PYGLIB_PyLong_FromLong(g_io_channel_get_buffer_condition(self->channel)); } static PyObject* @@ -517,7 +517,7 @@ py_io_channel_win32_poll(PyObject *self, PyObject *args, PyObject *kwargs) pyfd = PyList_GET_ITEM(pyfds, i); ((PyGPollFD *) pyfd)->pollfd = pollfd[i]; } - return _PyLong_FromLong(result); + return PYGLIB_PyLong_FromLong(result); } static PyObject * @@ -631,7 +631,7 @@ py_io_channel_seek(PyGIOChannel* self, PyObject *args, PyObject *kwargs) if (pyglib_error_check(&error)) return NULL; - return _PyLong_FromLong(status); + return PYGLIB_PyLong_FromLong(status); } #if 0 // Not wrapped diff --git a/glib/pyglib-python-compat.h b/glib/pyglib-python-compat.h index 62c441e1..8fc28e4f 100644 --- a/glib/pyglib-python-compat.h +++ b/glib/pyglib-python-compat.h @@ -101,12 +101,12 @@ static int _pyglib_init_##modname(PyObject *module) #define PYGLIB_PyBytes_Size PyString_Size #define PYGLIB_PyBytes_Check PyString_Check -#define _PyLong_Check PyInt_Check -#define _PyLong_FromLong PyInt_FromLong -#define _PyLong_AsLong PyInt_AsLong -#define _PyLongObject PyIntObject -#define _PyLong_Type PyInt_Type -#define _PyLong_AS_LONG PyInt_AS_LONG +#define PYGLIB_PyLong_Check PyInt_Check +#define PYGLIB_PyLong_FromLong PyInt_FromLong +#define PYGLIB_PyLong_AsLong PyInt_AsLong +#define PYGLIB_PyLongObject PyIntObject +#define PYGLIB_PyLong_Type PyInt_Type +#define PYGLIB_PyLong_AS_LONG PyInt_AS_LONG #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) #ifndef PyVarObject_HEAD_INIT @@ -183,12 +183,12 @@ PyTypeObject symbol = { \ #define PYGLIB_PyUnicode_GET_SIZE PyUnicode_GET_SIZE #define PYGLIB_PyUnicode_Resize PyUnicode_Resize #define PYGLIB_PyUnicode_Type PyUnicode_Type -#define _PyLong_Check PyLong_Check -#define _PyLong_FromLong PyLong_FromLong -#define _PyLong_AsLong PyLong_AsLong -#define _PyLong_AS_LONG(o) PyLong_AS_LONG((PyObject*)(o)) -#define _PyLongObject PyLongObject -#define _PyLong_Type PyLong_Type +#define PYGLIB_PyLong_Check PyLong_Check +#define PYGLIB_PyLong_FromLong PyLong_FromLong +#define PYGLIB_PyLong_AsLong PyLong_AsLong +#define PYGLIB_PyLong_AS_LONG(o) PyLong_AS_LONG((PyObject*)(o)) +#define PYGLIB_PyLongObject PyLongObject +#define PYGLIB_PyLong_Type PyLong_Type #define PYGLIB_PyBytes_FromStringAndSize PyBytes_FromStringAndSize #define PYGLIB_PyBytes_Resize(o, len) _PyBytes_Resize(o, len) diff --git a/glib/pyglib.c b/glib/pyglib.c index 6b8ded21..48e0fc13 100644 --- a/glib/pyglib.c +++ b/glib/pyglib.c @@ -264,7 +264,7 @@ pyglib_error_check(GError **error) if (exception_table != NULL) { PyObject *item; - item = PyDict_GetItem(exception_table, _PyLong_FromLong((*error)->domain)); + item = PyDict_GetItem(exception_table, PYGLIB_PyLong_FromLong((*error)->domain)); if (item != NULL) exc_type = item; } @@ -280,7 +280,7 @@ pyglib_error_check(GError **error) PyObject_SetAttrString(exc_instance, "domain", Py_None); PyObject_SetAttrString(exc_instance, "code", - d=_PyLong_FromLong((*error)->code)); + d=PYGLIB_PyLong_FromLong((*error)->code)); Py_DECREF(d); if ((*error)->message) { @@ -351,7 +351,7 @@ pyglib_gerror_exception_check(GError **error) } py_code = PyObject_GetAttrString(value, "code"); - if (!py_code || !_PyLong_Check(py_code)) { + if (!py_code || !PYGLIB_PyLong_Check(py_code)) { bad_gerror_message = "glib.GError instances must have a 'code' int attribute"; Py_DECREF(py_message); Py_DECREF(py_domain); @@ -359,7 +359,7 @@ pyglib_gerror_exception_check(GError **error) } g_set_error(error, g_quark_from_string(PYGLIB_PyUnicode_AsString(py_domain)), - _PyLong_AsLong(py_code), PYGLIB_PyUnicode_AsString(py_message)); + PYGLIB_PyLong_AsLong(py_code), PYGLIB_PyUnicode_AsString(py_message)); Py_DECREF(py_message); Py_DECREF(py_code); @@ -397,7 +397,7 @@ pyglib_register_exception_for_domain(gchar *name, exception_table = PyDict_New(); PyDict_SetItem(exception_table, - _PyLong_FromLong(error_domain), + PYGLIB_PyLong_FromLong(error_domain), exception); return exception; diff --git a/glib/pygsource.c b/glib/pygsource.c index 5dabd3c2..77bf1cf0 100644 --- a/glib/pygsource.c +++ b/glib/pygsource.c @@ -109,7 +109,7 @@ pyg_source_attach(PyGSource *self, PyObject *args, PyObject *kwargs) } id = g_source_attach(self->source, context); - return _PyLong_FromLong(id); + return PYGLIB_PyLong_FromLong(id); } static PyObject * @@ -283,7 +283,7 @@ pyg_source_get_priority(PyGSource *self, void *closure) { CHECK_DESTROYED(self, NULL); - return _PyLong_FromLong(g_source_get_priority(self->source)); + return PYGLIB_PyLong_FromLong(g_source_get_priority(self->source)); } static int @@ -296,12 +296,12 @@ pyg_source_set_priority(PyGSource *self, PyObject *value, void *closure) return -1; } - if (!_PyLong_Check(value)) { + if (!PYGLIB_PyLong_Check(value)) { PyErr_SetString(PyExc_TypeError, "type mismatch"); return -1; } - g_source_set_priority(self->source, _PyLong_AsLong(value)); + g_source_set_priority(self->source, PYGLIB_PyLong_AsLong(value)); return 0; } @@ -339,7 +339,7 @@ pyg_source_get_id(PyGSource *self, void *closure) return NULL; } - return _PyLong_FromLong(g_source_get_id(self->source)); + return PYGLIB_PyLong_FromLong(g_source_get_id(self->source)); } static PyGetSetDef pyg_source_getsets[] = { @@ -426,7 +426,7 @@ pyg_source_prepare(GSource *source, gint *timeout) } ret = PyObject_IsTrue(PyTuple_GET_ITEM(t, 0)); - *timeout = _PyLong_AsLong(PyTuple_GET_ITEM(t, 1)); + *timeout = PYGLIB_PyLong_AsLong(PyTuple_GET_ITEM(t, 1)); if (*timeout == -1 && PyErr_Occurred()) { ret = FALSE; diff --git a/glib/pygspawn.c b/glib/pygspawn.c index 4483e07c..1bb7e137 100644 --- a/glib/pygspawn.c +++ b/glib/pygspawn.c @@ -32,12 +32,12 @@ struct _PyGChildSetupData { PyObject *data; }; -PYGLIB_DEFINE_TYPE("glib.Pid", PyGPid_Type, _PyLongObject) +PYGLIB_DEFINE_TYPE("glib.Pid", PyGPid_Type, PYGLIB_PyLongObject) static PyObject * pyg_pid_close(PyObject *self, PyObject *args, PyObject *kwargs) { - g_spawn_close_pid(_PyLong_AsLong(self)); + g_spawn_close_pid(PYGLIB_PyLong_AsLong(self)); Py_INCREF(Py_None); return Py_None; } @@ -50,8 +50,8 @@ static PyMethodDef pyg_pid_methods[] = { static void pyg_pid_free(PyObject *gpid) { - g_spawn_close_pid((GPid) _PyLong_AsLong(gpid)); - _PyLong_Type.tp_free((void *) gpid); + g_spawn_close_pid((GPid) PYGLIB_PyLong_AsLong(gpid)); + PYGLIB_PyLong_Type.tp_free((void *) gpid); } static int @@ -68,9 +68,9 @@ pyg_pid_new(GPid pid) return PyObject_CallMethod((PyObject*)&PyLong_Type, "__new__", "Oi", &PyGPid_Type, pid); #else - _PyLongObject *pygpid; + PYGLIB_PyLongObject *pygpid; - pygpid = PyObject_NEW(_PyLongObject, &PyGPid_Type); + pygpid = PyObject_NEW(PYGLIB_PyLongObject, &PyGPid_Type); pygpid->ob_ival = pid; return (PyObject *) pygpid; #endif @@ -229,21 +229,21 @@ pyglib_spawn_async(PyObject *object, PyObject *args, PyObject *kwargs) if (envp) g_free(envp); if (standard_input) - pystdin = _PyLong_FromLong(*standard_input); + pystdin = PYGLIB_PyLong_FromLong(*standard_input); else { Py_INCREF(Py_None); pystdin = Py_None; } if (standard_output) - pystdout = _PyLong_FromLong(*standard_output); + pystdout = PYGLIB_PyLong_FromLong(*standard_output); else { Py_INCREF(Py_None); pystdout = Py_None; } if (standard_error) - pystderr = _PyLong_FromLong(*standard_error); + pystderr = PYGLIB_PyLong_FromLong(*standard_error); else { Py_INCREF(Py_None); pystderr = Py_None; |