dbus/glib dbus-gparser.c, 1.6, 1.7 dbus-gutils.c, 1.7, 1.8 dbus-gvalue.c, 1.4, 1.5

Havoc Pennington hp@freedesktop.org
Thu Jan 27 19:06:58 PST 2005


Update of /cvs/dbus/dbus/glib
In directory gabe:/tmp/cvs-serv3500/glib

Modified Files:
	dbus-gparser.c dbus-gutils.c dbus-gvalue.c 
Log Message:
2005-01-27  Havoc Pennington  <hp@redhat.com>

	* dbus/dbus-arch-deps.h.in: add 16/32-bit types

	* configure.in: find the right type for 16 and 32 bit ints as well
	as 64

	* dbus/dbus-protocol.h (DBUS_TYPE_INT16, DBUS_TYPE_UINT16): add
	the 16-bit types so people don't have to stuff them in 32-bit or
	byte arrays.



Index: dbus-gparser.c
===================================================================
RCS file: /cvs/dbus/dbus/glib/dbus-gparser.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- dbus-gparser.c	10 Aug 2004 03:07:00 -0000	1.6
+++ dbus-gparser.c	28 Jan 2005 03:06:56 -0000	1.7
@@ -437,6 +437,10 @@
 {
   if (strcmp (str, "string") == 0)
     return DBUS_TYPE_STRING;
+  else if (strcmp (str, "int16") == 0)
+    return DBUS_TYPE_INT16;
+  else if (strcmp (str, "uint16") == 0)
+    return DBUS_TYPE_UINT16;
   else if (strcmp (str, "int32") == 0)
     return DBUS_TYPE_INT32;
   else if (strcmp (str, "uint32") == 0)

Index: dbus-gutils.c
===================================================================
RCS file: /cvs/dbus/dbus/glib/dbus-gutils.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- dbus-gutils.c	15 Jan 2005 07:15:38 -0000	1.7
+++ dbus-gutils.c	28 Jan 2005 03:06:56 -0000	1.8
@@ -88,6 +88,10 @@
       return "boolean";
     case DBUS_TYPE_BYTE:
       return "byte";
+    case DBUS_TYPE_INT16:
+      return "int16";
+    case DBUS_TYPE_UINT16:
+      return "uint16";
     case DBUS_TYPE_INT32:
       return "int32";
     case DBUS_TYPE_UINT32:

Index: dbus-gvalue.c
===================================================================
RCS file: /cvs/dbus/dbus/glib/dbus-gvalue.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- dbus-gvalue.c	17 Jan 2005 19:49:52 -0000	1.4
+++ dbus-gvalue.c	28 Jan 2005 03:06:56 -0000	1.5
@@ -40,12 +40,29 @@
   switch (dbus_message_iter_get_arg_type (iter))
     {
       MAP_BASIC (BOOLEAN, BOOLEAN);
-      MAP_BASIC (BYTE, UCHAR);
-      MAP_BASIC (INT32, INT);
-      MAP_BASIC (UINT32, UINT);
-      MAP_BASIC (INT64, INT64);
-      MAP_BASIC (UINT64, UINT64);
-      MAP_BASIC (DOUBLE, DOUBLE);
+      MAP_BASIC (BYTE,    UCHAR);
+      MAP_BASIC (INT32,   INT);
+      MAP_BASIC (UINT32,  UINT);
+      MAP_BASIC (INT64,   INT64);
+      MAP_BASIC (UINT64,  UINT64);
+      MAP_BASIC (DOUBLE,  DOUBLE);
+
+    case DBUS_TYPE_INT16:
+      {
+        dbus_int16_t v;
+        g_value_init (value, G_TYPE_INT);
+        dbus_message_iter_get_basic (iter, &v);
+        g_value_set_int (value, v);
+      }
+      break;
+    case DBUS_TYPE_UINT16:
+      {
+        dbus_uint16_t v;
+        g_value_init (value, G_TYPE_UINT);
+        dbus_message_iter_get_basic (iter, &v);
+        g_value_set_uint (value, v);
+      }
+      break;
       
     case DBUS_TYPE_STRING:
     case DBUS_TYPE_OBJECT_PATH:



More information about the dbus-commit mailing list