From 917bfee46514a1da47df74265571f47700922c0a Mon Sep 17 00:00:00 2001 From: Laramie Leavitt Date: Fri, 15 Nov 2024 14:23:43 -0800 Subject: [PATCH] IWYU: Update includes and fix minor spelling mistakes. PiperOrigin-RevId: 697000534 Change-Id: Ia885033535c5e2f57884a922bdcff9db7b565f49 --- absl/random/BUILD.bazel | 3 +-- absl/random/CMakeLists.txt | 2 ++ absl/random/bernoulli_distribution.h | 4 +++- absl/random/beta_distribution.h | 4 +++- absl/random/bit_gen_ref.h | 3 ++- absl/random/discrete_distribution.cc | 10 ++++++++++ absl/random/discrete_distribution.h | 6 ++++-- absl/random/exponential_distribution.h | 1 + absl/random/gaussian_distribution.h | 1 + absl/random/internal/BUILD.bazel | 1 + absl/random/internal/distribution_caller.h | 2 ++ absl/random/log_uniform_int_distribution.h | 5 +---- absl/random/mock_distributions.h | 4 ++-- absl/random/mocking_bit_gen.h | 7 +++---- absl/random/poisson_distribution.h | 7 ++++--- absl/random/uniform_int_distribution.h | 3 ++- absl/random/uniform_real_distribution.h | 2 ++ absl/random/zipf_distribution.h | 3 ++- 18 files changed, 46 insertions(+), 22 deletions(-) diff --git a/absl/random/BUILD.bazel b/absl/random/BUILD.bazel index abb93f8e678..a359e1b9819 100644 --- a/absl/random/BUILD.bazel +++ b/absl/random/BUILD.bazel @@ -75,7 +75,6 @@ cc_library( "//absl/base:config", "//absl/base:core_headers", "//absl/meta:type_traits", - "//absl/numeric:bits", "//absl/random/internal:distribution_caller", "//absl/random/internal:fast_uniform_bits", "//absl/random/internal:fastmath", @@ -124,6 +123,7 @@ cc_library( linkopts = ABSL_DEFAULT_LINKOPTS, deps = [ ":random", + "//absl/base:config", "//absl/base:core_headers", "//absl/base:fast_type_id", "//absl/meta:type_traits", @@ -156,7 +156,6 @@ cc_library( deps = [ ":random", "//absl/base:config", - "//absl/base:core_headers", "//absl/base:fast_type_id", "//absl/container:flat_hash_map", "//absl/meta:type_traits", diff --git a/absl/random/CMakeLists.txt b/absl/random/CMakeLists.txt index ad5477e3e06..2e4f0e459f0 100644 --- a/absl/random/CMakeLists.txt +++ b/absl/random/CMakeLists.txt @@ -42,6 +42,7 @@ absl_cc_library( LINKOPTS ${ABSL_DEFAULT_LINKOPTS} DEPS + absl::config absl::core_headers absl::random_internal_distribution_caller absl::random_internal_fast_uniform_bits @@ -549,6 +550,7 @@ absl_cc_library( absl::config absl::utility absl::fast_type_id + absl::type_traits ) # Internal-only target, do not depend on directly. diff --git a/absl/random/bernoulli_distribution.h b/absl/random/bernoulli_distribution.h index d81b6ae6b1c..10c24e62212 100644 --- a/absl/random/bernoulli_distribution.h +++ b/absl/random/bernoulli_distribution.h @@ -15,10 +15,12 @@ #ifndef ABSL_RANDOM_BERNOULLI_DISTRIBUTION_H_ #define ABSL_RANDOM_BERNOULLI_DISTRIBUTION_H_ +#include #include #include -#include +#include +#include "absl/base/config.h" #include "absl/base/optimization.h" #include "absl/random/internal/fast_uniform_bits.h" #include "absl/random/internal/iostream_state_saver.h" diff --git a/absl/random/beta_distribution.h b/absl/random/beta_distribution.h index 432c51612ab..a3623453b3a 100644 --- a/absl/random/beta_distribution.h +++ b/absl/random/beta_distribution.h @@ -17,14 +17,16 @@ #include #include +#include #include #include #include #include +#include "absl/base/attributes.h" +#include "absl/base/config.h" #include "absl/meta/type_traits.h" #include "absl/random/internal/fast_uniform_bits.h" -#include "absl/random/internal/fastmath.h" #include "absl/random/internal/generate_real.h" #include "absl/random/internal/iostream_state_saver.h" diff --git a/absl/random/bit_gen_ref.h b/absl/random/bit_gen_ref.h index ac26d9d4ab5..40e7b607399 100644 --- a/absl/random/bit_gen_ref.h +++ b/absl/random/bit_gen_ref.h @@ -24,13 +24,14 @@ #ifndef ABSL_RANDOM_BIT_GEN_REF_H_ #define ABSL_RANDOM_BIT_GEN_REF_H_ +#include #include #include #include #include "absl/base/attributes.h" +#include "absl/base/config.h" #include "absl/base/internal/fast_type_id.h" -#include "absl/base/macros.h" #include "absl/meta/type_traits.h" #include "absl/random/internal/distribution_caller.h" #include "absl/random/internal/fast_uniform_bits.h" diff --git a/absl/random/discrete_distribution.cc b/absl/random/discrete_distribution.cc index 081accee52a..247faa84fb1 100644 --- a/absl/random/discrete_distribution.cc +++ b/absl/random/discrete_distribution.cc @@ -14,6 +14,16 @@ #include "absl/random/discrete_distribution.h" +#include +#include +#include +#include +#include +#include +#include + +#include "absl/base/config.h" + namespace absl { ABSL_NAMESPACE_BEGIN namespace random_internal { diff --git a/absl/random/discrete_distribution.h b/absl/random/discrete_distribution.h index 171aa11a1eb..f579a64a8d9 100644 --- a/absl/random/discrete_distribution.h +++ b/absl/random/discrete_distribution.h @@ -16,14 +16,16 @@ #define ABSL_RANDOM_DISCRETE_DISTRIBUTION_H_ #include -#include +#include +#include #include #include -#include +#include #include #include #include +#include "absl/base/config.h" #include "absl/random/bernoulli_distribution.h" #include "absl/random/internal/iostream_state_saver.h" #include "absl/random/uniform_int_distribution.h" diff --git a/absl/random/exponential_distribution.h b/absl/random/exponential_distribution.h index b5caf8a1e1f..4af2fb482bf 100644 --- a/absl/random/exponential_distribution.h +++ b/absl/random/exponential_distribution.h @@ -21,6 +21,7 @@ #include #include +#include "absl/base/config.h" #include "absl/meta/type_traits.h" #include "absl/random/internal/fast_uniform_bits.h" #include "absl/random/internal/generate_real.h" diff --git a/absl/random/gaussian_distribution.h b/absl/random/gaussian_distribution.h index c24dd838822..ce84d4a56bc 100644 --- a/absl/random/gaussian_distribution.h +++ b/absl/random/gaussian_distribution.h @@ -26,6 +26,7 @@ #include #include #include +#include #include #include "absl/base/config.h" diff --git a/absl/random/internal/BUILD.bazel b/absl/random/internal/BUILD.bazel index 5e05130de8f..cf4b8f34f2c 100644 --- a/absl/random/internal/BUILD.bazel +++ b/absl/random/internal/BUILD.bazel @@ -59,6 +59,7 @@ cc_library( deps = [ "//absl/base:config", "//absl/base:fast_type_id", + "//absl/meta:type_traits", "//absl/utility", ], ) diff --git a/absl/random/internal/distribution_caller.h b/absl/random/internal/distribution_caller.h index 196b7e4bbf9..2534ca951de 100644 --- a/absl/random/internal/distribution_caller.h +++ b/absl/random/internal/distribution_caller.h @@ -17,11 +17,13 @@ #ifndef ABSL_RANDOM_INTERNAL_DISTRIBUTION_CALLER_H_ #define ABSL_RANDOM_INTERNAL_DISTRIBUTION_CALLER_H_ +#include #include #include #include "absl/base/config.h" #include "absl/base/internal/fast_type_id.h" +#include "absl/meta/type_traits.h" #include "absl/utility/utility.h" namespace absl { diff --git a/absl/random/log_uniform_int_distribution.h b/absl/random/log_uniform_int_distribution.h index 4afff8f604e..cbd5e0ca2ba 100644 --- a/absl/random/log_uniform_int_distribution.h +++ b/absl/random/log_uniform_int_distribution.h @@ -21,11 +21,8 @@ #include #include #include -#include -#include "absl/numeric/bits.h" -#include "absl/random/internal/fastmath.h" -#include "absl/random/internal/generate_real.h" +#include "absl/base/config.h" #include "absl/random/internal/iostream_state_saver.h" #include "absl/random/internal/traits.h" #include "absl/random/uniform_int_distribution.h" diff --git a/absl/random/mock_distributions.h b/absl/random/mock_distributions.h index b379262cb63..1983547327c 100644 --- a/absl/random/mock_distributions.h +++ b/absl/random/mock_distributions.h @@ -17,14 +17,14 @@ // ----------------------------------------------------------------------------- // // This file contains mock distribution functions for use alongside an -// `absl::MockingBitGen` object within the Googletest testing framework. Such +// `absl::MockingBitGen` object within the GoogleTest testing framework. Such // mocks are useful to provide deterministic values as return values within // (otherwise random) Abseil distribution functions. // // The return type of each function is a mock expectation object which // is used to set the match result. // -// More information about the Googletest testing framework is available at +// More information about the GoogleTest testing framework is available at // https://github.com/google/googletest // // EXPECT_CALL and ON_CALL need to be made within the same DLL component as diff --git a/absl/random/mocking_bit_gen.h b/absl/random/mocking_bit_gen.h index 65706964519..ba7ceae04aa 100644 --- a/absl/random/mocking_bit_gen.h +++ b/absl/random/mocking_bit_gen.h @@ -17,12 +17,12 @@ // ----------------------------------------------------------------------------- // // This file includes an `absl::MockingBitGen` class to use as a mock within the -// Googletest testing framework. Such a mock is useful to provide deterministic +// GoogleTest testing framework. Such a mock is useful to provide deterministic // values as return values within (otherwise random) Abseil distribution // functions. Such determinism within a mock is useful within testing frameworks // to test otherwise indeterminate APIs. // -// More information about the Googletest testing framework is available at +// More information about the GoogleTest testing framework is available at // https://github.com/google/googletest #ifndef ABSL_RANDOM_MOCKING_BIT_GEN_H_ @@ -34,7 +34,6 @@ #include #include "gmock/gmock.h" -#include "absl/base/attributes.h" #include "absl/base/config.h" #include "absl/base/internal/fast_type_id.h" #include "absl/container/flat_hash_map.h" @@ -58,7 +57,7 @@ class MockHelpers; // // `absl::MockingBitGen` is a mock Uniform Random Bit Generator (URBG) class // which can act in place of an `absl::BitGen` URBG within tests using the -// Googletest testing framework. +// GoogleTest testing framework. // // Usage: // diff --git a/absl/random/poisson_distribution.h b/absl/random/poisson_distribution.h index f4573082e10..ae2e095be37 100644 --- a/absl/random/poisson_distribution.h +++ b/absl/random/poisson_distribution.h @@ -17,11 +17,12 @@ #include #include +#include #include #include #include -#include +#include "absl/base/config.h" #include "absl/random/internal/fast_uniform_bits.h" #include "absl/random/internal/fastmath.h" #include "absl/random/internal/generate_real.h" @@ -48,8 +49,8 @@ ABSL_NAMESPACE_BEGIN // the distribution results are limited to the max() value. // // The goals of this implementation are to provide good performance while still -// beig thread-safe: This limits the implementation to not using lgamma provided -// by . +// being thread-safe: This limits the implementation to not using lgamma +// provided by . // template class poisson_distribution { diff --git a/absl/random/uniform_int_distribution.h b/absl/random/uniform_int_distribution.h index fae80252e39..0dc7c62c3e3 100644 --- a/absl/random/uniform_int_distribution.h +++ b/absl/random/uniform_int_distribution.h @@ -31,8 +31,9 @@ #include #include #include -#include +#include +#include "absl/base/config.h" #include "absl/base/optimization.h" #include "absl/random/internal/fast_uniform_bits.h" #include "absl/random/internal/iostream_state_saver.h" diff --git a/absl/random/uniform_real_distribution.h b/absl/random/uniform_real_distribution.h index 196833415e8..8bef9469ae1 100644 --- a/absl/random/uniform_real_distribution.h +++ b/absl/random/uniform_real_distribution.h @@ -37,8 +37,10 @@ #include #include #include +#include #include +#include "absl/base/config.h" #include "absl/meta/type_traits.h" #include "absl/random/internal/fast_uniform_bits.h" #include "absl/random/internal/generate_real.h" diff --git a/absl/random/zipf_distribution.h b/absl/random/zipf_distribution.h index 15f03eeb3f3..21e3b709b05 100644 --- a/absl/random/zipf_distribution.h +++ b/absl/random/zipf_distribution.h @@ -22,6 +22,7 @@ #include #include +#include "absl/base/config.h" #include "absl/random/internal/iostream_state_saver.h" #include "absl/random/internal/traits.h" #include "absl/random/uniform_real_distribution.h" @@ -58,7 +59,7 @@ class zipf_distribution { using distribution_type = zipf_distribution; // Preconditions: k >= 0, v > 0, q > 1 - // The precondidtions are validated when NDEBUG is not defined via + // The preconditions are validated when NDEBUG is not defined via // a pair of assert() directives. // If NDEBUG is defined and either or both of these parameters take invalid // values, the behavior of the class is undefined.