[glib-networking/mcatanzaro/nonnull-compare] Fix -Wnonnull-compare warning




commit 2595bf00dec7b4ebb3866d82dbc285066e430886
Author: Michael Catanzaro <mcatanzaro redhat com>
Date:   Wed Oct 12 14:25:28 2022 -0500

    Fix -Wnonnull-compare warning
    
    [1/4] Compiling C object tls/tests/connection-gnutls.p/connection.c.o
    ../../../../Projects/glib-networking/tls/tests/connection.c: In function ‘clock_gettime’:
    ../../../../Projects/glib-networking/tls/tests/connection.c:600:16: warning: ‘nonnull’ argument ‘tp’ 
compared to NULL [-Wnonnull-compare]
      600 |   if (ret == 0 && tp)
          |       ~~~~~~~~~^~~~~
    
    Part-of: <https://gitlab.gnome.org/GNOME/glib-networking/-/merge_requests/224>

 tls/tests/connection.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/tls/tests/connection.c b/tls/tests/connection.c
index b008dcd6..94b335cd 100644
--- a/tls/tests/connection.c
+++ b/tls/tests/connection.c
@@ -597,7 +597,7 @@ clock_gettime (clockid_t        clk_id,
     }
 
   ret = original_clock_gettime (clk_id, tp);
-  if (ret == 0 && tp)
+  if (ret == 0)
     {
       tp->tv_sec += offset.tv_sec;
       tp->tv_nsec += offset.tv_nsec;


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