You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by so...@apache.org on 2017/05/01 23:25:16 UTC

[trafficserver] 01/05: TS-4823: gcc ordered comparison of pointer with integer zero warnings

This is an automated email from the ASF dual-hosted git repository.

sorber pushed a commit to branch 6.2.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 075330de688901026c01185332f8a2cd46bc970c
Author: Bryan Call <bc...@apache.org>
AuthorDate: Wed Sep 7 14:33:25 2016 -0700

    TS-4823: gcc ordered comparison of pointer with integer zero warnings
    
    (cherry picked from commit 42fe41475a5062d0bee692bf9ba7be76f1e447f1)
    
     Conflicts:
    	mgmt/utils/MgmtSocket.cc
    	proxy/http/remap/RemapPluginInfo.cc
---
 iocore/cluster/ClusterCache.cc      | 4 ++--
 mgmt/utils/MgmtSocket.cc            | 2 +-
 proxy/Main.cc                       | 2 +-
 proxy/http/remap/RemapPluginInfo.cc | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/iocore/cluster/ClusterCache.cc b/iocore/cluster/ClusterCache.cc
index 41346cc..fa4d47b 100644
--- a/iocore/cluster/ClusterCache.cc
+++ b/iocore/cluster/ClusterCache.cc
@@ -437,7 +437,7 @@ CacheContinuation::do_op(Continuation *c, ClusterMachine *mp, void *args, int us
   }
   case CACHE_OPEN_WRITE:
   case CACHE_OPEN_READ: {
-    ink_release_assert(c > 0);
+    ink_release_assert(c != NULL);
     //////////////////////
     // Use short format //
     //////////////////////
@@ -500,7 +500,7 @@ CacheContinuation::do_op(Continuation *c, ClusterMachine *mp, void *args, int us
 
   case CACHE_OPEN_READ_LONG:
   case CACHE_OPEN_WRITE_LONG: {
-    ink_release_assert(c > 0);
+    ink_release_assert(c != NULL);
     //////////////////////
     // Use long format  //
     //////////////////////
diff --git a/mgmt/utils/MgmtSocket.cc b/mgmt/utils/MgmtSocket.cc
index 563328a..c7e3d05 100644
--- a/mgmt/utils/MgmtSocket.cc
+++ b/mgmt/utils/MgmtSocket.cc
@@ -89,7 +89,7 @@ mgmt_fopen(const char *filename, const char *mode)
     // no leak here as f will be returned if it is > 0
     // coverity[overwrite_var]
     f = ::fopen(filename, mode);
-    if (f > 0)
+    if (f != NULL)
       return f;
     if (!mgmt_transient_error())
       break;
diff --git a/proxy/Main.cc b/proxy/Main.cc
index de2ab6b..5452825 100644
--- a/proxy/Main.cc
+++ b/proxy/Main.cc
@@ -539,7 +539,7 @@ cmd_list(char * /* cmd ATS_UNUSED */)
 
   Note("Cache Storage:");
   Store tStore;
-  if (tStore.read_config() < 0) {
+  if (tStore.read_config() != NULL) {
     Note("config read failure");
     return CMD_FAILED;
   } else {
diff --git a/proxy/http/remap/RemapPluginInfo.cc b/proxy/http/remap/RemapPluginInfo.cc
index 8bd08d6..e5f209e 100644
--- a/proxy/http/remap/RemapPluginInfo.cc
+++ b/proxy/http/remap/RemapPluginInfo.cc
@@ -39,7 +39,7 @@ remap_plugin_info::remap_plugin_info(char *_path)
 {
   // coverity did not see ats_free
   // coverity[ctor_dtor_leak]
-  if (_path && likely((path = ats_strdup(_path)) > 0))
+  if (_path && likely((path = ats_strdup(_path)) != NULL))
     path_size = strlen(path);
 }
 

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.