[Pkg-telepathy-commits] [telepathy-glib-1] 192/212: handle.h: make TpHandle exactly guint32

Simon McVittie smcv at debian.org
Wed May 14 12:09:14 UTC 2014


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch debian
in repository telepathy-glib-1.

commit 2683bd88850633eaa2c069cb2f72a6e9a8e0cd34
Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date:   Wed Apr 16 17:33:09 2014 +0100

    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.
    
    Reviewed-by: Xavier Claessens <xavier.claessens at collabora.com>
    Bug: https://bugs.freedesktop.org/show_bug.cgi?id=77189
---
 .../telepathy-glib/telepathy-glib-sections.txt     |  1 -
 telepathy-glib/handle-repo.h                       |  2 +-
 telepathy-glib/handle-set.c                        |  8 ++++----
 telepathy-glib/handle.h                            | 22 +++++++++-------------
 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 b6f9790..855c45a 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 f5364c6..ac63995 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 ac91cda..7d61895 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 aaff539..e8376b7 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:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-telepathy/telepathy-glib-1.git



More information about the Pkg-telepathy-commits mailing list