[Telepathy-commits] [telepathy-salut/master] Remove check that a SalutPresenceId is >= 0.

Will Thompson will.thompson at collabora.co.uk
Sun Jan 11 08:47:31 PST 2009


Even though C enums aren't guaranteed to be unsigned, if they happen to
be GCC helpfully warns about you checking they're non-negative.  #gcc
don't seem to think this is a bad thing.  I removed the positivity
check, because as the function's only caller (set_own_status) says, the
presence mixin has already validated the index, and it's being set from
an unsigned int anyway.
---
 src/salut-self.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/salut-self.c b/src/salut-self.c
index ff417e6..0a816bc 100644
--- a/src/salut-self.c
+++ b/src/salut-self.c
@@ -518,7 +518,7 @@ salut_self_set_presence (SalutSelf *self, SalutPresenceId status,
     const gchar *message, GError **error)
 {
 
-  g_assert (status >= 0 && status < SALUT_PRESENCE_NR_PRESENCES);
+  g_assert (status < SALUT_PRESENCE_NR_PRESENCES);
 
   self->status = status;
   g_free (self->status_message);
-- 
1.5.6.5




More information about the Telepathy-commits mailing list