mirror of
https://github.com/protocolbuffers/protobuf
synced 2026-08-26 02:23:14 -04:00
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:
parent
be1292fbe2
commit
f3587e8eb6
2 changed files with 3 additions and 2 deletions
2
third_party/utf8_range/utf8_range.c
vendored
2
third_party/utf8_range/utf8_range.c
vendored
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
3
third_party/utf8_range/utf8_range.h
vendored
3
third_party/utf8_range/utf8_range.h
vendored
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue