[Telepathy-commits] [telepathy-glib/master] example CMs: use unsigned, not gboolean, for bitfields

Simon McVittie simon.mcvittie at collabora.co.uk
Wed Oct 15 02:40:44 PDT 2008


It turns out gboolean is actually signed, so it's not safe to use in a bitfield.
---
 examples/cm/channelspecific/room.c |    5 +++--
 examples/cm/echo/chan.c            |    5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/examples/cm/channelspecific/room.c b/examples/cm/channelspecific/room.c
index 11abc39..8e4a287 100644
--- a/examples/cm/channelspecific/room.c
+++ b/examples/cm/channelspecific/room.c
@@ -55,8 +55,9 @@ struct _ExampleCSHRoomChannelPrivate
   gchar *object_path;
   TpHandle handle;
 
-  gboolean closed:1;
-  gboolean disposed:1;
+  /* These are really booleans, but gboolean is signed. Thanks, GLib */
+  unsigned closed:1;
+  unsigned disposed:1;
 };
 
 
diff --git a/examples/cm/echo/chan.c b/examples/cm/echo/chan.c
index 47f7a49..37f55bb 100644
--- a/examples/cm/echo/chan.c
+++ b/examples/cm/echo/chan.c
@@ -55,8 +55,9 @@ struct _ExampleEchoChannelPrivate
   gchar *object_path;
   TpHandle handle;
 
-  gboolean closed:1;
-  gboolean disposed:1;
+  /* These are really booleans, but gboolean is signed. Thanks, GLib */
+  unsigned closed:1;
+  unsigned disposed:1;
 };
 
 static const char * example_echo_channel_interfaces[] = { NULL };
-- 
1.5.6.5




More information about the Telepathy-commits mailing list