Skip to content

Commit

Permalink
clear no trival copy-assignment warning
Browse files Browse the repository at this point in the history
  • Loading branch information
guodongxiaren authored and Stephan Soileau committed Jul 17, 2024
1 parent 778ab05 commit 2fe0a6f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/brpc/policy/rtmp_protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion src/bthread/fd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/butil/object_pool_inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class BAIDU_CACHELINE_ALIGNMENT ObjectPool {
// 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);
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/butil/resource_pool_inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class BAIDU_CACHELINE_ALIGNMENT ResourcePool {
// 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);
}
};

Expand Down
4 changes: 2 additions & 2 deletions src/butil/third_party/rapidjson/document.h
Original file line number Diff line number Diff line change
Expand Up @@ -1661,7 +1661,7 @@ class GenericValue {
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;
Expand All @@ -1673,7 +1673,7 @@ class GenericValue {
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;
Expand Down

0 comments on commit 2fe0a6f

Please sign in to comment.