Re: uint vs int
| From: | Andrei Zmievski | Date: | Fri, 02 Sep 2005 15:57:44 +0000 |
| Subject: | Re: uint vs int | ||
| References: | 1 | Groups: | php.gtk.dev |
| Request: | Send a blank email to php-gtk-dev+get-1580@lists.php.net to get a copy of this message | ||
You can change it to 'int'.
On Sep 2, 2005, at 2:47 AM, Steph wrote:
Hi Andrei,
In php_gtk+_types.c, you have:
static const uint STYLE_NUM_STATES = 5;
It's used to check the positive end of ranges in a couple of places against
a straight int, e.g.
if (index < 0 || index >= STYLE_NUM_STATES) {
and as a counter, again positive, in one place, e.g.
for (i = 0; i < STYLE_NUM_STATES; i++) {
The only reason I can see for it being declared as a uint at all is:
static int style_helper_count_elements(zval *object, long *count
TSRMLS_DC)
{
*count = STYLE_NUM_STATES;
return SUCCESS;
}
If you were planning to implement style_helper_count_elements() fully and
declare STYLE_NUM_STATES from there, uint would make some kind of sense. As
a constant, it makes no sense at all.
Can I kill it and get rid of my compiler warnings pliz?
- Steph
-- PHP-GTK Development Mailing List (http://gtk.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php