summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2014-04-16 17:33:09 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2014-04-17 14:22:30 +0100
commit22ed228270e7e29e7ede985a198d5c675464be51 (patch)
treeff012fa7d3b06ba69afeff9c431721de960b82c4
parent683ba5e6c7268ac0bc10bdb0f03bd03dbe364732 (diff)
handle.h: make TpHandle exactly guint32
Remove its GType, because I don't think anyone ever used it, and strictly speaking there is no GType for guint32.
-rw-r--r--docs/reference/telepathy-glib/telepathy-glib-sections.txt1
-rw-r--r--telepathy-glib/handle-repo.h2
-rw-r--r--telepathy-glib/handle-set.c8
-rw-r--r--telepathy-glib/handle.h22
4 files changed, 14 insertions, 19 deletions
diff --git a/docs/reference/telepathy-glib/telepathy-glib-sections.txt b/docs/reference/telepathy-glib/telepathy-glib-sections.txt
index b6f97903c..855c45af9 100644
--- a/docs/reference/telepathy-glib/telepathy-glib-sections.txt
+++ b/docs/reference/telepathy-glib/telepathy-glib-sections.txt
@@ -1709,7 +1709,6 @@ tp_debug_timestamped_log_handler
<INCLUDE>telepathy-glib/telepathy-glib.h</INCLUDE>
<TITLE>handle</TITLE>
TpHandle
-TP_TYPE_HANDLE
TP_UNKNOWN_ENTITY_TYPE
tp_entity_type_is_valid
tp_entity_type_to_string
diff --git a/telepathy-glib/handle-repo.h b/telepathy-glib/handle-repo.h
index f5364c6fb..ac6399549 100644
--- a/telepathy-glib/handle-repo.h
+++ b/telepathy-glib/handle-repo.h
@@ -157,7 +157,7 @@ gchar *tp_handle_set_dump (const TpHandleSet *self) G_GNUC_WARN_UNUSED_RESULT;
* by entity type, where a null pointer means an unsupported handle
* type
* @entity_type: The entity type
- * @handles: A GArray of guint representing handles of the given type
+ * @handles: A GArray of guint32 representing handles of the given type
* @allow_zero: If %TRUE, zero is treated like a valid handle
* @error: Used to return an error if %FALSE is returned
*
diff --git a/telepathy-glib/handle-set.c b/telepathy-glib/handle-set.c
index ac91cdaef..7d61895b0 100644
--- a/telepathy-glib/handle-set.c
+++ b/telepathy-glib/handle-set.c
@@ -80,7 +80,7 @@ tp_handle_set_new (TpHandleRepoIface *repo)
/**
* tp_handle_set_new_from_array: (skip)
* @repo: #TpHandleRepoIface that holds the handles to be reffed by this set
- * @array: (element-type uint): array of handles to be referenced by this set
+ * @array: (element-type guint32): array of handles to be referenced by this set
*
* Creates a new #TpHandleSet
*
@@ -282,8 +282,8 @@ tp_handle_set_size (const TpHandleSet *set)
*
* <!--Returns: says it all, this comment is just to keep gtkdoc happy-->
*
- * Returns: (element-type uint): a newly-allocated GArray of guint representing
- * the handles in the set
+ * Returns: (element-type guint32): a newly-allocated GArray of guint32
+ * representing the handles in the set
*/
GArray *
tp_handle_set_to_array (const TpHandleSet *set)
@@ -475,7 +475,7 @@ gchar *
tp_handle_set_dump (const TpHandleSet *self)
{
TpIntsetFastIter iter;
- guint handle;
+ guint32 handle;
GString *string = g_string_new ("{ ");
tp_intset_fast_iter_init (&iter, self->intset);
diff --git a/telepathy-glib/handle.h b/telepathy-glib/handle.h
index aaff539c0..e8376b793 100644
--- a/telepathy-glib/handle.h
+++ b/telepathy-glib/handle.h
@@ -36,21 +36,17 @@ G_BEGIN_DECLS
* TpHandle:
*
* Type representing Telepathy handles within telepathy-glib.
- *
- * This is guint despite the wire protocol having 32-bit integers, because
- * dbus-glib expects GArrays of guint and so on. If the dbus-glib ABI changes
- * in future, telepathy-glib is likely to have a matching ABI change.
*/
-typedef guint TpHandle;
+typedef guint32 TpHandle;
-/**
- * TP_TYPE_HANDLE:
- *
- * The GType of a TpHandle, currently G_TYPE_UINT.
- *
- * This won't change unless in an ABI-incompatible version of telepathy-glib.
- */
-#define TP_TYPE_HANDLE G_TYPE_UINT
+#ifndef __GI_SCANNER__
+/* Lots of places in telepathy-glib, and Telepathy applications, assume
+ * that TpHandle is guint (its historical, dbus-glib-derived type).
+ * This is true on all currently relevant platforms. In the unlikely
+ * event that we find a platform where guint is larger than guint32,
+ * implementations will need to be changed. */
+G_STATIC_ASSERT (sizeof (guint) == sizeof (TpHandle));
+#endif
/**
* TP_UNKNOWN_ENTITY_TYPE: