base: remove numerics namespace from byte ops
That is, all the byte ops are moved from base::numerics to base. This
matches the upstream chromium change in https://crrev.com/1281370.
Bug: 413083268
Change-Id: I45eb81c4a411ba486f71200239a759c93fcf0198
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/mini_chromium/+/6484918
Reviewed-by: Mark Mentovai <mark@chromium.org>
diff --git a/base/numerics/basic_ops_impl.h b/base/numerics/basic_ops_impl.h
index 5db9b2d..9e1238e 100644
--- a/base/numerics/basic_ops_impl.h
+++ b/base/numerics/basic_ops_impl.h
@@ -12,7 +12,7 @@
#include <span>
#include <type_traits>
-namespace base::numerics::internal {
+namespace base::internal {
// The correct type to perform math operations on given values of type `T`. This
// may be a larger type than `T` to avoid promotion to `int` which involves sign
@@ -137,6 +137,6 @@
return bytes;
}
-} // namespace base::numerics::internal
+} // namespace base::internal
#endif // MINI_CHROMIUM_BASE_NUMERICS_BASIC_OPS_IMPL_H_
diff --git a/base/numerics/byte_conversions.h b/base/numerics/byte_conversions.h
index 3e3e010..2cce96c 100644
--- a/base/numerics/byte_conversions.h
+++ b/base/numerics/byte_conversions.h
@@ -18,14 +18,14 @@
// Chromium only builds and runs on Little Endian machines.
static_assert(ARCH_CPU_LITTLE_ENDIAN);
-namespace base::numerics {
+namespace base {
// Returns a value with all bytes in |x| swapped, i.e. reverses the endianness.
// TODO(pkasting): Once C++23 is available, replace with std::byteswap.
template <class T>
requires(std::is_integral_v<T>)
inline constexpr T ByteSwap(T value) {
- return numerics::internal::SwapBytes(value);
+ return internal::SwapBytes(value);
}
// Returns a uint8_t with the value in `bytes` interpreted as the native endian
@@ -437,6 +437,6 @@
return internal::ToLittleEndian(ByteSwap(std::bit_cast<uint64_t>(val)));
}
-} // namespace base::numerics
+} // namespace base
#endif // MINI_CHROMIUM_BASE_NUMERICS_BYTE_CONVERSIONS_H_