Add explicit and fix error

pull/18881/head
Na-Na Pang 6 years ago
parent 7a464a3bc9
commit 87d75d2a88
  1. 6
      test/cpp/microbenchmarks/bm_cq.cc
  2. 2
      test/cpp/microbenchmarks/callback_streaming_ping_pong.h

@ -153,7 +153,9 @@ static void shutdown_and_destroy(grpc_completion_queue* cc) {
// Tag completion queue iterate times // Tag completion queue iterate times
class TagCallback : public grpc_experimental_completion_queue_functor { class TagCallback : public grpc_experimental_completion_queue_functor {
public: public:
TagCallback(int* iter) : iter_(iter) { functor_run = &TagCallback::Run; } explicit TagCallback(int* iter) : iter_(iter) {
functor_run = &TagCallback::Run;
}
~TagCallback() {} ~TagCallback() {}
static void Run(grpc_experimental_completion_queue_functor* cb, int ok) { static void Run(grpc_experimental_completion_queue_functor* cb, int ok) {
GPR_ASSERT(static_cast<bool>(ok)); GPR_ASSERT(static_cast<bool>(ok));
@ -167,7 +169,7 @@ class TagCallback : public grpc_experimental_completion_queue_functor {
// Check if completion queue is shut down // Check if completion queue is shut down
class ShutdownCallback : public grpc_experimental_completion_queue_functor { class ShutdownCallback : public grpc_experimental_completion_queue_functor {
public: public:
ShutdownCallback(bool* done) : done_(done) { explicit ShutdownCallback(bool* done) : done_(done) {
functor_run = &ShutdownCallback::Run; functor_run = &ShutdownCallback::Run;
} }
~ShutdownCallback() {} ~ShutdownCallback() {}

@ -55,10 +55,8 @@ class BidiClient
gpr_log(GPR_ERROR, "Client read failed"); gpr_log(GPR_ERROR, "Client read failed");
return; return;
} }
if (writes_complete_ < msgs_to_send_) {
MaybeWrite(); MaybeWrite();
} }
}
void OnWriteDone(bool ok) override { void OnWriteDone(bool ok) override {
if (!ok) { if (!ok) {

Loading…
Cancel
Save