Avoid implicit int to bool conversion (#25443)

Closes #25443

COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/25443 from pps83:main-int-bool-cast 35fac454ed
PiperOrigin-RevId: 874117339
This commit is contained in:
Pavel P 2026-02-23 09:39:00 -08:00 committed by Copybara-Service
parent be1292fbe2
commit f3587e8eb6
2 changed files with 3 additions and 2 deletions

View file

@ -198,7 +198,7 @@ static FORCE_INLINE_ATTR size_t utf8_range_Validate(
#endif
}
int utf8_range_IsValid(const char* data, size_t len) {
bool utf8_range_IsValid(const char* data, size_t len) {
return utf8_range_Validate(data, len, /*return_position=*/0) != 0;
}

View file

@ -1,6 +1,7 @@
#ifndef THIRD_PARTY_UTF8_RANGE_UTF8_RANGE_H_
#define THIRD_PARTY_UTF8_RANGE_UTF8_RANGE_H_
#include <stdbool.h>
#include <stddef.h>
#ifdef __cplusplus
@ -9,7 +10,7 @@ extern "C" {
// Returns 1 if the sequence of characters is a valid UTF-8 sequence, otherwise
// 0.
int utf8_range_IsValid(const char* data, size_t len);
bool utf8_range_IsValid(const char* data, size_t len);
// Returns the length in bytes of the prefix of str that is all
// structurally valid UTF-8.