You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pegasus.apache.org by zh...@apache.org on 2022/02/25 08:35:41 UTC
[incubator-pegasus] branch master updated: refactor: use the correct cast operation (#916)
This is an automated email from the ASF dual-hosted git repository.
zhaoliwei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pegasus.git
The following commit(s) were added to refs/heads/master by this push:
new 37abc2e refactor: use the correct cast operation (#916)
37abc2e is described below
commit 37abc2ec65e9cb58549c0c796f042ab5afcaa570
Author: levy5307 <zl...@163.com>
AuthorDate: Fri Feb 25 16:27:58 2022 +0800
refactor: use the correct cast operation (#916)
---
src/redis_protocol/proxy_lib/redis_parser.cpp | 4 ++--
src/test/bench_test/benchmark.cpp | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/redis_protocol/proxy_lib/redis_parser.cpp b/src/redis_protocol/proxy_lib/redis_parser.cpp
index 65c05ac..04b871e 100644
--- a/src/redis_protocol/proxy_lib/redis_parser.cpp
+++ b/src/redis_protocol/proxy_lib/redis_parser.cpp
@@ -109,13 +109,13 @@ void redis_parser::prepare_current_buffer()
first_msg->header->from_address.to_string(),
first_msg->to_address.to_string(),
first_msg->header->rpc_name);
- _current_buffer = reinterpret_cast<char *>(msg_buffer);
+ _current_buffer = static_cast<char *>(msg_buffer);
_current_cursor = 0;
} else if (_current_cursor >= _current_buffer_length) {
dsn::message_ex *first_msg = _recv_buffers.front();
first_msg->read_commit(_current_buffer_length);
if (first_msg->read_next(&msg_buffer, &_current_buffer_length)) {
- _current_buffer = reinterpret_cast<char *>(msg_buffer);
+ _current_buffer = static_cast<char *>(msg_buffer);
_current_cursor = 0;
} else {
// we have consume this message all over
diff --git a/src/test/bench_test/benchmark.cpp b/src/test/bench_test/benchmark.cpp
index 2189cb1..fe4df38 100644
--- a/src/test/bench_test/benchmark.cpp
+++ b/src/test/bench_test/benchmark.cpp
@@ -84,7 +84,7 @@ void benchmark::run_benchmark(int thread_count, operation_type op_type)
void benchmark::thread_body(void *v)
{
- thread_arg *arg = reinterpret_cast<thread_arg *>(v);
+ thread_arg *arg = static_cast<thread_arg *>(v);
// reseed local random generator
reseed_thread_local_rng(arg->seed);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pegasus.apache.org
For additional commands, e-mail: commits-help@pegasus.apache.org