diff options
author | Johan Dahlin <johan@src.gnome.org> | 2005-10-03 17:11:32 +0000 |
---|---|---|
committer | Johan Dahlin <johan@src.gnome.org> | 2005-10-03 17:11:32 +0000 |
commit | 1ebd0c41b3add52a799367784ef600272fc4fa20 (patch) | |
tree | a6289f3e06d9945e4808f2a9c8b96e4d4e4ef2e5 | |
parent | 58b8e1bad9f32da988dda1330d8b880d26596c3f (diff) | |
download | pygtk-1ebd0c41b3add52a799367784ef600272fc4fa20.tar.gz |
Fix gcc 4.0 warnings.
* gobject/pygobject.c: (PyGProps_length):
* gtk/gdk.defs:
* gtk/gdk.override:
* gtk/gtk.defs:
* gtk/gtk.override:
Fix gcc 4.0 warnings.
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | gobject/pygobject.c | 4 | ||||
-rw-r--r-- | gtk/gdk.defs | 4 | ||||
-rw-r--r-- | gtk/gdk.override | 23 | ||||
-rw-r--r-- | gtk/gtk.defs | 5 | ||||
-rw-r--r-- | gtk/gtk.override | 9 |
6 files changed, 35 insertions, 19 deletions
@@ -1,5 +1,14 @@ 2005-10-03 Johan Dahlin <jdahlin@async.com.br> + * gobject/pygobject.c: (PyGProps_length): + * gtk/gdk.defs: + * gtk/gdk.override: + * gtk/gtk.defs: + * gtk/gtk.override: + Fix gcc 4.0 warnings. + +2005-10-03 Johan Dahlin <jdahlin@async.com.br> + reviewed by: <delete if not using a buddy> * gobject/pygobject.c: (pygobject_get_property), diff --git a/gobject/pygobject.c b/gobject/pygobject.c index 398d915b..da2e6101 100644 --- a/gobject/pygobject.c +++ b/gobject/pygobject.c @@ -337,13 +337,13 @@ static int PyGProps_length(PyGProps *self) { GObjectClass *class; - int n_props; + guint n_props; class = g_type_class_ref(self->gtype); g_object_class_list_properties(class, &n_props); g_type_class_unref(class); - return n_props; + return (int)n_props; } static PySequenceMethods _PyGProps_as_sequence = { diff --git a/gtk/gdk.defs b/gtk/gdk.defs index 6df92994..dfd237e2 100644 --- a/gtk/gdk.defs +++ b/gtk/gdk.defs @@ -2400,7 +2400,7 @@ (return-type "GdkBitmap*") (parameters '("GdkDrawable*" "drawable" (null-ok)) - '("const-guchar*" "data") + '("const-gchar*" "data") '("gint" "width") '("gint" "height") ) @@ -2411,7 +2411,7 @@ (return-type "GdkPixmap*") (parameters '("GdkDrawable*" "drawable" (null-ok)) - '("const-guchar*" "data") + '("const-gchar*" "data") '("gint" "width") '("gint" "height") '("gint" "depth") diff --git a/gtk/gdk.override b/gtk/gdk.override index d145d378..205acaa1 100644 --- a/gtk/gdk.override +++ b/gtk/gdk.override @@ -2223,7 +2223,7 @@ _wrap_gdk_gc_set_dashes(PyGObject *self, PyObject *args) { gint dash_offset, n, i; PyObject *list; - guchar *dash_list; + gint8 *dash_list; if (!PyArg_ParseTuple(args, "iO:GdkGC.set_dashes", &dash_offset, &list)) return NULL; @@ -2232,7 +2232,7 @@ _wrap_gdk_gc_set_dashes(PyGObject *self, PyObject *args) return NULL; } n = PySequence_Length(list); - dash_list = g_new(char, n); + dash_list = g_new(gint8, n); for (i = 0; i < n; i++) { PyObject *item = PySequence_GetItem(list, i); Py_DECREF(item); @@ -2242,7 +2242,7 @@ _wrap_gdk_gc_set_dashes(PyGObject *self, PyObject *args) g_free(dash_list); return NULL; } - dash_list[i] = (guchar)PyInt_AsLong(item); + dash_list[i] = (gint8)PyInt_AsLong(item); if (dash_list[i] == 0) { PyErr_SetString(PyExc_TypeError, "sequence member must not be 0"); g_free(dash_list); @@ -2346,7 +2346,8 @@ _wrap_gdk_property_get(PyGObject *self, PyObject *args, PyObject *kwargs) switch (aformat) { case 8: - if ((pdata = PyString_FromStringAndSize(data, alength)) == NULL) + if ((pdata = PyString_FromStringAndSize((char*)data, + alength)) == NULL) return NULL; break; case 16: { @@ -2442,7 +2443,7 @@ _wrap_gdk_property_change(PyGObject *self, PyObject *args, PyObject *kwargs) PyErr_SetString(PyExc_TypeError, "data not a string and format=8"); return NULL; } - data = PyString_AsString(pdata); + data = (guchar*)PyString_AsString(pdata); nelements = PyString_Size(pdata); break; case 16: { @@ -2840,7 +2841,7 @@ _wrap_gdk_pixbuf_get_pixels(PyGObject *self) return NULL; } - return PyString_FromStringAndSize(pixels, rowstride*height); + return PyString_FromStringAndSize((char*)pixels, rowstride*height); } %% override gdk_pixbuf_save kwargs @@ -3273,7 +3274,7 @@ _wrap_gdk_pixbuf_new_from_data(PyObject *self, PyObject *args, gboolean has_alpha; gint data_len, bits_per_sample, width, height, rowstride; gint required_len; - gchar *data_copy; + guchar *data_copy; GdkPixbuf *pixbuf; PyObject *ret; @@ -3295,9 +3296,9 @@ _wrap_gdk_pixbuf_new_from_data(PyObject *self, PyObject *args, return PyErr_NoMemory(); memcpy(data_copy, data, required_len); pixbuf = gdk_pixbuf_new_from_data(data_copy, colorspace, has_alpha, - bits_per_sample, width, height, - rowstride, - (GdkPixbufDestroyNotify )g_free, NULL); + bits_per_sample, width, height, + rowstride, + (GdkPixbufDestroyNotify )g_free, NULL); ret = pygobject_new((GObject *)pixbuf); g_object_unref(pixbuf); return ret; @@ -3318,7 +3319,7 @@ _wrap_gdk_pixbuf_new_from_array(PyObject *self, PyObject *args, gboolean has_alpha; gint width, height; gint i, j, nc, rs, st0, st1, st2; - gchar *src, *dst; + guchar *src, *dst; if (!have_numpy()) return NULL; diff --git a/gtk/gtk.defs b/gtk/gtk.defs index 48c7a88d..449f5b59 100644 --- a/gtk/gtk.defs +++ b/gtk/gtk.defs @@ -4129,6 +4129,11 @@ (return-type "none") ) +(define-virtual get_active_text + (of-object "GtkComboBox") + (return-type "char*") +) + ;; From /opt/gtk2/include/gtk-2.0/gtk/gtkcomboboxentry.h (define-function gtk_combo_box_entry_get_type diff --git a/gtk/gtk.override b/gtk/gtk.override index 5edf2f14..2cd4d21c 100644 --- a/gtk/gtk.override +++ b/gtk/gtk.override @@ -362,8 +362,8 @@ _wrap_gtk_selection_data__get_data(PyGObject *self, void *closure) { if (pyg_boxed_get(self, GtkSelectionData)->length >= 0) { return PyString_FromStringAndSize( - pyg_boxed_get(self, GtkSelectionData)->data, - pyg_boxed_get(self, GtkSelectionData)->length); + (char*)pyg_boxed_get(self, GtkSelectionData)->data, + pyg_boxed_get(self, GtkSelectionData)->length); } else { Py_INCREF(Py_None); return Py_None; @@ -398,9 +398,10 @@ override gtk_selection_data_get_text noargs static PyObject * _wrap_gtk_selection_data_get_text(PyObject *self) { - guchar *ret; + gchar *ret; - ret = gtk_selection_data_get_text(pyg_boxed_get(self, GtkSelectionData)); + ret = (char*)gtk_selection_data_get_text(pyg_boxed_get(self, + GtkSelectionData)); if (ret) { PyObject *py_ret = PyUnicode_DecodeUTF8(ret, strlen(ret), "strict"); g_free(ret); |