fix compilation warnings
authorJohannes Wienke <languitar@semipol.de>
Sat, 07 Feb 2015 22:15:08 +0100
changeset 658 352d622c2401
parent 657 481df170aff2
child 659 761839714ea3
fix compilation warnings * Make LmLogLevelFlags a typedef to GLogLevelFlags to avoid implicit casting * Remove a useless comparison of an unsigned int < 0
loudmouth/lm-debug.h
loudmouth/lm-old-socket.c
--- a/loudmouth/lm-debug.h	Tue Feb 03 18:17:09 2015 +0100
+++ b/loudmouth/lm-debug.h	Sat Feb 07 22:15:08 2015 +0100
@@ -23,18 +23,17 @@
 
 #include <glib.h>
 
-typedef enum {
-    LM_LOG_LEVEL_VERBOSE = 1 << (G_LOG_LEVEL_USER_SHIFT),
-    LM_LOG_LEVEL_NET     = 1 << (G_LOG_LEVEL_USER_SHIFT + 1),
-    LM_LOG_LEVEL_PARSER  = 1 << (G_LOG_LEVEL_USER_SHIFT + 2),
-    LM_LOG_LEVEL_SSL     = 1 << (G_LOG_LEVEL_USER_SHIFT + 3),
-    LM_LOG_LEVEL_SASL    = 1 << (G_LOG_LEVEL_USER_SHIFT + 4),
-    LM_LOG_LEVEL_ALL     = (LM_LOG_LEVEL_NET |
-                            LM_LOG_LEVEL_VERBOSE |
-                            LM_LOG_LEVEL_PARSER |
-                            LM_LOG_LEVEL_SSL |
-                            LM_LOG_LEVEL_SASL)
-} LmLogLevelFlags;
+#define LM_LOG_LEVEL_VERBOSE (1 << (G_LOG_LEVEL_USER_SHIFT))
+#define LM_LOG_LEVEL_NET     (1 << (G_LOG_LEVEL_USER_SHIFT + 1))
+#define LM_LOG_LEVEL_PARSER  (1 << (G_LOG_LEVEL_USER_SHIFT + 2))
+#define LM_LOG_LEVEL_SSL     (1 << (G_LOG_LEVEL_USER_SHIFT + 3))
+#define LM_LOG_LEVEL_SASL    (1 << (G_LOG_LEVEL_USER_SHIFT + 4))
+#define LM_LOG_LEVEL_ALL     (LM_LOG_LEVEL_NET | \
+                              LM_LOG_LEVEL_VERBOSE | \
+                              LM_LOG_LEVEL_PARSER | \
+                              LM_LOG_LEVEL_SSL | \
+                              LM_LOG_LEVEL_SASL)
+typedef GLogLevelFlags LmLogLevelFlags;
 
 #ifndef LM_LOG_DOMAIN
 #  define LM_LOG_DOMAIN "LM"
--- a/loudmouth/lm-old-socket.c	Tue Feb 03 18:17:09 2015 +0100
+++ b/loudmouth/lm-old-socket.c	Sat Feb 07 22:15:08 2015 +0100
@@ -212,7 +212,7 @@
                                           NULL);
     }
 
-    if (status != G_IO_STATUS_NORMAL || *bytes_read < 0) {
+    if (status != G_IO_STATUS_NORMAL) {
         switch (status) {
         case G_IO_STATUS_EOF:
             *reason = LM_DISCONNECT_REASON_HUP;