aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthegeorg <thegeorg@yandex-team.com>2023-03-23 20:04:31 +0300
committerthegeorg <thegeorg@yandex-team.com>2023-03-23 20:04:31 +0300
commitc6388d675fc5cccbcb87503a7dd8001beeea7527 (patch)
tree5d7af797c002ec6b225dfcc6808d7d19ef1f263d
parentee59ba5f5ea78424777da7c44610bad45b16bada (diff)
downloadydb-c6388d675fc5cccbcb87503a7dd8001beeea7527.tar.gz
Better std::to_string replacement in grpc
grpc 1.45.2 introduced `ToString()` method in certain classes. We want to use global `::ToString()` as `std::to_string()` replacement.
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/config.h2
-rw-r--r--contrib/libs/grpc/src/compiler/config.h2
-rw-r--r--contrib/libs/grpc/src/compiler/cpp_generator.cc6
-rw-r--r--contrib/libs/grpc/src/compiler/cpp_generator.h2
-rw-r--r--contrib/libs/grpc/src/compiler/schema_interface.h2
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel_channelz.cc4
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/http/client/http_client_filter.cc2
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/binder/server/binder_server.cc2
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/binder/wire_format/wire_reader_impl.cc2
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.cc2
-rw-r--r--contrib/libs/grpc/src/core/lib/channel/channel_trace.cc4
-rw-r--r--contrib/libs/grpc/src/core/lib/channel/channelz.cc34
-rw-r--r--contrib/libs/grpc/src/core/lib/gprpp/status_helper.cc2
-rw-r--r--contrib/libs/grpc/src/core/lib/json/json.h4
14 files changed, 35 insertions, 35 deletions
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/config.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/config.h
index 85350b6776..856e3be46f 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/config.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/config.h
@@ -36,7 +36,7 @@
namespace grpc {
// Using grpc::string and grpc::to_string is discouraged in favor of
-// TString and ToString. This is only for legacy code using
+// TString and ::ToString. This is only for legacy code using
// them explictly.
typedef TString string;
diff --git a/contrib/libs/grpc/src/compiler/config.h b/contrib/libs/grpc/src/compiler/config.h
index 80ce021962..d56e4d83e4 100644
--- a/contrib/libs/grpc/src/compiler/config.h
+++ b/contrib/libs/grpc/src/compiler/config.h
@@ -30,7 +30,7 @@
namespace grpc {
// Using grpc::string and grpc::to_string is discouraged in favor of
-// TString and ToString. This is only for legacy code using
+// TString and ::ToString. This is only for legacy code using
// them explictly.
typedef TString string;
diff --git a/contrib/libs/grpc/src/compiler/cpp_generator.cc b/contrib/libs/grpc/src/compiler/cpp_generator.cc
index a4d2becbe2..5b46c38922 100644
--- a/contrib/libs/grpc/src/compiler/cpp_generator.cc
+++ b/contrib/libs/grpc/src/compiler/cpp_generator.cc
@@ -2271,7 +2271,7 @@ void PrintMockClientMethods(grpc_generator::Printer* printer,
(*vars)["AsyncPrefix"] = async_prefix.prefix;
(*vars)["AsyncMethodParams"] = async_prefix.method_params;
(*vars)["MockArgs"] =
- ToString(3 + async_prefix.extra_method_param_count);
+ ::ToString(3 + async_prefix.extra_method_param_count);
printer->Print(*vars,
"MOCK_METHOD$MockArgs$($AsyncPrefix$$Method$Raw, "
"::grpc::ClientAsyncWriterInterface< $Request$>*"
@@ -2288,7 +2288,7 @@ void PrintMockClientMethods(grpc_generator::Printer* printer,
(*vars)["AsyncPrefix"] = async_prefix.prefix;
(*vars)["AsyncMethodParams"] = async_prefix.method_params;
(*vars)["MockArgs"] =
- ToString(3 + async_prefix.extra_method_param_count);
+ ::ToString(3 + async_prefix.extra_method_param_count);
printer->Print(
*vars,
"MOCK_METHOD$MockArgs$($AsyncPrefix$$Method$Raw, "
@@ -2306,7 +2306,7 @@ void PrintMockClientMethods(grpc_generator::Printer* printer,
(*vars)["AsyncPrefix"] = async_prefix.prefix;
(*vars)["AsyncMethodParams"] = async_prefix.method_params;
(*vars)["MockArgs"] =
- ToString(2 + async_prefix.extra_method_param_count);
+ ::ToString(2 + async_prefix.extra_method_param_count);
printer->Print(
*vars,
"MOCK_METHOD$MockArgs$($AsyncPrefix$$Method$Raw, "
diff --git a/contrib/libs/grpc/src/compiler/cpp_generator.h b/contrib/libs/grpc/src/compiler/cpp_generator.h
index 606b850a87..a50f80fb42 100644
--- a/contrib/libs/grpc/src/compiler/cpp_generator.h
+++ b/contrib/libs/grpc/src/compiler/cpp_generator.h
@@ -37,7 +37,7 @@
namespace grpc {
// Using grpc::string and grpc::to_string is discouraged in favor of
-// TString and ToString. This is only for legacy code using
+// TString and ::ToString. This is only for legacy code using
// them explictly.
typedef TString string; // deprecated
diff --git a/contrib/libs/grpc/src/compiler/schema_interface.h b/contrib/libs/grpc/src/compiler/schema_interface.h
index 361c62ea97..6527fa94b6 100644
--- a/contrib/libs/grpc/src/compiler/schema_interface.h
+++ b/contrib/libs/grpc/src/compiler/schema_interface.h
@@ -32,7 +32,7 @@
namespace grpc {
// Using grpc::string and grpc::to_string is discouraged in favor of
-// TString and ToString. This is only for legacy code using
+// TString and ::ToString. This is only for legacy code using
// them explictly.
typedef TString string; // deprecated
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel_channelz.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel_channelz.cc
index 6a1c4b5362..06272b6109 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel_channelz.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel_channelz.cc
@@ -73,7 +73,7 @@ Json SubchannelNode::RenderJson() {
Json::Object object{
{"ref",
Json::Object{
- {"subchannelId", ToString(uuid())},
+ {"subchannelId", ::ToString(uuid())},
}},
{"data", std::move(data)},
};
@@ -86,7 +86,7 @@ Json SubchannelNode::RenderJson() {
if (child_socket != nullptr && child_socket->uuid() != 0) {
object["socketRef"] = Json::Array{
Json::Object{
- {"socketId", ToString(child_socket->uuid())},
+ {"socketId", ::ToString(child_socket->uuid())},
{"name", child_socket->name()},
},
};
diff --git a/contrib/libs/grpc/src/core/ext/filters/http/client/http_client_filter.cc b/contrib/libs/grpc/src/core/ext/filters/http/client/http_client_filter.cc
index d20af49bbc..655f0aa5af 100644
--- a/contrib/libs/grpc/src/core/ext/filters/http/client/http_client_filter.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/http/client/http_client_filter.cc
@@ -123,7 +123,7 @@ static grpc_error_handle client_filter_incoming_metadata(
grpc_error_set_str(
GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Received http2 :status header with non-200 OK status"),
- GRPC_ERROR_STR_VALUE, ToString(*status)),
+ GRPC_ERROR_STR_VALUE, ::ToString(*status)),
GRPC_ERROR_INT_GRPC_STATUS,
grpc_http2_status_to_grpc_status(*status)),
GRPC_ERROR_STR_GRPC_MESSAGE, msg);
diff --git a/contrib/libs/grpc/src/core/ext/transport/binder/server/binder_server.cc b/contrib/libs/grpc/src/core/ext/transport/binder/server/binder_server.cc
index 45ba081903..1274ca4ab7 100644
--- a/contrib/libs/grpc/src/core/ext/transport/binder/server/binder_server.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/binder/server/binder_server.cc
@@ -185,7 +185,7 @@ class BinderServerListener : public Server::ListenerInterface {
// SETUP_TRANSPORT transaction and ghost the client. Check if we should
// send back a SHUTDOWN_TRANSPORT in this case.
return y_absl::PermissionDeniedError(
- "UID " + ToString(uid) +
+ "UID " + ::ToString(uid) +
" is not allowed to connect to this "
"server according to security policy.");
}
diff --git a/contrib/libs/grpc/src/core/ext/transport/binder/wire_format/wire_reader_impl.cc b/contrib/libs/grpc/src/core/ext/transport/binder/wire_format/wire_reader_impl.cc
index cdc362e202..172d58ee96 100644
--- a/contrib/libs/grpc/src/core/ext/transport/binder/wire_format/wire_reader_impl.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/binder/wire_format/wire_reader_impl.cc
@@ -190,7 +190,7 @@ y_absl::Status WireReaderImpl::ProcessTransaction(transaction_code_t code,
gpr_log(GPR_ERROR, "calling uid = %d", uid);
if (!security_policy_->IsAuthorized(uid)) {
return y_absl::PermissionDeniedError(
- "UID " + ToString(uid) +
+ "UID " + ::ToString(uid) +
" is not allowed to connect to this "
"transport according to security policy.");
}
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.cc
index 1a4af28b6a..68c8dc1006 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.cc
@@ -1088,7 +1088,7 @@ void grpc_chttp2_add_incoming_goaway(grpc_chttp2_transport* t,
: static_cast<grpc_millis>(current_keepalive_time_ms *
KEEPALIVE_TIME_BACKOFF_MULTIPLIER);
status.SetPayload(grpc_core::kKeepaliveThrottlingKey,
- y_absl::Cord(ToString(t->keepalive_time)));
+ y_absl::Cord(::ToString(t->keepalive_time)));
}
// lie: use transient failure from the transport to indicate goaway has been
// received.
diff --git a/contrib/libs/grpc/src/core/lib/channel/channel_trace.cc b/contrib/libs/grpc/src/core/lib/channel/channel_trace.cc
index 07254a8d95..ef6abaf53a 100644
--- a/contrib/libs/grpc/src/core/lib/channel/channel_trace.cc
+++ b/contrib/libs/grpc/src/core/lib/channel/channel_trace.cc
@@ -161,7 +161,7 @@ Json ChannelTrace::TraceEvent::RenderTraceEvent() const {
referenced_entity_->type() == BaseNode::EntityType::kInternalChannel);
object[is_channel ? "channelRef" : "subchannelRef"] = Json::Object{
{(is_channel ? "channelId" : "subchannelId"),
- ToString(referenced_entity_->uuid())},
+ ::ToString(referenced_entity_->uuid())},
};
}
return object;
@@ -176,7 +176,7 @@ Json ChannelTrace::RenderJson() const {
{"creationTimestamp", gpr_format_timespec(time_created_)},
};
if (num_events_logged_ > 0) {
- object["numEventsLogged"] = ToString(num_events_logged_);
+ object["numEventsLogged"] = ::ToString(num_events_logged_);
}
// Only add in the event list if it is non-empty.
if (head_trace_ != nullptr) {
diff --git a/contrib/libs/grpc/src/core/lib/channel/channelz.cc b/contrib/libs/grpc/src/core/lib/channel/channelz.cc
index 93588abadf..512d95afe1 100644
--- a/contrib/libs/grpc/src/core/lib/channel/channelz.cc
+++ b/contrib/libs/grpc/src/core/lib/channel/channelz.cc
@@ -128,17 +128,17 @@ void CallCountingHelper::PopulateCallCounts(Json::Object* json) {
CounterData data;
CollectData(&data);
if (data.calls_started != 0) {
- (*json)["callsStarted"] = ToString(data.calls_started);
+ (*json)["callsStarted"] = ::ToString(data.calls_started);
gpr_timespec ts = gpr_convert_clock_type(
gpr_cycle_counter_to_time(data.last_call_started_cycle),
GPR_CLOCK_REALTIME);
(*json)["lastCallStartedTimestamp"] = gpr_format_timespec(ts);
}
if (data.calls_succeeded != 0) {
- (*json)["callsSucceeded"] = ToString(data.calls_succeeded);
+ (*json)["callsSucceeded"] = ::ToString(data.calls_succeeded);
}
if (data.calls_failed) {
- (*json)["callsFailed"] = ToString(data.calls_failed);
+ (*json)["callsFailed"] = ::ToString(data.calls_failed);
}
}
@@ -196,7 +196,7 @@ Json ChannelNode::RenderJson() {
Json::Object json = {
{"ref",
Json::Object{
- {"channelId", ToString(uuid())},
+ {"channelId", ::ToString(uuid())},
}},
{"data", std::move(data)},
};
@@ -212,7 +212,7 @@ void ChannelNode::PopulateChildRefs(Json::Object* json) {
Json::Array array;
for (intptr_t subchannel_uuid : child_subchannels_) {
array.emplace_back(Json::Object{
- {"subchannelId", ToString(subchannel_uuid)},
+ {"subchannelId", ::ToString(subchannel_uuid)},
});
}
(*json)["subchannelRef"] = std::move(array);
@@ -221,7 +221,7 @@ void ChannelNode::PopulateChildRefs(Json::Object* json) {
Json::Array array;
for (intptr_t channel_uuid : child_channels_) {
array.emplace_back(Json::Object{
- {"channelId", ToString(channel_uuid)},
+ {"channelId", ::ToString(channel_uuid)},
});
}
(*json)["channelRef"] = std::move(array);
@@ -299,7 +299,7 @@ TString ServerNode::RenderServerSockets(intptr_t start_socket_id,
for (; it != child_sockets_.end() && sockets_rendered < pagination_limit;
++it, ++sockets_rendered) {
array.emplace_back(Json::Object{
- {"socketId", ToString(it->first)},
+ {"socketId", ::ToString(it->first)},
{"name", it->second->name()},
});
}
@@ -323,7 +323,7 @@ Json ServerNode::RenderJson() {
Json::Object object = {
{"ref",
Json::Object{
- {"serverId", ToString(uuid())},
+ {"serverId", ::ToString(uuid())},
}},
{"data", std::move(data)},
};
@@ -334,7 +334,7 @@ Json ServerNode::RenderJson() {
Json::Array array;
for (const auto& it : child_listen_sockets_) {
array.emplace_back(Json::Object{
- {"socketId", ToString(it.first)},
+ {"socketId", ::ToString(it.first)},
{"name", it.second->name()},
});
}
@@ -507,7 +507,7 @@ Json SocketNode::RenderJson() {
gpr_timespec ts;
int64_t streams_started = streams_started_.load(std::memory_order_relaxed);
if (streams_started != 0) {
- data["streamsStarted"] = ToString(streams_started);
+ data["streamsStarted"] = ::ToString(streams_started);
gpr_cycle_counter last_local_stream_created_cycle =
last_local_stream_created_cycle_.load(std::memory_order_relaxed);
if (last_local_stream_created_cycle != 0) {
@@ -528,15 +528,15 @@ Json SocketNode::RenderJson() {
int64_t streams_succeeded =
streams_succeeded_.load(std::memory_order_relaxed);
if (streams_succeeded != 0) {
- data["streamsSucceeded"] = ToString(streams_succeeded);
+ data["streamsSucceeded"] = ::ToString(streams_succeeded);
}
int64_t streams_failed = streams_failed_.load(std::memory_order_relaxed);
if (streams_failed != 0) {
- data["streamsFailed"] = ToString(streams_failed);
+ data["streamsFailed"] = ::ToString(streams_failed);
}
int64_t messages_sent = messages_sent_.load(std::memory_order_relaxed);
if (messages_sent != 0) {
- data["messagesSent"] = ToString(messages_sent);
+ data["messagesSent"] = ::ToString(messages_sent);
ts = gpr_convert_clock_type(
gpr_cycle_counter_to_time(
last_message_sent_cycle_.load(std::memory_order_relaxed)),
@@ -546,7 +546,7 @@ Json SocketNode::RenderJson() {
int64_t messages_received =
messages_received_.load(std::memory_order_relaxed);
if (messages_received != 0) {
- data["messagesReceived"] = ToString(messages_received);
+ data["messagesReceived"] = ::ToString(messages_received);
ts = gpr_convert_clock_type(
gpr_cycle_counter_to_time(
last_message_received_cycle_.load(std::memory_order_relaxed)),
@@ -555,13 +555,13 @@ Json SocketNode::RenderJson() {
}
int64_t keepalives_sent = keepalives_sent_.load(std::memory_order_relaxed);
if (keepalives_sent != 0) {
- data["keepAlivesSent"] = ToString(keepalives_sent);
+ data["keepAlivesSent"] = ::ToString(keepalives_sent);
}
// Create and fill the parent object.
Json::Object object = {
{"ref",
Json::Object{
- {"socketId", ToString(uuid())},
+ {"socketId", ::ToString(uuid())},
{"name", name()},
}},
{"data", std::move(data)},
@@ -587,7 +587,7 @@ Json ListenSocketNode::RenderJson() {
Json::Object object = {
{"ref",
Json::Object{
- {"socketId", ToString(uuid())},
+ {"socketId", ::ToString(uuid())},
{"name", name()},
}},
};
diff --git a/contrib/libs/grpc/src/core/lib/gprpp/status_helper.cc b/contrib/libs/grpc/src/core/lib/gprpp/status_helper.cc
index d260b3760c..4497bb1ac7 100644
--- a/contrib/libs/grpc/src/core/lib/gprpp/status_helper.cc
+++ b/contrib/libs/grpc/src/core/lib/gprpp/status_helper.cc
@@ -182,7 +182,7 @@ y_absl::Status StatusCreate(y_absl::StatusCode code, y_absl::string_view msg,
void StatusSetInt(y_absl::Status* status, StatusIntProperty key, intptr_t value) {
status->SetPayload(GetStatusIntPropertyUrl(key),
- y_absl::Cord(ToString(value)));
+ y_absl::Cord(::ToString(value)));
}
y_absl::optional<intptr_t> StatusGetInt(const y_absl::Status& status,
diff --git a/contrib/libs/grpc/src/core/lib/json/json.h b/contrib/libs/grpc/src/core/lib/json/json.h
index a922f478cb..ad79f9b0fb 100644
--- a/contrib/libs/grpc/src/core/lib/json/json.h
+++ b/contrib/libs/grpc/src/core/lib/json/json.h
@@ -124,11 +124,11 @@ class Json {
template <typename NumericType>
// NOLINTNEXTLINE(google-explicit-constructor)
Json(NumericType number)
- : type_(Type::NUMBER), string_value_(ToString(number)) {}
+ : type_(Type::NUMBER), string_value_(::ToString(number)) {}
template <typename NumericType>
Json& operator=(NumericType number) {
type_ = Type::NUMBER;
- string_value_ = ToString(number);
+ string_value_ = ::ToString(number);
return *this;
}