gboolean is just int !
#include <stdbool.h> #include <stdio.h>#include <glib.h>
int main() { float f; gboolean gb; bool b;
f = 0.5f; gb = f; b = f;
printf("gboolean %d\n" "bool %d\n", (int)gb, (int)b);
return 0; }
Ouput :
gboolean 0 bool 1
0.5f is converted to int 0. But 0.5f is obsviously not zero and therefore should be evaluated as TRUE. So be carefull with gboolean.
NB: <stdbool.h>, bool, true and false are C99.