changeset 965:1bdf0f1b16c0

Use U suffix for unsigned defines Also fix a few small typos: value 2 (1<<1) weren't used in enums.
author Mikael Berthe <mikael@lilotux.net>
date Wed, 27 Sep 2006 22:57:23 +0200
parents 2c645e0a3304
children d9acb7f2a3d1
files mcabber/src/compl.h mcabber/src/jab_iq.c mcabber/src/jab_priv.h mcabber/src/roster.h
diffstat 4 files changed, 35 insertions(+), 35 deletions(-) [+]
line wrap: on
line diff
--- a/mcabber/src/compl.h	Tue Sep 19 19:08:09 2006 +0200
+++ b/mcabber/src/compl.h	Wed Sep 27 22:57:23 2006 +0200
@@ -3,23 +3,23 @@
 
 #include <glib.h>
 
-#define COMPL_CMD         (1<<0)
-#define COMPL_JID         (1<<2)
-#define COMPL_URLJID      (1<<3)  // Not implemented yet
-#define COMPL_NAME        (1<<4)  // Not implemented yet
-#define COMPL_STATUS      (1<<5)
-#define COMPL_FILENAME    (1<<6)  // Not implemented yet
-#define COMPL_ROSTER      (1<<7)
-#define COMPL_BUFFER      (1<<8)
-#define COMPL_GROUP       (1<<9)
-#define COMPL_GROUPNAME   (1<<10)
-#define COMPL_MULTILINE   (1<<11)
-#define COMPL_ROOM        (1<<12)
-#define COMPL_RESOURCE    (1<<13)
-#define COMPL_AUTH        (1<<14)
-#define COMPL_REQUEST     (1<<15)
-#define COMPL_EVENTS      (1<<16)
-#define COMPL_EVENTSID    (1<<17)
+#define COMPL_CMD         (1U<<0)
+#define COMPL_JID         (1U<<1)
+#define COMPL_URLJID      (1U<<2)   // Not implemented yet
+#define COMPL_NAME        (1U<<3)   // Not implemented yet
+#define COMPL_STATUS      (1U<<4)
+#define COMPL_FILENAME    (1U<<5)   // Not implemented yet
+#define COMPL_ROSTER      (1U<<6)
+#define COMPL_BUFFER      (1U<<7)
+#define COMPL_GROUP       (1U<<8)
+#define COMPL_GROUPNAME   (1U<<9)
+#define COMPL_MULTILINE   (1U<<10)
+#define COMPL_ROOM        (1U<<11)
+#define COMPL_RESOURCE    (1U<<12)
+#define COMPL_AUTH        (1U<<13)
+#define COMPL_REQUEST     (1U<<14)
+#define COMPL_EVENTS      (1U<<15)
+#define COMPL_EVENTSID    (1U<<16)
 
 void    compl_add_category_word(guint, const char *command);
 void    compl_del_category_word(guint categ, const char *word);
--- a/mcabber/src/jab_iq.c	Tue Sep 19 19:08:09 2006 +0200
+++ b/mcabber/src/jab_iq.c	Wed Sep 27 22:57:23 2006 +0200
@@ -136,7 +136,7 @@
     // could be freed.
     p = g_slist_next(p);
 
-    if ((!i->ts_expire && now_t > i->ts_create + IQS_MAX_TIMEOUT) ||
+    if ((!i->ts_expire && now_t > i->ts_create + (time_t)IQS_MAX_TIMEOUT) ||
         (i->ts_expire && now_t > i->ts_expire)) {
       iqs_callback(i->id, NULL, IQS_CONTEXT_TIMEOUT);
     }
--- a/mcabber/src/jab_priv.h	Tue Sep 19 19:08:09 2006 +0200
+++ b/mcabber/src/jab_priv.h	Wed Sep 27 22:57:23 2006 +0200
@@ -21,12 +21,12 @@
 };
 
 
-#define IQS_DEFAULT_TIMEOUT 90
-#define IQS_MAX_TIMEOUT     600
+#define IQS_DEFAULT_TIMEOUT 90U
+#define IQS_MAX_TIMEOUT     600U
 
-#define IQS_CONTEXT_RESULT  0   /* Normal result should be zero */
-#define IQS_CONTEXT_TIMEOUT 1
-#define IQS_CONTEXT_ERROR   2
+#define IQS_CONTEXT_RESULT  0U  /* Normal result should be zero */
+#define IQS_CONTEXT_TIMEOUT 1U
+#define IQS_CONTEXT_ERROR   2U
 
 extern enum enum_jstate jstate;
 
--- a/mcabber/src/roster.h	Tue Sep 19 19:08:09 2006 +0200
+++ b/mcabber/src/roster.h	Wed Sep 27 22:57:23 2006 +0200
@@ -41,10 +41,10 @@
 enum subscr {
   sub_none    = 0,
   sub_pending = 1,
-  sub_to      = 1 << 2,
-  sub_from    = 1 << 3,
+  sub_to      = 1 << 1,
+  sub_from    = 1 << 2,
   sub_both    = sub_to|sub_from,
-  sub_remove  = 1 << 4
+  sub_remove  = 1 << 3
 };
 
 enum findwhat {
@@ -61,17 +61,17 @@
 };
 
 // Roster_type is a set of flags, so values should be 2^n
-#define ROSTER_TYPE_USER    1
-#define ROSTER_TYPE_GROUP   2
-#define ROSTER_TYPE_AGENT   4
-#define ROSTER_TYPE_ROOM    8
-#define ROSTER_TYPE_SPECIAL 16
+#define ROSTER_TYPE_USER    1U
+#define ROSTER_TYPE_GROUP   (1U<<1)
+#define ROSTER_TYPE_AGENT   (1U<<2)
+#define ROSTER_TYPE_ROOM    (1U<<3)
+#define ROSTER_TYPE_SPECIAL (1U<<4)
 
 // Flags:
-#define ROSTER_FLAG_MSG     1   // Message not read
-#define ROSTER_FLAG_HIDE    2   // Group hidden (or buddy window closed)
-#define ROSTER_FLAG_LOCK    4   // Node should not be removed from buddylist
-// ROSTER_FLAG_LOCAL   8   // Buddy not on server's roster  (??)
+#define ROSTER_FLAG_MSG     1U      // Message not read
+#define ROSTER_FLAG_HIDE    (1U<<1) // Group hidden (or buddy window closed)
+#define ROSTER_FLAG_LOCK    (1U<<2) // Node should not be removed from buddylist
+// ROSTER_FLAG_LOCAL   (1U<<3) // Buddy not on server's roster  (??)
 
 extern GList *buddylist;
 extern GList *current_buddy;