summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2011-05-10 11:18:18 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2011-05-10 11:18:18 +0100
commitfb5b487d40f2e72c873672b66cf303c965656eba (patch)
treec9eee999a0d100871448cfc94af1bd940079b677
parent038022d83c2db084e23947c0392bc134122a9622 (diff)
this might be useful one daywip-sizes
-rw-r--r--dbus/dbus-gvalue-utils.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/dbus/dbus-gvalue-utils.c b/dbus/dbus-gvalue-utils.c
index 3413ecc..3ad20e8 100644
--- a/dbus/dbus-gvalue-utils.c
+++ b/dbus/dbus-gvalue-utils.c
@@ -30,6 +30,34 @@
#include <string.h>
#include <gobject/gvaluecollector.h>
+guint
+_dbus_g_typecode_fixed_get_size (char typecode)
+{
+ switch (typecode)
+ {
+ case DBUS_TYPE_BYTE:
+ return 1;
+
+ case DBUS_TYPE_BOOLEAN:
+ case DBUS_TYPE_INT32:
+ case DBUS_TYPE_UINT32:
+ return sizeof (dbus_uint32_t);
+
+ case DBUS_TYPE_INT16:
+ case DBUS_TYPE_UINT16:
+ return sizeof (dbus_uint16_t);
+
+ case DBUS_TYPE_DOUBLE:
+ return sizeof (double);
+
+ case DBUS_TYPE_INT64:
+ case DBUS_TYPE_UINT64:
+ return sizeof (dbus_uint64_t);
+
+ default:
+ return 0;
+ }
+}
static guint
fixed_type_get_size (GType type)