summaryrefslogtreecommitdiff
path: root/absl
diff options
context:
space:
mode:
authorGravatar Alexander Ignatyev <alexander.ignatyev@mongodb.com>2023-11-02 10:20:15 -0700
committerGravatar Copybara-Service <copybara-worker@google.com>2023-11-02 10:21:14 -0700
commit7135ec61db16de640749194838e4337034451f8d (patch)
treed2e968c6467e17967692b8bf8d2314f2224743e9 /absl
parent065d50d9f835cce8e4ee8f6d595518c409669901 (diff)
PR #1559: Fix comparison of integer expressions of different signedness warning
Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/1559 ``` //absl/hash/internal/hash.h:633:21: error: comparison of integer expressions of different signedness: 'int' and 'long unsigned int' [-Werror=sign-compare] ``` This warning is specific to the hashing of `std::bitset<>` on Big Endian platforms such as s390x Merge 3f34d808c8689ffa47a798112ab44c0e3b32faa4 into 065d50d9f835cce8e4ee8f6d595518c409669901 Merging this change closes #1559 COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/1559 from aligusnet:20211102.0-mongo 3f34d808c8689ffa47a798112ab44c0e3b32faa4 PiperOrigin-RevId: 578897545 Change-Id: Ifd1c947af3ad01e8e2a6241030ed29fb00842d53
Diffstat (limited to 'absl')
-rw-r--r--absl/hash/internal/hash.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/absl/hash/internal/hash.h b/absl/hash/internal/hash.h
index ef3f3664..300c63af 100644
--- a/absl/hash/internal/hash.h
+++ b/absl/hash/internal/hash.h
@@ -818,7 +818,7 @@ AbslHashValue(H hash_state, const absl::variant<T...>& v) {
template <typename H, size_t N>
H AbslHashValue(H hash_state, const std::bitset<N>& set) {
typename H::AbslInternalPiecewiseCombiner combiner;
- for (int i = 0; i < N; i++) {
+ for (size_t i = 0; i < N; i++) {
unsigned char c = static_cast<unsigned char>(set[i]);
hash_state = combiner.add_buffer(std::move(hash_state), &c, sizeof(c));
}