trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wka...@apache.org
Subject [trafficserver] branch 8.1.x updated: Fix clang compiler warnings. (#8051)
Date Thu, 08 Jul 2021 18:51:59 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/8.1.x by this push:
     new 8833d3d  Fix clang compiler warnings. (#8051)
8833d3d is described below

commit 8833d3d574a42039aaa6015042290323ce8ca498
Author: Walt Karas <wkaras@verizonmedia.com>
AuthorDate: Thu Jul 8 13:51:47 2021 -0500

    Fix clang compiler warnings. (#8051)
---
 include/tscore/Map.h                          | 4 ++--
 iocore/cache/P_CacheTest.h                    | 5 ++++-
 lib/tsconfig/TsBuilder.cc                     | 2 +-
 plugins/experimental/tls_bridge/tls_bridge.cc | 2 +-
 proxy/http/HttpTunnel.cc                      | 4 ++--
 src/wccp/WccpLocal.h                          | 2 +-
 6 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/include/tscore/Map.h b/include/tscore/Map.h
index 654af9c..ccff686 100644
--- a/include/tscore/Map.h
+++ b/include/tscore/Map.h
@@ -427,7 +427,7 @@ Vec<C, A, S>::move_internal(Vec<C, A, S> &vv)
   n = vv.n;
   i = vv.i;
   if (vv.v == &vv.e[0]) {
-    memcpy(e, &vv.e[0], sizeof(e));
+    memcpy(static_cast<void *>(e), &vv.e[0], sizeof(e));
     v = e;
   } else
     v = vv.v;
@@ -449,7 +449,7 @@ Vec<C, A, S>::copy(const Vec<C, A, S> &vv)
   n = vv.n;
   i = vv.i;
   if (vv.v == &vv.e[0]) {
-    memcpy(e, &vv.e[0], sizeof(e));
+    memcpy(static_cast<void *>(e), &vv.e[0], sizeof(e));
     v = e;
   } else {
     if (vv.v)
diff --git a/iocore/cache/P_CacheTest.h b/iocore/cache/P_CacheTest.h
index 3b369fd..3b656ca 100644
--- a/iocore/cache/P_CacheTest.h
+++ b/iocore/cache/P_CacheTest.h
@@ -44,7 +44,10 @@ struct PinnedDocTable : public Continuation {
   int remove(CacheKey *key);
   int cleanup(int event, Event *e);
 
-  PinnedDocTable() : Continuation(new_ProxyMutex()) { memset(bucket, 0, sizeof(Queue<PinnedDocEntry>)
* PINNED_DOC_TABLE_SIZE); }
+  PinnedDocTable() : Continuation(new_ProxyMutex())
+  {
+    memset(static_cast<void *>(bucket), 0, sizeof(Queue<PinnedDocEntry>) * PINNED_DOC_TABLE_SIZE);
+  }
 };
 
 struct CacheTestHost {
diff --git a/lib/tsconfig/TsBuilder.cc b/lib/tsconfig/TsBuilder.cc
index c174de1..9edd9fc 100644
--- a/lib/tsconfig/TsBuilder.cc
+++ b/lib/tsconfig/TsBuilder.cc
@@ -63,7 +63,7 @@ Builder::init() {
   // appropriate dispatch method.
 
   // Zero everything first, just to be safe.
-  memset(_dispatch, 0, sizeof(_dispatch));
+  memset(static_cast<void *>(_dispatch), 0, sizeof(_dispatch));
   memset(&_loc, 0, sizeof(_loc));
 
   for ( size_t i = 0 ; i < TS_CONFIG_N_EVENT_TYPES ; ++i) {
diff --git a/plugins/experimental/tls_bridge/tls_bridge.cc b/plugins/experimental/tls_bridge/tls_bridge.cc
index 0a699265..a6744c1 100644
--- a/plugins/experimental/tls_bridge/tls_bridge.cc
+++ b/plugins/experimental/tls_bridge/tls_bridge.cc
@@ -99,7 +99,7 @@ BridgeConfig::load_config(int argc, const char *argv[])
     if (i + 1 >= argc) {
       TSError("%s: Destination regular expression without peer", PLUGIN_TAG);
     } else {
-      if (r.compile(argv[i]), Regex::ANCHORED) {
+      if (r.compile(argv[i], Regex::ANCHORED)) {
         _items.emplace_back(argv[i], std::move(r), argv[i + 1]);
       } else {
         TSError("%s: Failed to compile regular expression '%s'", PLUGIN_TAG, argv[i]);
diff --git a/proxy/http/HttpTunnel.cc b/proxy/http/HttpTunnel.cc
index 1f7d210..1fc50ab 100644
--- a/proxy/http/HttpTunnel.cc
+++ b/proxy/http/HttpTunnel.cc
@@ -540,8 +540,8 @@ HttpTunnel::reset()
   call_sm       = false;
   num_producers = 0;
   num_consumers = 0;
-  memset(consumers, 0, sizeof(consumers));
-  memset(producers, 0, sizeof(producers));
+  memset(static_cast<void *>(consumers), 0, sizeof(consumers));
+  memset(static_cast<void *>(producers), 0, sizeof(producers));
 }
 
 void
diff --git a/src/wccp/WccpLocal.h b/src/wccp/WccpLocal.h
index 89dab2e..dc02613 100644
--- a/src/wccp/WccpLocal.h
+++ b/src/wccp/WccpLocal.h
@@ -3532,7 +3532,7 @@ AssignInfoComp::bucket(int idx) const
 }
 inline RouterViewComp::RouterViewComp() : m_cache_count(0)
 {
-  memset(m_cache_ids, 0, sizeof(m_cache_ids));
+  memset(static_cast<void *>(m_cache_ids), 0, sizeof(m_cache_ids));
 }
 
 inline CapComp::CapComp() {}

Mime
View raw message