You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bc...@apache.org on 2018/04/16 15:39:53 UTC

[trafficserver] branch master updated: Ran clang-tidy with modernize-use-bool-literals

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

bcall pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 5f433ac  Ran clang-tidy with modernize-use-bool-literals
5f433ac is described below

commit 5f433ac1da1c137c094e3502a8daa008bff93dae
Author: Bryan Call <bc...@apache.org>
AuthorDate: Fri Apr 13 14:46:35 2018 -0700

    Ran clang-tidy with modernize-use-bool-literals
---
 cmd/traffic_cache_tool/CacheDefs.cc | 4 ++--
 cmd/traffic_layout/file_system.cc   | 2 +-
 cmd/traffic_top/stats.h             | 2 +-
 iocore/net/I_NetVConnection.h       | 4 ++--
 iocore/net/P_NetVConnection.h       | 2 +-
 iocore/net/SSLNetVConnection.cc     | 4 ++--
 iocore/utils/diags.i                | 8 ++++----
 proxy/http/HttpCacheSM.h            | 4 ++--
 proxy/http/HttpSM.h                 | 4 ++--
 proxy/logging/LogFieldAliasMap.h    | 2 +-
 10 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/cmd/traffic_cache_tool/CacheDefs.cc b/cmd/traffic_cache_tool/CacheDefs.cc
index 7a682ae..d8f87f4 100644
--- a/cmd/traffic_cache_tool/CacheDefs.cc
+++ b/cmd/traffic_cache_tool/CacheDefs.cc
@@ -632,7 +632,7 @@ Stripe::walk_bucket_chain(int s)
                   << "seg " << s << " bucket " << b << std::endl;
       }
       if (i > 0) // i.e., not the first dir in the segment
-        b_bitset[i] = 1;
+        b_bitset[i] = true;
 
 #if 1
       if (!dir_valid(e) || !dir_offset(e)) {
@@ -781,7 +781,7 @@ Stripe::check_loop(int s)
       this->dir_init_segment(s);
       return 1;
     }
-    f_bitset[i] = 1;
+    f_bitset[i] = true;
     e           = dir_from_offset(i, seg);
   }
 
diff --git a/cmd/traffic_layout/file_system.cc b/cmd/traffic_layout/file_system.cc
index 94e894c..e3f5578 100644
--- a/cmd/traffic_layout/file_system.cc
+++ b/cmd/traffic_layout/file_system.cc
@@ -92,7 +92,7 @@ create_directory(const std::string &dir)
   ret  = mkdir(s.substr(0, pos).c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
   pos1 = pos + 1;
   // create directory one layer by one layer
-  while (1) {
+  while (true) {
     pos = s.find("/", pos1);
     if ((size_t)pos == s.npos) {
       break;
diff --git a/cmd/traffic_top/stats.h b/cmd/traffic_top/stats.h
index f35c163..767cf1e 100644
--- a/cmd/traffic_top/stats.h
+++ b/cmd/traffic_top/stats.h
@@ -454,7 +454,7 @@ public:
     pos += sizeof(constant::global) - 1;
 
     // find parts of the line
-    while (1) {
+    while (true) {
       size_t start     = response.find(constant::start, pos);
       size_t separator = response.find(constant::separator, pos);
       size_t end       = response.find(constant::end, pos);
diff --git a/iocore/net/I_NetVConnection.h b/iocore/net/I_NetVConnection.h
index 786915a..090711d 100644
--- a/iocore/net/I_NetVConnection.h
+++ b/iocore/net/I_NetVConnection.h
@@ -663,8 +663,8 @@ inline NetVConnection::NetVConnection()
   : AnnotatedVConnection(nullptr),
     attributes(0),
     thread(nullptr),
-    got_local_addr(0),
-    got_remote_addr(0),
+    got_local_addr(false),
+    got_remote_addr(false),
     is_internal_request(false),
     is_transparent(false),
     write_buffer_empty_event(0),
diff --git a/iocore/net/P_NetVConnection.h b/iocore/net/P_NetVConnection.h
index b6cd0b3..a815633 100644
--- a/iocore/net/P_NetVConnection.h
+++ b/iocore/net/P_NetVConnection.h
@@ -62,7 +62,7 @@ NetVConnection::get_local_addr()
     if ((ats_is_ip(&local_addr) && ats_ip_port_cast(&local_addr))                    // IP and has a port.
         || (ats_is_ip4(&local_addr) && INADDR_ANY != ats_ip4_addr_cast(&local_addr)) // IPv4
         || (ats_is_ip6(&local_addr) && !IN6_IS_ADDR_UNSPECIFIED(&local_addr.sin6.sin6_addr))) {
-      got_local_addr = 1;
+      got_local_addr = true;
     }
   }
   return &local_addr.sa;
diff --git a/iocore/net/SSLNetVConnection.cc b/iocore/net/SSLNetVConnection.cc
index e80d41f..7bc2bf1 100644
--- a/iocore/net/SSLNetVConnection.cc
+++ b/iocore/net/SSLNetVConnection.cc
@@ -514,7 +514,7 @@ SSLNetVConnection::net_read_io(NetHandler *nh, EThread *lthread)
         // the client hello message back into the standard read.vio
         // so it will get forwarded onto the origin server
         if (!this->getSSLHandShakeComplete()) {
-          this->sslHandShakeComplete = 1;
+          this->sslHandShakeComplete = true;
 
           // Copy over all data already read in during the SSL_accept
           // (the client hello message)
@@ -951,7 +951,7 @@ SSLNetVConnection::sslStartHandShake(int event, int &err)
       if (cc && SSLCertContext::OPT_TUNNEL == cc->opt) {
         if (this->is_transparent) {
           this->attributes     = HttpProxyPort::TRANSPORT_BLIND_TUNNEL;
-          sslHandShakeComplete = 1;
+          sslHandShakeComplete = true;
           SSL_free(this->ssl);
           this->ssl = nullptr;
           return EVENT_DONE;
diff --git a/iocore/utils/diags.i b/iocore/utils/diags.i
index 2ad28fe..007536c 100644
--- a/iocore/utils/diags.i
+++ b/iocore/utils/diags.i
@@ -52,10 +52,10 @@ reconfigure_diags()
 
   // read output routing values
   for (i = 0; i < DiagsLevel_Count; i++) {
-    c.outputs[i].to_stdout = 0;
-    c.outputs[i].to_stderr = 1;
-    c.outputs[i].to_syslog = 1;
-    c.outputs[i].to_diagslog = 1;
+    c.outputs[i].to_stdout = false;
+    c.outputs[i].to_stderr = true;
+    c.outputs[i].to_syslog = true;
+    c.outputs[i].to_diagslog = true;
   }
 
   //////////////////////////////
diff --git a/proxy/http/HttpCacheSM.h b/proxy/http/HttpCacheSM.h
index 78cef9d..23e0a9b 100644
--- a/proxy/http/HttpCacheSM.h
+++ b/proxy/http/HttpCacheSM.h
@@ -98,13 +98,13 @@ public:
   bool
   is_ram_cache_hit()
   {
-    return cache_read_vc ? (cache_read_vc->is_ram_cache_hit()) : 0;
+    return cache_read_vc ? (cache_read_vc->is_ram_cache_hit()) : false;
   }
 
   bool
   is_compressed_in_ram()
   {
-    return cache_read_vc ? (cache_read_vc->is_compressed_in_ram()) : 0;
+    return cache_read_vc ? (cache_read_vc->is_compressed_in_ram()) : false;
   }
 
   inline void
diff --git a/proxy/http/HttpSM.h b/proxy/http/HttpSM.h
index 7eca8d1..6cc5de3 100644
--- a/proxy/http/HttpSM.h
+++ b/proxy/http/HttpSM.h
@@ -680,14 +680,14 @@ inline void
 HttpSM::txn_hook_append(TSHttpHookID id, INKContInternal *cont)
 {
   api_hooks.append(id, cont);
-  hooks_set = 1;
+  hooks_set = true;
 }
 
 inline void
 HttpSM::txn_hook_prepend(TSHttpHookID id, INKContInternal *cont)
 {
   api_hooks.prepend(id, cont);
-  hooks_set = 1;
+  hooks_set = true;
 }
 
 inline APIHook *
diff --git a/proxy/logging/LogFieldAliasMap.h b/proxy/logging/LogFieldAliasMap.h
index 023d6a6..11c9401 100644
--- a/proxy/logging/LogFieldAliasMap.h
+++ b/proxy/logging/LogFieldAliasMap.h
@@ -86,7 +86,7 @@ public:
     BUFFER_TOO_SMALL,
   };
 
-  virtual int asInt(char *key, IntType *val, bool case_sensitive = 0) const = 0;
+  virtual int asInt(char *key, IntType *val, bool case_sensitive = false) const = 0;
   virtual int asString(IntType key, char *buf, size_t bufLen, size_t *numChars = nullptr) const = 0;
 };
 

-- 
To stop receiving notification emails like this one, please contact
bcall@apache.org.