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

jiashunzhu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-brpc.git


The following commit(s) were added to refs/heads/master by this push:
     new 9186202  clear no trival copy-assignment warning
     new 69e2d2a  Merge pull request #1427 from 
guodongxiaren/clear_warning_no_trivial_copy_assignment
9186202 is described below

commit 9186202059edc831c4ffb7cd094818c2f28c7930
Author: guodongxiaren <879231...@qq.com>
AuthorDate: Wed Jun 9 22:17:08 2021 +0800

    clear no trival copy-assignment warning
---
 src/brpc/policy/rtmp_protocol.cpp          | 4 ++--
 src/bthread/fd.cpp                         | 2 +-
 src/butil/object_pool_inl.h                | 2 +-
 src/butil/resource_pool_inl.h              | 2 +-
 src/butil/third_party/rapidjson/document.h | 4 ++--
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/brpc/policy/rtmp_protocol.cpp 
b/src/brpc/policy/rtmp_protocol.cpp
index 2e7d509..33a0c0c 100644
--- a/src/brpc/policy/rtmp_protocol.cpp
+++ b/src/brpc/policy/rtmp_protocol.cpp
@@ -733,7 +733,7 @@ RtmpContext::RtmpContext(const RtmpClientOptions* copt, 
const Server* server)
     _free_ms_ids.reserve(32);
     CHECK_EQ(0, _mstream_map.init(1024, 70));
     CHECK_EQ(0, _trans_map.init(1024, 70));
-    memset(_cstream_ctx, 0, sizeof(_cstream_ctx));
+    memset(static_cast<void*>(_cstream_ctx), 0, sizeof(_cstream_ctx));
 }
     
 RtmpContext::~RtmpContext() {
@@ -809,7 +809,7 @@ RtmpUnsentMessage::AppendAndDestroySelf(butil::IOBuf* out, 
Socket* s) {
 }
 
 RtmpContext::SubChunkArray::SubChunkArray() {
-    memset(ptrs, 0, sizeof(ptrs));
+    memset(static_cast<void*>(ptrs), 0, sizeof(ptrs));
 }
 
 RtmpContext::SubChunkArray::~SubChunkArray() {
diff --git a/src/bthread/fd.cpp b/src/bthread/fd.cpp
index 53063c5..d9378b9 100644
--- a/src/bthread/fd.cpp
+++ b/src/bthread/fd.cpp
@@ -49,7 +49,7 @@ class LazyArray {
 
 public:
     LazyArray() {
-        memset(_blocks, 0, sizeof(butil::atomic<Block*>) * NBLOCK);
+        memset(static_cast<void*>(_blocks), 0, sizeof(butil::atomic<Block*>) * 
NBLOCK);
     }
 
     butil::atomic<T>* get_or_new(size_t index) {
diff --git a/src/butil/object_pool_inl.h b/src/butil/object_pool_inl.h
index 7a70da1..8c6e483 100644
--- a/src/butil/object_pool_inl.h
+++ b/src/butil/object_pool_inl.h
@@ -114,7 +114,7 @@ public:
             // We fetch_add nblock in add_block() before setting the entry,
             // thus address_resource() may sees the unset entry. Initialize
             // all entries to NULL makes such address_resource() return NULL.
-            memset(blocks, 0, sizeof(butil::atomic<Block*>) * OP_GROUP_NBLOCK);
+            memset(static_cast<void*>(blocks), 0, 
sizeof(butil::atomic<Block*>) * OP_GROUP_NBLOCK);
         }
     };
 
diff --git a/src/butil/resource_pool_inl.h b/src/butil/resource_pool_inl.h
index dc54967..d5a2a37 100644
--- a/src/butil/resource_pool_inl.h
+++ b/src/butil/resource_pool_inl.h
@@ -130,7 +130,7 @@ public:
             // We fetch_add nblock in add_block() before setting the entry,
             // thus address_resource() may sees the unset entry. Initialize
             // all entries to NULL makes such address_resource() return NULL.
-            memset(blocks, 0, sizeof(butil::atomic<Block*>) * RP_GROUP_NBLOCK);
+            memset(static_cast<void*>(blocks), 0, 
sizeof(butil::atomic<Block*>) * RP_GROUP_NBLOCK);
         }
     };
 
diff --git a/src/butil/third_party/rapidjson/document.h 
b/src/butil/third_party/rapidjson/document.h
index a706586..c78ae42 100644
--- a/src/butil/third_party/rapidjson/document.h
+++ b/src/butil/third_party/rapidjson/document.h
@@ -1661,7 +1661,7 @@ private:
         flags_ = kArrayFlag;
         if (count) {
             data_.a.elements = (GenericValue*)allocator.Malloc(count * 
sizeof(GenericValue));
-            std::memcpy(data_.a.elements, values, count * 
sizeof(GenericValue));
+            std::memcpy(static_cast<void*>(data_.a.elements), values, count * 
sizeof(GenericValue));
         }
         else
             data_.a.elements = NULL;
@@ -1673,7 +1673,7 @@ private:
         flags_ = kObjectFlag;
         if (count) {
             data_.o.members = (Member*)allocator.Malloc(count * 
sizeof(Member));
-            std::memcpy(data_.o.members, members, count * sizeof(Member));
+            std::memcpy(static_cast<void*>(data_.o.members), members, count * 
sizeof(Member));
         }
         else
             data_.o.members = NULL;

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org
For additional commands, e-mail: dev-h...@brpc.apache.org

Reply via email to