From 11a239306eb8c9817c4e30a7926746b42a131542 Mon Sep 17 00:00:00 2001 From: Yuki Shiino Date: Wed, 13 Apr 2022 15:12:41 +0000 Subject: [PATCH] base/numerics: Fix typos in //base/numerics/ 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 Commit-Queue: Daniel Cheng Cr-Commit-Position: refs/heads/main@{#992049} --- base/numerics/checked_math.h | 4 ++-- base/numerics/checked_math_impl.h | 2 +- base/numerics/clamped_math.h | 4 ++-- base/numerics/safe_conversions.h | 5 +++-- base/numerics/safe_math_shared_impl.h | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/base/numerics/checked_math.h b/base/numerics/checked_math.h index bbc575c457beab..956ba9ae0b5ab9 100644 --- a/base/numerics/checked_math.h +++ b/base/numerics/checked_math.h @@ -289,8 +289,8 @@ constexpr StrictNumeric ValueOrDefaultForType( return value.template ValueOrDefault(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 constexpr CheckedNumeric::type> MakeCheckedNum( const T value) { diff --git a/base/numerics/checked_math_impl.h b/base/numerics/checked_math_impl.h index 1b83a0d059ca8b..00d48d4834336f 100644 --- a/base/numerics/checked_math_impl.h +++ b/base/numerics/checked_math_impl.h @@ -538,7 +538,7 @@ class CheckedNumericState { : 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_; diff --git a/base/numerics/clamped_math.h b/base/numerics/clamped_math.h index 20e2eb47150731..f9051ef0f8096a 100644 --- a/base/numerics/clamped_math.h +++ b/base/numerics/clamped_math.h @@ -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 constexpr ClampedNumeric::type> MakeClampedNum( const T value) { diff --git a/base/numerics/safe_conversions.h b/base/numerics/safe_conversions.h index f41742c5f6eb19..d8af80f0a8b29d 100644 --- a/base/numerics/safe_conversions.h +++ b/base/numerics/safe_conversions.h @@ -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 class SaturationHandler = SaturationDefaultLimits, typename Src> @@ -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 constexpr StrictNumeric::type> MakeStrictNum( const T value) { diff --git a/base/numerics/safe_math_shared_impl.h b/base/numerics/safe_math_shared_impl.h index ba91016758ee77..50be0d2db9ccbf 100644 --- a/base/numerics/safe_math_shared_impl.h +++ b/base/numerics/safe_math_shared_impl.h @@ -132,7 +132,7 @@ struct UnsignedOrFloatForSize { // 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 ::value>::type* = nullptr>