From 42fe41475a5062d0bee692bf9ba7be76f1e447f1 Mon Sep 17 00:00:00 2001 From: Bryan Call Date: Wed, 7 Sep 2016 14:33:25 -0700 Subject: [PATCH] TS-4823: gcc ordered comparison of pointer with integer zero warnings --- 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 8c9399e18d4..2fb3ad6b05a 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 0f308ba246b..d50817454df 100644 --- a/mgmt/utils/MgmtSocket.cc +++ b/mgmt/utils/MgmtSocket.cc @@ -91,7 +91,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()) { diff --git a/proxy/Main.cc b/proxy/Main.cc index bbb30c251e1..c60b00d89b4 100644 --- a/proxy/Main.cc +++ b/proxy/Main.cc @@ -542,7 +542,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 6468d4dc993..9f12c187478 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); } }