diff options
author | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-03-04 14:03:06 +0300 |
---|---|---|
committer | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-03-04 14:03:06 +0300 |
commit | b61be8e632d1cafa8afb229ea0a5b6117ca7125b (patch) | |
tree | 96a36f21d4064f32d1912cbc85e4135788ff70b3 /contrib/restricted/abseil-cpp-tstring/y_absl/status | |
parent | 7ce58bf82abf75fdc15c2e6fa3aceadcfecfdca1 (diff) | |
download | ydb-b61be8e632d1cafa8afb229ea0a5b6117ca7125b.tar.gz |
intermediate changes
ref:c67faec740b4d59ed47c6dfdc7076c904650af60
Diffstat (limited to 'contrib/restricted/abseil-cpp-tstring/y_absl/status')
8 files changed, 77 insertions, 77 deletions
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/status/internal/status_internal.h b/contrib/restricted/abseil-cpp-tstring/y_absl/status/internal/status_internal.h index 6754d7d518..3195a6eb4f 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/status/internal/status_internal.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/status/internal/status_internal.h @@ -11,8 +11,8 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#ifndef ABSL_STATUS_INTERNAL_STATUS_INTERNAL_H_ -#define ABSL_STATUS_INTERNAL_STATUS_INTERNAL_H_ +#ifndef Y_ABSL_STATUS_INTERNAL_STATUS_INTERNAL_H_ +#define Y_ABSL_STATUS_INTERNAL_STATUS_INTERNAL_H_ #include <util/generic/string.h> @@ -22,16 +22,16 @@ #ifndef SWIG // Disabled for SWIG as it doesn't parse attributes correctly. namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN // Returned Status objects may not be ignored. Codesearch doesn't handle ifdefs // as part of a class definitions (b/6995610), so we use a forward declaration. -class ABSL_MUST_USE_RESULT Status; -ABSL_NAMESPACE_END +class Y_ABSL_MUST_USE_RESULT Status; +Y_ABSL_NAMESPACE_END } // namespace y_absl #endif // !SWIG namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN enum class StatusCode : int; @@ -63,7 +63,7 @@ struct StatusRep { y_absl::StatusCode MapToLocalCode(int value); } // namespace status_internal -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl -#endif // ABSL_STATUS_INTERNAL_STATUS_INTERNAL_H_ +#endif // Y_ABSL_STATUS_INTERNAL_STATUS_INTERNAL_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/status/internal/statusor_internal.h b/contrib/restricted/abseil-cpp-tstring/y_absl/status/internal/statusor_internal.h index c4d78e28d2..46469adc33 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/status/internal/statusor_internal.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/status/internal/statusor_internal.h @@ -11,8 +11,8 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#ifndef ABSL_STATUS_INTERNAL_STATUSOR_INTERNAL_H_ -#define ABSL_STATUS_INTERNAL_STATUSOR_INTERNAL_H_ +#ifndef Y_ABSL_STATUS_INTERNAL_STATUSOR_INTERNAL_H_ +#define Y_ABSL_STATUS_INTERNAL_STATUSOR_INTERNAL_H_ #include <type_traits> #include <utility> @@ -23,10 +23,10 @@ #include "y_absl/utility/utility.h" namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN template <typename T> -class ABSL_MUST_USE_RESULT StatusOr; +class Y_ABSL_MUST_USE_RESULT StatusOr; namespace internal_statusor { @@ -136,14 +136,14 @@ class Helper { public: // Move type-agnostic error handling to the .cc. static void HandleInvalidStatusCtorArg(Status*); - ABSL_ATTRIBUTE_NORETURN static void Crash(const y_absl::Status& status); + Y_ABSL_ATTRIBUTE_NORETURN static void Crash(const y_absl::Status& status); }; // Construct an instance of T in `p` through placement new, passing Args... to // the constructor. // This abstraction is here mostly for the gcc performance fix. template <typename T, typename... Args> -ABSL_ATTRIBUTE_NONNULL(1) void PlacementNew(void* p, Args&&... args) { +Y_ABSL_ATTRIBUTE_NONNULL(1) void PlacementNew(void* p, Args&&... args) { new (p) T(std::forward<Args>(args)...); } @@ -286,11 +286,11 @@ class StatusOrData { } void EnsureOk() const { - if (ABSL_PREDICT_FALSE(!ok())) Helper::Crash(status_); + if (Y_ABSL_PREDICT_FALSE(!ok())) Helper::Crash(status_); } void EnsureNotOk() { - if (ABSL_PREDICT_FALSE(ok())) Helper::HandleInvalidStatusCtorArg(&status_); + if (Y_ABSL_PREDICT_FALSE(ok())) Helper::HandleInvalidStatusCtorArg(&status_); } // Construct the value (ie. data_) through placement new with the passed @@ -387,10 +387,10 @@ struct MoveAssignBase<T, false> { MoveAssignBase& operator=(MoveAssignBase&&) = delete; }; -ABSL_ATTRIBUTE_NORETURN void ThrowBadStatusOrAccess(y_absl::Status status); +Y_ABSL_ATTRIBUTE_NORETURN void ThrowBadStatusOrAccess(y_absl::Status status); } // namespace internal_statusor -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl -#endif // ABSL_STATUS_INTERNAL_STATUSOR_INTERNAL_H_ +#endif // Y_ABSL_STATUS_INTERNAL_STATUSOR_INTERNAL_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/status/status.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/status/status.cc index 3b7fe28e08..2bfa4be70a 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/status/status.cc +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/status/status.cc @@ -25,7 +25,7 @@ #include "y_absl/strings/str_split.h" namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN TString StatusCodeToString(StatusCode code) { switch (code) { @@ -227,7 +227,7 @@ y_absl::StatusCode Status::code() const { } void Status::PrepareToModify() { - ABSL_RAW_CHECK(!ok(), "PrepareToModify shouldn't be called on OK status."); + Y_ABSL_RAW_CHECK(!ok(), "PrepareToModify shouldn't be called on OK status."); if (IsInlined(rep_)) { rep_ = PointerToRep(new status_internal::StatusRep( static_cast<y_absl::StatusCode>(raw_code()), y_absl::string_view(), @@ -440,5 +440,5 @@ bool IsUnknown(const Status& status) { return status.code() == y_absl::StatusCode::kUnknown; } -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/status/status.h b/contrib/restricted/abseil-cpp-tstring/y_absl/status/status.h index fa461e9f76..b2acacc709 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/status/status.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/status/status.h @@ -48,8 +48,8 @@ // error codes (of type `y_absl::StatusCode`) enumerated in this header file. // These canonical codes are understood across the codebase and will be // accepted across all API and RPC boundaries. -#ifndef ABSL_STATUS_STATUS_H_ -#define ABSL_STATUS_STATUS_H_ +#ifndef Y_ABSL_STATUS_STATUS_H_ +#define Y_ABSL_STATUS_STATUS_H_ #include <iostream> #include <util/generic/string.h> @@ -62,7 +62,7 @@ #include "y_absl/types/optional.h" namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN // y_absl::StatusCode // @@ -420,7 +420,7 @@ inline StatusToStringMode& operator^=(StatusToStringMode& lhs, // // Returned Status objects may not be ignored. status_internal.h has a forward // declaration of the form -// class ABSL_MUST_USE_RESULT Status; +// class Y_ABSL_MUST_USE_RESULT Status; class Status final { public: // Constructors @@ -471,7 +471,7 @@ class Status final { // // Returns `true` if `this->ok()`. Prefer checking for an OK status using this // member function. - ABSL_MUST_USE_RESULT bool ok() const; + Y_ABSL_MUST_USE_RESULT bool ok() const; // Status::code() // @@ -687,22 +687,22 @@ std::ostream& operator<<(std::ostream& os, const Status& x); // // These convenience functions return `true` if a given status matches the // `y_absl::StatusCode` error code of its associated function. -ABSL_MUST_USE_RESULT bool IsAborted(const Status& status); -ABSL_MUST_USE_RESULT bool IsAlreadyExists(const Status& status); -ABSL_MUST_USE_RESULT bool IsCancelled(const Status& status); -ABSL_MUST_USE_RESULT bool IsDataLoss(const Status& status); -ABSL_MUST_USE_RESULT bool IsDeadlineExceeded(const Status& status); -ABSL_MUST_USE_RESULT bool IsFailedPrecondition(const Status& status); -ABSL_MUST_USE_RESULT bool IsInternal(const Status& status); -ABSL_MUST_USE_RESULT bool IsInvalidArgument(const Status& status); -ABSL_MUST_USE_RESULT bool IsNotFound(const Status& status); -ABSL_MUST_USE_RESULT bool IsOutOfRange(const Status& status); -ABSL_MUST_USE_RESULT bool IsPermissionDenied(const Status& status); -ABSL_MUST_USE_RESULT bool IsResourceExhausted(const Status& status); -ABSL_MUST_USE_RESULT bool IsUnauthenticated(const Status& status); -ABSL_MUST_USE_RESULT bool IsUnavailable(const Status& status); -ABSL_MUST_USE_RESULT bool IsUnimplemented(const Status& status); -ABSL_MUST_USE_RESULT bool IsUnknown(const Status& status); +Y_ABSL_MUST_USE_RESULT bool IsAborted(const Status& status); +Y_ABSL_MUST_USE_RESULT bool IsAlreadyExists(const Status& status); +Y_ABSL_MUST_USE_RESULT bool IsCancelled(const Status& status); +Y_ABSL_MUST_USE_RESULT bool IsDataLoss(const Status& status); +Y_ABSL_MUST_USE_RESULT bool IsDeadlineExceeded(const Status& status); +Y_ABSL_MUST_USE_RESULT bool IsFailedPrecondition(const Status& status); +Y_ABSL_MUST_USE_RESULT bool IsInternal(const Status& status); +Y_ABSL_MUST_USE_RESULT bool IsInvalidArgument(const Status& status); +Y_ABSL_MUST_USE_RESULT bool IsNotFound(const Status& status); +Y_ABSL_MUST_USE_RESULT bool IsOutOfRange(const Status& status); +Y_ABSL_MUST_USE_RESULT bool IsPermissionDenied(const Status& status); +Y_ABSL_MUST_USE_RESULT bool IsResourceExhausted(const Status& status); +Y_ABSL_MUST_USE_RESULT bool IsUnauthenticated(const Status& status); +Y_ABSL_MUST_USE_RESULT bool IsUnavailable(const Status& status); +Y_ABSL_MUST_USE_RESULT bool IsUnimplemented(const Status& status); +Y_ABSL_MUST_USE_RESULT bool IsUnknown(const Status& status); // AbortedError() // AlreadyExistsError() @@ -876,7 +876,7 @@ inline Status OkStatus() { return Status(); } // message-less kCancelled errors are common in the infrastructure. inline Status CancelledError() { return Status(y_absl::StatusCode::kCancelled); } -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl -#endif // ABSL_STATUS_STATUS_H_ +#endif // Y_ABSL_STATUS_STATUS_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/status/status_payload_printer.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/status/status_payload_printer.cc index 6990ff6e8d..ae3803ed48 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/status/status_payload_printer.cc +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/status/status_payload_printer.cc @@ -19,10 +19,10 @@ #include "y_absl/base/internal/atomic_hook.h" namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN namespace status_internal { -ABSL_INTERNAL_ATOMIC_HOOK_ATTRIBUTES +Y_ABSL_INTERNAL_ATOMIC_HOOK_ATTRIBUTES static y_absl::base_internal::AtomicHook<StatusPayloadPrinter> storage; void SetStatusPayloadPrinter(StatusPayloadPrinter printer) { @@ -34,5 +34,5 @@ StatusPayloadPrinter GetStatusPayloadPrinter() { } } // namespace status_internal -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/status/status_payload_printer.h b/contrib/restricted/abseil-cpp-tstring/y_absl/status/status_payload_printer.h index 6968e0f40b..3ecb62fc21 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/status/status_payload_printer.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/status/status_payload_printer.h @@ -11,8 +11,8 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#ifndef ABSL_STATUS_STATUS_PAYLOAD_PRINTER_H_ -#define ABSL_STATUS_STATUS_PAYLOAD_PRINTER_H_ +#ifndef Y_ABSL_STATUS_STATUS_PAYLOAD_PRINTER_H_ +#define Y_ABSL_STATUS_STATUS_PAYLOAD_PRINTER_H_ #include <util/generic/string.h> @@ -21,7 +21,7 @@ #include "y_absl/types/optional.h" namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN namespace status_internal { // By default, `Status::ToString` and `operator<<(Status)` print a payload by @@ -45,7 +45,7 @@ void SetStatusPayloadPrinter(StatusPayloadPrinter); StatusPayloadPrinter GetStatusPayloadPrinter(); } // namespace status_internal -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl -#endif // ABSL_STATUS_STATUS_PAYLOAD_PRINTER_H_ +#endif // Y_ABSL_STATUS_STATUS_PAYLOAD_PRINTER_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/status/statusor.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/status/statusor.cc index 03e6d1cec4..f9dce7c12d 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/status/statusor.cc +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/status/statusor.cc @@ -22,7 +22,7 @@ #include "y_absl/strings/str_cat.h" namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN BadStatusOrAccess::BadStatusOrAccess(y_absl::Status status) : status_(std::move(status)) {} @@ -71,26 +71,26 @@ void Helper::HandleInvalidStatusCtorArg(y_absl::Status* status) { const char* kMessage = "An OK status is not a valid constructor argument to StatusOr<T>"; #ifdef NDEBUG - ABSL_INTERNAL_LOG(ERROR, kMessage); + Y_ABSL_INTERNAL_LOG(ERROR, kMessage); #else - ABSL_INTERNAL_LOG(FATAL, kMessage); + Y_ABSL_INTERNAL_LOG(FATAL, kMessage); #endif // In optimized builds, we will fall back to InternalError. *status = y_absl::InternalError(kMessage); } void Helper::Crash(const y_absl::Status& status) { - ABSL_INTERNAL_LOG( + Y_ABSL_INTERNAL_LOG( FATAL, y_absl::StrCat("Attempting to fetch value instead of handling error ", status.ToString())); } void ThrowBadStatusOrAccess(y_absl::Status status) { -#ifdef ABSL_HAVE_EXCEPTIONS +#ifdef Y_ABSL_HAVE_EXCEPTIONS throw y_absl::BadStatusOrAccess(std::move(status)); #else - ABSL_INTERNAL_LOG( + Y_ABSL_INTERNAL_LOG( FATAL, y_absl::StrCat("Attempting to fetch value instead of handling error ", status.ToString())); @@ -99,5 +99,5 @@ void ThrowBadStatusOrAccess(y_absl::Status status) { } } // namespace internal_statusor -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/status/statusor.h b/contrib/restricted/abseil-cpp-tstring/y_absl/status/statusor.h index 23e1b8a6e4..6fd14e9819 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/status/statusor.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/status/statusor.h @@ -33,8 +33,8 @@ // } else { // LOG(ERROR) << result.status(); // } -#ifndef ABSL_STATUS_STATUSOR_H_ -#define ABSL_STATUS_STATUSOR_H_ +#ifndef Y_ABSL_STATUS_STATUSOR_H_ +#define Y_ABSL_STATUS_STATUSOR_H_ #include <exception> #include <initializer_list> @@ -52,7 +52,7 @@ #include "y_absl/utility/utility.h" namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN // BadStatusOrAccess // @@ -106,7 +106,7 @@ class BadStatusOrAccess : public std::exception { // Returned StatusOr objects may not be ignored. template <typename T> -class ABSL_MUST_USE_RESULT StatusOr; +class Y_ABSL_MUST_USE_RESULT StatusOr; // y_absl::StatusOr<T> // @@ -482,7 +482,7 @@ class StatusOr : private internal_statusor::StatusOrData<T>, // else { // // Handle error // } - ABSL_MUST_USE_RESULT bool ok() const { return this->status_.ok(); } + Y_ABSL_MUST_USE_RESULT bool ok() const { return this->status_.ok(); } // StatusOr<T>::status() // @@ -518,10 +518,10 @@ class StatusOr : private internal_statusor::StatusOrData<T>, // // The `std::move` on statusor instead of on the whole expression enables // warnings about possible uses of the statusor object after the move. - const T& value() const& ABSL_ATTRIBUTE_LIFETIME_BOUND; - T& value() & ABSL_ATTRIBUTE_LIFETIME_BOUND; - const T&& value() const&& ABSL_ATTRIBUTE_LIFETIME_BOUND; - T&& value() && ABSL_ATTRIBUTE_LIFETIME_BOUND; + const T& value() const& Y_ABSL_ATTRIBUTE_LIFETIME_BOUND; + T& value() & Y_ABSL_ATTRIBUTE_LIFETIME_BOUND; + const T&& value() const&& Y_ABSL_ATTRIBUTE_LIFETIME_BOUND; + T&& value() && Y_ABSL_ATTRIBUTE_LIFETIME_BOUND; // StatusOr<T>:: operator*() // @@ -533,10 +533,10 @@ class StatusOr : private internal_statusor::StatusOrData<T>, // `y_absl::StatusOr<T>`. Alternatively, see the `value()` member function for a // similar API that guarantees crashing or throwing an exception if there is // no current value. - const T& operator*() const& ABSL_ATTRIBUTE_LIFETIME_BOUND; - T& operator*() & ABSL_ATTRIBUTE_LIFETIME_BOUND; - const T&& operator*() const&& ABSL_ATTRIBUTE_LIFETIME_BOUND; - T&& operator*() && ABSL_ATTRIBUTE_LIFETIME_BOUND; + const T& operator*() const& Y_ABSL_ATTRIBUTE_LIFETIME_BOUND; + T& operator*() & Y_ABSL_ATTRIBUTE_LIFETIME_BOUND; + const T&& operator*() const&& Y_ABSL_ATTRIBUTE_LIFETIME_BOUND; + T&& operator*() && Y_ABSL_ATTRIBUTE_LIFETIME_BOUND; // StatusOr<T>::operator->() // @@ -545,8 +545,8 @@ class StatusOr : private internal_statusor::StatusOrData<T>, // REQUIRES: `this->ok() == true`, otherwise the behavior is undefined. // // Use `this->ok()` to verify that there is a current value. - const T* operator->() const ABSL_ATTRIBUTE_LIFETIME_BOUND; - T* operator->() ABSL_ATTRIBUTE_LIFETIME_BOUND; + const T* operator->() const Y_ABSL_ATTRIBUTE_LIFETIME_BOUND; + T* operator->() Y_ABSL_ATTRIBUTE_LIFETIME_BOUND; // StatusOr<T>::value_or() // @@ -764,7 +764,7 @@ void StatusOr<T>::IgnoreError() const { // no-op } -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl -#endif // ABSL_STATUS_STATUSOR_H_ +#endif // Y_ABSL_STATUS_STATUSOR_H_ |