Skip to content

Commit

Permalink
base/numerics: Fix typos in //base/numerics/
Browse files Browse the repository at this point in the history
Fixes typos in //base/numerics/, suggested by Tricium.

Change-Id: Ie2e931035557fb89c1f1729deac7e4df92bc444b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3581441
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#992049}
  • Loading branch information
yuki3 authored and Chromium LUCI CQ committed Apr 13, 2022
1 parent a864138 commit 11a2393
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions base/numerics/checked_math.h
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,8 @@ constexpr StrictNumeric<Dst> ValueOrDefaultForType(
return value.template ValueOrDefault<Dst>(default_value);
}

// Convience wrapper to return a new CheckedNumeric from the provided arithmetic
// or CheckedNumericType.
// Convenience wrapper to return a new CheckedNumeric from the provided
// arithmetic or CheckedNumericType.
template <typename T>
constexpr CheckedNumeric<typename UnderlyingType<T>::type> MakeCheckedNum(
const T value) {
Expand Down
2 changes: 1 addition & 1 deletion base/numerics/checked_math_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ class CheckedNumericState<T, NUMERIC_INTEGER> {
: 0;
}

// is_valid_ precedes value_ because member intializers in the constructors
// is_valid_ precedes value_ because member initializers in the constructors
// are evaluated in field order, and is_valid_ must be read when initializing
// value_.
bool is_valid_;
Expand Down
4 changes: 2 additions & 2 deletions base/numerics/clamped_math.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ class ClampedNumeric {
};
};

// Convience wrapper to return a new ClampedNumeric from the provided arithmetic
// or ClampedNumericType.
// Convenience wrapper to return a new ClampedNumeric from the provided
// arithmetic or ClampedNumericType.
template <typename T>
constexpr ClampedNumeric<typename UnderlyingType<T>::type> MakeClampedNum(
const T value) {
Expand Down
5 changes: 3 additions & 2 deletions base/numerics/safe_conversions.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ struct SaturateFastOp<
// saturated_cast<> is analogous to static_cast<> for numeric types, except
// that the specified numeric conversion will saturate by default rather than
// overflow or underflow, and NaN assignment to an integral will return 0.
// All boundary condition behaviors can be overriden with a custom handler.
// All boundary condition behaviors can be overridden with a custom handler.
template <typename Dst,
template <typename> class SaturationHandler = SaturationDefaultLimits,
typename Src>
Expand Down Expand Up @@ -305,7 +305,8 @@ class StrictNumeric {
const T value_;
};

// Convience wrapper returns a StrictNumeric from the provided arithmetic type.
// Convenience wrapper returns a StrictNumeric from the provided arithmetic
// type.
template <typename T>
constexpr StrictNumeric<typename UnderlyingType<T>::type> MakeStrictNum(
const T value) {
Expand Down
2 changes: 1 addition & 1 deletion base/numerics/safe_math_shared_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ struct UnsignedOrFloatForSize<Numeric, false, true> {
// Wrap the unary operations to allow SFINAE when instantiating integrals versus
// floating points. These don't perform any overflow checking. Rather, they
// exhibit well-defined overflow semantics and rely on the caller to detect
// if an overflow occured.
// if an overflow occurred.

template <typename T,
typename std::enable_if<std::is_integral<T>::value>::type* = nullptr>
Expand Down

0 comments on commit 11a2393

Please sign in to comment.