From 7fed69b7ad10a06c2eedaaf0279f44f2bab0d85c Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Mon, 5 Mar 2018 09:58:05 -0800 Subject: Use static_cast rather than reinterpret_cast whenever possible --- test/cpp/qps/client_async.cc | 4 ++-- test/cpp/qps/server_async.cc | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'test/cpp/qps') diff --git a/test/cpp/qps/client_async.cc b/test/cpp/qps/client_async.cc index e3fba36a7a..8215ecbf55 100644 --- a/test/cpp/qps/client_async.cc +++ b/test/cpp/qps/client_async.cc @@ -50,9 +50,9 @@ class ClientRpcContext { // next state, return false if done. Collect stats when appropriate virtual bool RunNextState(bool, HistogramEntry* entry) = 0; virtual void StartNewClone(CompletionQueue* cq) = 0; - static void* tag(ClientRpcContext* c) { return reinterpret_cast(c); } + static void* tag(ClientRpcContext* c) { return static_cast(c); } static ClientRpcContext* detag(void* t) { - return reinterpret_cast(t); + return static_cast(t); } virtual void Start(CompletionQueue* cq, const ClientConfig& config) = 0; diff --git a/test/cpp/qps/server_async.cc b/test/cpp/qps/server_async.cc index b88b88445c..f1dfea24d8 100644 --- a/test/cpp/qps/server_async.cc +++ b/test/cpp/qps/server_async.cc @@ -240,11 +240,9 @@ class AsyncQpsServerTest final : public grpc::testing::Server { private: std::mutex mu_; }; - static void* tag(ServerRpcContext* func) { - return reinterpret_cast(func); - } + static void* tag(ServerRpcContext* func) { return static_cast(func); } static ServerRpcContext* detag(void* tag) { - return reinterpret_cast(tag); + return static_cast(tag); } class ServerRpcContextUnaryImpl final : public ServerRpcContext { -- cgit v1.2.3