From 5b375a3728cdae42ea58a50892695fd6a269cf7d Mon Sep 17 00:00:00 2001 From: Esun Kim Date: Mon, 19 Oct 2020 21:56:17 -0700 Subject: [PATCH] Fix by misc-definitions-in-headers --- src/core/lib/iomgr/python_util.h | 6 +++--- test/cpp/microbenchmarks/callback_unary_ping_pong.h | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/core/lib/iomgr/python_util.h b/src/core/lib/iomgr/python_util.h index 42174ab8d86..a8c2fe4148c 100644 --- a/src/core/lib/iomgr/python_util.h +++ b/src/core/lib/iomgr/python_util.h @@ -29,17 +29,17 @@ // They are easier to define here (rather than in Cython) // because Cython doesn't handle #defines well. -grpc_error* grpc_socket_error(char* error) { +inline grpc_error* grpc_socket_error(char* error) { return grpc_error_set_int(GRPC_ERROR_CREATE_FROM_COPIED_STRING(error), GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE); } -char* grpc_slice_buffer_start(grpc_slice_buffer* buffer, int i) { +inline char* grpc_slice_buffer_start(grpc_slice_buffer* buffer, int i) { return (char*)GRPC_SLICE_START_PTR(buffer->slices[i]); } -int grpc_slice_buffer_length(grpc_slice_buffer* buffer, int i) { +inline int grpc_slice_buffer_length(grpc_slice_buffer* buffer, int i) { return GRPC_SLICE_LENGTH(buffer->slices[i]); } diff --git a/test/cpp/microbenchmarks/callback_unary_ping_pong.h b/test/cpp/microbenchmarks/callback_unary_ping_pong.h index 97a69ec9e56..1caa4f489f8 100644 --- a/test/cpp/microbenchmarks/callback_unary_ping_pong.h +++ b/test/cpp/microbenchmarks/callback_unary_ping_pong.h @@ -36,10 +36,10 @@ namespace testing { * BENCHMARKING KERNELS */ -void SendCallbackUnaryPingPong(benchmark::State* state, ClientContext* cli_ctx, - EchoRequest* request, EchoResponse* response, - EchoTestService::Stub* stub_, bool* done, - std::mutex* mu, std::condition_variable* cv) { +inline void SendCallbackUnaryPingPong( + benchmark::State* state, ClientContext* cli_ctx, EchoRequest* request, + EchoResponse* response, EchoTestService::Stub* stub_, bool* done, + std::mutex* mu, std::condition_variable* cv) { int response_msgs_size = state->range(1); cli_ctx->AddMetadata(kServerMessageSize, std::to_string(response_msgs_size)); stub_->experimental_async()->Echo(