Re: uint vs int
| From: | Steph | Date: | Fri, 02 Sep 2005 17:42:42 +0000 |
| Subject: | Re: uint vs int | ||
| References: | 1 2 | Groups: | php.gtk.dev |
| Request: | Send a blank email to php-gtk-dev+get-1582@lists.php.net to get a copy of this message | ||
done
----- Original Message -----
From: "Andrei Zmievski" <andrei@gravitonic.com>
To: "Steph" <steph@zend.com>
Cc: "PHP-GTK dev" <php-gtk-dev@lists.php.net>
Sent: Friday, September 02, 2005 5:57 PM
Subject: Re: [PHP-GTK-DEV] uint vs int
> 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
>
> --
> PHP-GTK Development Mailing List (http://gtk.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>