Re: more GDK->GTK mapping

On  1 Mar, Havoc Pennington wrote:

> No. You don't want to use signed ints for bitfields, gboolean is a
> signed int.

 Why the heck is gboolean signed? This is a design mistake IMHO
 and should be rectified ASAP as a boolean is either TRUE or FALSE
 also known as 1 and 0, thus no negative values can happen. It's
 really a pity that boolean isn't an official type in C99 as it
 allows some assumptions to be made which would speed up the executables
 a bit since the compiler can optimize more.
 Anyways, using unsigned types whereever possible makes the compiler
 generate better code because it doesn't have to care about possible
 signedness, however for boolean values the difference might be tiny,
 yet the opportunity to use bitfields makes it interesting.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]