[Bug 51356] Fix C warnings in the Telepathy tests library

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Jul 30 12:55:28 CEST 2012


https://bugs.freedesktop.org/show_bug.cgi?id=51356

--- Comment #4 from Simon McVittie <simon.mcvittie at collabora.co.uk> 2012-07-30 10:55:28 UTC ---
Comment on attachment 64939
  --> https://bugs.freedesktop.org/attachment.cgi?id=64939
Fix C warnings in the Telepathy tests library (updated)

Review of attachment 64939:
 --> (https://bugs.freedesktop.org/page.cgi?id=splinter.html&bug=51356&attachment=64939)
-----------------------------------------------------------------

::: tests/lib/contact-list-manager.c
@@ +512,4 @@
>  
>  static void
>  status_changed_cb (TpBaseConnection *conn,
> +                   TpConnectionStatus status,

Given that the formal signature of the signal is (guint, guint), I would prefer
not to have this part of the diff. What makes it necessary?

::: tests/lib/room-list-chan.c
@@ +125,4 @@
>    TpBaseChannelClass *base_class = TP_BASE_CHANNEL_CLASS (klass);
>    GParamSpec *spec;
>    static TpDBusPropertiesMixinPropImpl room_list_props[] = {
> +      { "Server", (gpointer) "server", NULL, },

Is the const-strings compiler flag actually ever useful? Does it detect bugs,
or just force us to add pointless casts?

In general more strictness > less strictness, but also, no casts > casts.
Because C doesn't have C++'s const_cast<>, sprinkling casts throughout your
source makes it less type-safe than it would otherwise have been. I don't think
that really helps anyone.

If there's a cast here, I would prefer it to be (gchar *) or (char *).

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA Contact for the bug.
You are the assignee for the bug.



More information about the telepathy-bugs mailing list