diff options
Diffstat (limited to 'absl')
-rw-r--r-- | absl/strings/escaping.cc | 9 | ||||
-rw-r--r-- | absl/strings/internal/str_format/arg.h | 4 | ||||
-rw-r--r-- | absl/strings/internal/str_format/extension.h | 4 | ||||
-rw-r--r-- | absl/strings/internal/str_format/output.h | 5 | ||||
-rw-r--r-- | absl/synchronization/internal/waiter.cc | 4 |
5 files changed, 14 insertions, 12 deletions
diff --git a/absl/strings/escaping.cc b/absl/strings/escaping.cc index 88390fbf..18b746e3 100644 --- a/absl/strings/escaping.cc +++ b/absl/strings/escaping.cc @@ -961,7 +961,7 @@ bool Base64UnescapeInternal(const char* src, size_t slen, String* dest, } /* clang-format off */ -constexpr char kHexValue[256] = { +constexpr char kHexValueLenient[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -977,8 +977,9 @@ constexpr char kHexValue[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; + /* clang-format on */ // This is a templated function so that T can be either a char* @@ -987,8 +988,8 @@ constexpr char kHexValue[256] = { template <typename T> void HexStringToBytesInternal(const char* from, T to, ptrdiff_t num) { for (int i = 0; i < num; i++) { - to[i] = (kHexValue[from[i * 2] & 0xFF] << 4) + - (kHexValue[from[i * 2 + 1] & 0xFF]); + to[i] = (kHexValueLenient[from[i * 2] & 0xFF] << 4) + + (kHexValueLenient[from[i * 2 + 1] & 0xFF]); } } diff --git a/absl/strings/internal/str_format/arg.h b/absl/strings/internal/str_format/arg.h index 2119ca00..79416cc8 100644 --- a/absl/strings/internal/str_format/arg.h +++ b/absl/strings/internal/str_format/arg.h @@ -18,11 +18,11 @@ #include "absl/strings/internal/str_format/extension.h" #include "absl/strings/string_view.h" -class Cord; class CordReader; namespace absl { +class Cord; class FormatCountCapture; class FormatSink; @@ -67,7 +67,7 @@ ConvertResult<Conv::s | Conv::p> FormatConvertImpl(const char* v, FormatSinkImpl* sink); template <class AbslCord, typename std::enable_if< - std::is_same<AbslCord, ::Cord>::value>::type* = nullptr, + std::is_same<AbslCord, absl::Cord>::value>::type* = nullptr, class AbslCordReader = ::CordReader> ConvertResult<Conv::s> FormatConvertImpl(const AbslCord& value, ConversionSpec conv, diff --git a/absl/strings/internal/str_format/extension.h b/absl/strings/internal/str_format/extension.h index eb81f8a1..3f4788c9 100644 --- a/absl/strings/internal/str_format/extension.h +++ b/absl/strings/internal/str_format/extension.h @@ -25,10 +25,10 @@ #include "absl/strings/internal/str_format/output.h" #include "absl/strings/string_view.h" -class Cord; - namespace absl { +class Cord; + namespace str_format_internal { class FormatRawSinkImpl { diff --git a/absl/strings/internal/str_format/output.h b/absl/strings/internal/str_format/output.h index 42da6417..6dc2f3f7 100644 --- a/absl/strings/internal/str_format/output.h +++ b/absl/strings/internal/str_format/output.h @@ -28,9 +28,10 @@ #include "absl/base/port.h" #include "absl/strings/string_view.h" +namespace absl { + class Cord; -namespace absl { namespace str_format_internal { // RawSink implementation that writes into a char* buffer. @@ -76,7 +77,7 @@ inline void AbslFormatFlush(std::ostream* out, string_view s) { } template <class AbslCord, typename = typename std::enable_if< - std::is_same<AbslCord, ::Cord>::value>::type> + std::is_same<AbslCord, absl::Cord>::value>::type> inline void AbslFormatFlush(AbslCord* out, string_view s) { out->Append(s); } diff --git a/absl/synchronization/internal/waiter.cc b/absl/synchronization/internal/waiter.cc index f1425872..e7000d3a 100644 --- a/absl/synchronization/internal/waiter.cc +++ b/absl/synchronization/internal/waiter.cc @@ -136,7 +136,7 @@ bool Waiter::Wait(KernelTimeout t) { bool first_pass = true; while (true) { int32_t x = futex_.load(std::memory_order_relaxed); - if (x != 0) { + while (x != 0) { if (!futex_.compare_exchange_weak(x, x - 1, std::memory_order_acquire, std::memory_order_relaxed)) { @@ -313,7 +313,7 @@ bool Waiter::Wait(KernelTimeout t) { bool first_pass = true; while (true) { int x = wakeups_.load(std::memory_order_relaxed); - if (x != 0) { + while (x != 0) { if (!wakeups_.compare_exchange_weak(x, x - 1, std::memory_order_acquire, std::memory_order_relaxed)) { |