Skip to content

Commit

Permalink
IWYU: Update includes and fix minor spelling mistakes.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 697000534
Change-Id: Ia885033535c5e2f57884a922bdcff9db7b565f49
  • Loading branch information
laramiel authored and copybara-github committed Nov 15, 2024
1 parent e3cf5b3 commit 917bfee
Show file tree
Hide file tree
Showing 18 changed files with 46 additions and 22 deletions.
3 changes: 1 addition & 2 deletions absl/random/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions absl/random/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
4 changes: 3 additions & 1 deletion absl/random/bernoulli_distribution.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@
#ifndef ABSL_RANDOM_BERNOULLI_DISTRIBUTION_H_
#define ABSL_RANDOM_BERNOULLI_DISTRIBUTION_H_

#include <cassert>
#include <cstdint>
#include <istream>
#include <limits>
#include <ostream>

#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"
Expand Down
4 changes: 3 additions & 1 deletion absl/random/beta_distribution.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@

#include <cassert>
#include <cmath>
#include <cstdint>
#include <istream>
#include <limits>
#include <ostream>
#include <type_traits>

#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"

Expand Down
3 changes: 2 additions & 1 deletion absl/random/bit_gen_ref.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@
#ifndef ABSL_RANDOM_BIT_GEN_REF_H_
#define ABSL_RANDOM_BIT_GEN_REF_H_

#include <cstdint>
#include <limits>
#include <type_traits>
#include <utility>

#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"
Expand Down
10 changes: 10 additions & 0 deletions absl/random/discrete_distribution.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@

#include "absl/random/discrete_distribution.h"

#include <cassert>
#include <cmath>
#include <cstddef>
#include <iterator>
#include <numeric>
#include <utility>
#include <vector>

#include "absl/base/config.h"

namespace absl {
ABSL_NAMESPACE_BEGIN
namespace random_internal {
Expand Down
6 changes: 4 additions & 2 deletions absl/random/discrete_distribution.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@
#define ABSL_RANDOM_DISCRETE_DISTRIBUTION_H_

#include <cassert>
#include <cmath>
#include <cstddef>
#include <initializer_list>
#include <istream>
#include <limits>
#include <numeric>
#include <ostream>
#include <type_traits>
#include <utility>
#include <vector>

#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"
Expand Down
1 change: 1 addition & 0 deletions absl/random/exponential_distribution.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <limits>
#include <type_traits>

#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"
Expand Down
1 change: 1 addition & 0 deletions absl/random/gaussian_distribution.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <cstdint>
#include <istream>
#include <limits>
#include <ostream>
#include <type_traits>

#include "absl/base/config.h"
Expand Down
1 change: 1 addition & 0 deletions absl/random/internal/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ cc_library(
deps = [
"//absl/base:config",
"//absl/base:fast_type_id",
"//absl/meta:type_traits",
"//absl/utility",
],
)
Expand Down
2 changes: 2 additions & 0 deletions absl/random/internal/distribution_caller.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@
#ifndef ABSL_RANDOM_INTERNAL_DISTRIBUTION_CALLER_H_
#define ABSL_RANDOM_INTERNAL_DISTRIBUTION_CALLER_H_

#include <tuple>
#include <type_traits>
#include <utility>

#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 {
Expand Down
5 changes: 1 addition & 4 deletions absl/random/log_uniform_int_distribution.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,8 @@
#include <istream>
#include <limits>
#include <ostream>
#include <type_traits>

#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"
Expand Down
4 changes: 2 additions & 2 deletions absl/random/mock_distributions.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions absl/random/mocking_bit_gen.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_
Expand All @@ -34,7 +34,6 @@
#include <utility>

#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"
Expand All @@ -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:
//
Expand Down
7 changes: 4 additions & 3 deletions absl/random/poisson_distribution.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@

#include <cassert>
#include <cmath>
#include <cstdint>
#include <istream>
#include <limits>
#include <ostream>
#include <type_traits>

#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"
Expand All @@ -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 <math.h>.
// being thread-safe: This limits the implementation to not using lgamma
// provided by <math.h>.
//
template <typename IntType = int>
class poisson_distribution {
Expand Down
3 changes: 2 additions & 1 deletion absl/random/uniform_int_distribution.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@
#include <cassert>
#include <istream>
#include <limits>
#include <type_traits>
#include <ostream>

#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"
Expand Down
2 changes: 2 additions & 0 deletions absl/random/uniform_real_distribution.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@
#include <cstdint>
#include <istream>
#include <limits>
#include <ostream>
#include <type_traits>

#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"
Expand Down
3 changes: 2 additions & 1 deletion absl/random/zipf_distribution.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <ostream>
#include <type_traits>

#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"
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 917bfee

Please sign in to comment.