tree-wide: use UINT64_MAX or friends

This commit is contained in:
Yu Watanabe
2021-03-05 07:10:13 +09:00
parent ef1e0b9a46
commit f5fbe71d95
150 changed files with 530 additions and 528 deletions
+5 -5
View File
@@ -114,7 +114,7 @@ int cunescape_one(const char *p, size_t length, char32_t *ret, bool *eight_bit,
* instead be copied directly.
*/
if (length != (size_t) -1 && length < 1)
if (length != SIZE_MAX && length < 1)
return -EINVAL;
switch (p[0]) {
@@ -159,7 +159,7 @@ int cunescape_one(const char *p, size_t length, char32_t *ret, bool *eight_bit,
/* hexadecimal encoding */
int a, b;
if (length != (size_t) -1 && length < 3)
if (length != SIZE_MAX && length < 3)
return -EINVAL;
a = unhexchar(p[1]);
@@ -187,7 +187,7 @@ int cunescape_one(const char *p, size_t length, char32_t *ret, bool *eight_bit,
size_t i;
uint32_t c;
if (length != (size_t) -1 && length < 5)
if (length != SIZE_MAX && length < 5)
return -EINVAL;
for (i = 0; i < 4; i++) {
@@ -214,7 +214,7 @@ int cunescape_one(const char *p, size_t length, char32_t *ret, bool *eight_bit,
size_t i;
char32_t c;
if (length != (size_t) -1 && length < 9)
if (length != SIZE_MAX && length < 9)
return -EINVAL;
for (i = 0; i < 8; i++) {
@@ -251,7 +251,7 @@ int cunescape_one(const char *p, size_t length, char32_t *ret, bool *eight_bit,
int a, b, c;
char32_t m;
if (length != (size_t) -1 && length < 3)
if (length != SIZE_MAX && length < 3)
return -EINVAL;
a = unoctchar(p[0]);