[gupnp/gupnp-1.0] Fix bitwise ! and logical &



commit 47b1010beb3a1942e150373dc53642501e3dca8b
Author: Jens Georg <mail jensge org>
Date:   Fri Sep 22 21:49:05 2017 +0200

    Fix bitwise ! and logical &
    
    Use parentheses to make logic operator clear from bitwise

 libgupnp/gupnp-linux-context-manager.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/libgupnp/gupnp-linux-context-manager.c b/libgupnp/gupnp-linux-context-manager.c
index 441a2db..9ec0491 100644
--- a/libgupnp/gupnp-linux-context-manager.c
+++ b/libgupnp/gupnp-linux-context-manager.c
@@ -328,12 +328,12 @@ network_device_up (NetworkInterface *device)
 static void
 network_device_down (NetworkInterface *device)
 {
-        if (!device->flags & NETWORK_INTERFACE_UP)
+        if (!(device->flags & NETWORK_INTERFACE_UP))
                 return;
 
         device->flags &= ~NETWORK_INTERFACE_UP;
 
-        if (device->contexts)
+        if (device->contexts != NULL)
                 g_hash_table_foreach (device->contexts,
                                       context_signal_down,
                                       device->manager);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]