From b7239efc828bee76b1fe751604c195031a540b4f Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Fri, 24 Jan 2020 12:32:28 -0800 Subject: [PATCH] Weaken reinterpret_cast to static_cast --- src/cpp/server/health/default_health_check_service.cc | 3 +-- .../server/load_reporter/load_reporter_async_service_impl.cc | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/cpp/server/health/default_health_check_service.cc b/src/cpp/server/health/default_health_check_service.cc index 7483a6692c8..3a0a600f6cc 100644 --- a/src/cpp/server/health/default_health_check_service.cc +++ b/src/cpp/server/health/default_health_check_service.cc @@ -182,8 +182,7 @@ void DefaultHealthCheckService::HealthCheckServiceImpl::StartServingThread() { } void DefaultHealthCheckService::HealthCheckServiceImpl::Serve(void* arg) { - HealthCheckServiceImpl* service = - reinterpret_cast(arg); + HealthCheckServiceImpl* service = static_cast(arg); void* tag; bool ok; while (true) { diff --git a/src/cpp/server/load_reporter/load_reporter_async_service_impl.cc b/src/cpp/server/load_reporter/load_reporter_async_service_impl.cc index 9eaab5d6366..5feac238b1f 100644 --- a/src/cpp/server/load_reporter/load_reporter_async_service_impl.cc +++ b/src/cpp/server/load_reporter/load_reporter_async_service_impl.cc @@ -85,7 +85,7 @@ void LoadReporterAsyncServiceImpl::FetchAndSample(bool ok) { void LoadReporterAsyncServiceImpl::Work(void* arg) { LoadReporterAsyncServiceImpl* service = - reinterpret_cast(arg); + static_cast(arg); service->FetchAndSample(true /* ok */); // TODO(juanlishen): This is a workaround to wait for the cq to be ready. Need // to figure out why cq is not ready after service starts.