Skip to content

Commit b0e0c59

Browse files
authored
Merge pull request #12775 from fowles/23.x
fix: avoid warnings with MSVC (#12762)
2 parents 0ce78c6 + e034aad commit b0e0c59

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/google/protobuf/has_bits.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class HasBits {
7171
}
7272

7373
void Or(const HasBits<doublewords>& rhs) {
74-
for (size_t i = 0; i < doublewords; i++) has_bits_[i] |= rhs[i];
74+
for (size_t i = 0; i < doublewords; i++) has_bits_[i] |= rhs.has_bits_[i];
7575
}
7676

7777
bool empty() const;

src/google/protobuf/string_block.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,11 @@ inline size_t StringBlock::NextSize(StringBlock* block) {
142142
}
143143

144144
inline StringBlock* StringBlock::Emplace(void* p, size_t n, StringBlock* next) {
145-
ABSL_DCHECK_EQ(n, NextSize(next));
146-
uint32_t doubled = static_cast<uint32_t>(n) * 2;
145+
const auto count = static_cast<uint32_t>(n);
146+
ABSL_DCHECK_EQ(count, NextSize(next));
147+
uint32_t doubled = count * 2;
147148
uint32_t next_size = next ? std::min(doubled, max_size()) : min_size();
148-
return new (p) StringBlock(next, false, RoundedSize(n), next_size);
149+
return new (p) StringBlock(next, false, RoundedSize(count), next_size);
149150
}
150151

151152
inline StringBlock* StringBlock::New(StringBlock* next) {

0 commit comments

Comments
 (0)