about summary refs log tree commit diff
path: root/absl/numeric/int128.h
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2018-01-09T16·46-0800
committerDerek Mauro <dmauro@google.com>2018-01-09T17·23-0500
commit25274b35a079384d454dd7163a9596623d4eca14 (patch)
tree758720b81dad406864b65d727ea41d00007ead3c /absl/numeric/int128.h
parent4132ce25956a91e1224e0f205b7f8c326304a995 (diff)
Changes imported from Abseil "staging" branch:
  - 8dea174f3f4178dd8b428e5cf73c37c4eefeb2ea Minor style changes and reorganization. Add missing copyr... by Alex Strelnikov <strel@google.com>

GitOrigin-RevId: 8dea174f3f4178dd8b428e5cf73c37c4eefeb2ea
Change-Id: I239f9dd6882172790b241f1af7a2acb23d54fb61
Diffstat (limited to 'absl/numeric/int128.h')
-rw-r--r--absl/numeric/int128.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/absl/numeric/int128.h b/absl/numeric/int128.h
index d87cbbd44752..f42a4aa3788e 100644
--- a/absl/numeric/int128.h
+++ b/absl/numeric/int128.h
@@ -62,7 +62,7 @@ namespace absl {
 // However, a `uint128` differs from intrinsic integral types in the following
 // ways:
 //
-//   * Errors on implicit conversions that does not preserve value (such as
+//   * Errors on implicit conversions that do not preserve value (such as
 //     loss of precision when converting to float values).
 //   * Requires explicit construction from and conversion to floating point
 //     types.
@@ -175,10 +175,10 @@ class alignas(16) uint128 {
   // Example:
   //
   //   absl::uint128 big = absl::MakeUint128(1, 0);
-  friend constexpr uint128 MakeUint128(uint64_t top, uint64_t bottom);
+  friend constexpr uint128 MakeUint128(uint64_t high, uint64_t low);
 
  private:
-  constexpr uint128(uint64_t top, uint64_t bottom);
+  constexpr uint128(uint64_t high, uint64_t low);
 
   // TODO(strel) Update implementation to use __int128 once all users of
   // uint128 are fixed to not depend on alignof(uint128) == 8. Also add
@@ -198,7 +198,7 @@ class alignas(16) uint128 {
 extern const uint128 kuint128max;
 
 // allow uint128 to be logged
-extern std::ostream& operator<<(std::ostream& o, uint128 b);
+extern std::ostream& operator<<(std::ostream& os, uint128 v);
 
 // TODO(strel) add operator>>(std::istream&, uint128)
 
@@ -208,8 +208,8 @@ extern std::ostream& operator<<(std::ostream& o, uint128 b);
 //                      Implementation details follow
 // --------------------------------------------------------------------------
 
-constexpr uint128 MakeUint128(uint64_t top, uint64_t bottom) {
-  return uint128(top, bottom);
+constexpr uint128 MakeUint128(uint64_t high, uint64_t low) {
+  return uint128(high, low);
 }
 
 // Assignment from integer types.
@@ -287,8 +287,8 @@ constexpr uint64_t Uint128High64(uint128 v) { return v.hi_; }
 
 #if defined(ABSL_IS_LITTLE_ENDIAN)
 
-constexpr uint128::uint128(uint64_t top, uint64_t bottom)
-    : lo_(bottom), hi_(top) {}
+constexpr uint128::uint128(uint64_t high, uint64_t low)
+    : lo_(low), hi_(high) {}
 
 constexpr uint128::uint128(int v)
     : lo_(v), hi_(v < 0 ? std::numeric_limits<uint64_t>::max() : 0) {}
@@ -314,8 +314,8 @@ constexpr uint128::uint128(unsigned __int128 v)
 
 #elif defined(ABSL_IS_BIG_ENDIAN)
 
-constexpr uint128::uint128(uint64_t top, uint64_t bottom)
-    : hi_(top), lo_(bottom) {}
+constexpr uint128::uint128(uint64_t high, uint64_t low)
+    : hi_(high), lo_(low) {}
 
 constexpr uint128::uint128(int v)
     : hi_(v < 0 ? std::numeric_limits<uint64_t>::max() : 0), lo_(v) {}