aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/cpp/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/cpp/client')
-rw-r--r--src/cpp/client/channel_cc.cc16
-rw-r--r--src/cpp/client/client_context.cc2
-rw-r--r--src/cpp/client/create_channel.cc10
3 files changed, 14 insertions, 14 deletions
diff --git a/src/cpp/client/channel_cc.cc b/src/cpp/client/channel_cc.cc
index 9df531066e..08420817c8 100644
--- a/src/cpp/client/channel_cc.cc
+++ b/src/cpp/client/channel_cc.cc
@@ -61,11 +61,11 @@ namespace {
grpc::string GetChannelInfoField(grpc_channel* channel,
grpc_channel_info* channel_info,
char*** channel_info_field) {
- char* value = NULL;
+ char* value = nullptr;
memset(channel_info, 0, sizeof(*channel_info));
*channel_info_field = &value;
grpc_channel_get_info(channel, channel_info);
- if (value == NULL) return "";
+ if (value == nullptr) return "";
grpc::string result = value;
gpr_free(value);
return result;
@@ -89,14 +89,14 @@ internal::Call Channel::CreateCall(const internal::RpcMethod& method,
ClientContext* context,
CompletionQueue* cq) {
const bool kRegistered = method.channel_tag() && context->authority().empty();
- grpc_call* c_call = NULL;
+ grpc_call* c_call = nullptr;
if (kRegistered) {
c_call = grpc_channel_create_registered_call(
c_channel_, context->propagate_from_call_,
context->propagation_options_.c_bitmask(), cq->cq(),
method.channel_tag(), context->raw_deadline(), nullptr);
} else {
- const char* host_str = NULL;
+ const char* host_str = nullptr;
if (!context->authority().empty()) {
host_str = context->authority_.c_str();
} else if (!host_.empty()) {
@@ -134,7 +134,7 @@ void Channel::PerformOpsOnCall(internal::CallOpSetInterface* ops,
void* Channel::RegisterMethod(const char* method) {
return grpc_channel_register_call(
- c_channel_, method, host_.empty() ? NULL : host_.c_str(), nullptr);
+ c_channel_, method, host_.empty() ? nullptr : host_.c_str(), nullptr);
}
grpc_connectivity_state Channel::GetState(bool try_to_connect) {
@@ -171,10 +171,10 @@ bool Channel::WaitForStateChangeImpl(grpc_connectivity_state last_observed,
gpr_timespec deadline) {
CompletionQueue cq;
bool ok = false;
- void* tag = NULL;
- NotifyOnStateChangeImpl(last_observed, deadline, &cq, NULL);
+ void* tag = nullptr;
+ NotifyOnStateChangeImpl(last_observed, deadline, &cq, nullptr);
cq.Next(&tag, &ok);
- GPR_ASSERT(tag == NULL);
+ GPR_ASSERT(tag == nullptr);
return ok;
}
diff --git a/src/cpp/client/client_context.cc b/src/cpp/client/client_context.cc
index 40e95f3c05..dafa8081e9 100644
--- a/src/cpp/client/client_context.cc
+++ b/src/cpp/client/client_context.cc
@@ -127,7 +127,7 @@ grpc::string ClientContext::peer() const {
void ClientContext::SetGlobalCallbacks(GlobalCallbacks* client_callbacks) {
GPR_ASSERT(g_client_callbacks == &g_default_client_callbacks);
- GPR_ASSERT(client_callbacks != NULL);
+ GPR_ASSERT(client_callbacks != nullptr);
GPR_ASSERT(client_callbacks != &g_default_client_callbacks);
g_client_callbacks = client_callbacks;
}
diff --git a/src/cpp/client/create_channel.cc b/src/cpp/client/create_channel.cc
index de67281dd4..93233153d0 100644
--- a/src/cpp/client/create_channel.cc
+++ b/src/cpp/client/create_channel.cc
@@ -39,11 +39,11 @@ std::shared_ptr<Channel> CreateCustomChannel(
const std::shared_ptr<ChannelCredentials>& creds,
const ChannelArguments& args) {
GrpcLibraryCodegen init_lib; // We need to call init in case of a bad creds.
- return creds
- ? creds->CreateChannel(target, args)
- : CreateChannelInternal("", grpc_lame_client_channel_create(
- NULL, GRPC_STATUS_INVALID_ARGUMENT,
- "Invalid credentials."));
+ return creds ? creds->CreateChannel(target, args)
+ : CreateChannelInternal(
+ "", grpc_lame_client_channel_create(
+ nullptr, GRPC_STATUS_INVALID_ARGUMENT,
+ "Invalid credentials."));
}
} // namespace grpc