From f3587e8eb610bf9aa85d496f5c5fb6f2a408a99f Mon Sep 17 00:00:00 2001 From: Pavel P Date: Mon, 23 Feb 2026 09:39:00 -0800 Subject: [PATCH] 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 35fac454ed69db264ec37f0ff4f25a011d1a075d PiperOrigin-RevId: 874117339 --- third_party/utf8_range/utf8_range.c | 2 +- third_party/utf8_range/utf8_range.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/third_party/utf8_range/utf8_range.c b/third_party/utf8_range/utf8_range.c index 049e2e2150..f3301cc270 100644 --- a/third_party/utf8_range/utf8_range.c +++ b/third_party/utf8_range/utf8_range.c @@ -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; } diff --git a/third_party/utf8_range/utf8_range.h b/third_party/utf8_range/utf8_range.h index d7c2326160..5942d80ecd 100644 --- a/third_party/utf8_range/utf8_range.h +++ b/third_party/utf8_range/utf8_range.h @@ -1,6 +1,7 @@ #ifndef THIRD_PARTY_UTF8_RANGE_UTF8_RANGE_H_ #define THIRD_PARTY_UTF8_RANGE_UTF8_RANGE_H_ +#include #include #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.