Re: [patch] GtkScaleButton Methods
| From: | Bob Majdak Jr | Date: | Wed, 23 Jan 2008 13:26:09 +0000 |
| Subject: | Re: [patch] GtkScaleButton Methods | ||
| References: | 1 2 | Groups: | php.gtk.dev |
| Request: | Send a blank email to php-gtk-dev+get-4089@lists.php.net to get a copy of this message | ||
Using only GCC I would never notice (or care really :z). How do these other compilers feel about basic pointer arithmetic?
list = g_malloc0(sizeof(gchar *) * (listlen + 2));
//. space for not overwriting the head pointer and leaving a null on
//. the tail end.
---
gtk_scale_button_set_icons(
GTK_SCALE_BUTTON(button),
(const gchar **)(list+1)
);
---
if(list) {
g_strfreev(list);
}
Andrei Zmievski wrote:
Attachment: [text/x-patch] gtkscalebutton-methods-bob20080123a.diff
We shouldn't use C99's syntax, since not all compilers support it. I'm talking about initializing an array from a non-const value. -Andrei-- Bob Majdak Jr KateOS Rofflecopter Pilot http://www.kateos.org+ if(iconlist) + listlen = zend_hash_num_elements(Z_ARRVAL_P(iconlist)); + else + listlen = 0;++ gchar *list[listlen+1]; + iter = 0;
Attachment: [text/x-patch] gtkscalebutton-methods-bob20080123a.diff