uint vs int

From: Date: Fri, 02 Sep 2005 09:47:07 +0000
Subject: uint vs int
Groups: php.gtk.dev 
Request: Send a blank email to php-gtk-dev+get-1579@lists.php.net to get a copy of this message
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

« previous php.gtk.dev (#1579) next »