Skip to content

Commit 96bd371

Browse files
committed
libfoundation: Explicit signed-unsigned conversion.
1 parent 9c48efd commit 96bd371

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

libfoundation/src/foundation-unicode.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ bool MCUnicodeGetProperty(const unichar_t *p_chars, uindex_t p_char_count, MCUni
355355
{
356356
int32_t t_prop;
357357
t_prop = MCUnicodeGetIntegerProperty(t_char, p_property);
358-
if (t_prop < 0 || t_prop > UINT8_MAX)
358+
if (t_prop < 0 || uint32_t(t_prop) > UINT8_MAX)
359359
return false;
360360
((uint8_t*)x_result_array)[t_offset] = uint8_t(t_prop);
361361
if (t_advance == 2)
@@ -367,7 +367,7 @@ bool MCUnicodeGetProperty(const unichar_t *p_chars, uindex_t p_char_count, MCUni
367367
{
368368
int32_t t_prop;
369369
t_prop = MCUnicodeGetIntegerProperty(t_char, p_property);
370-
if (t_prop < 0 || t_prop > UINT16_MAX)
370+
if (t_prop < 0 || uint32_t(t_prop) > UINT16_MAX)
371371
return false;
372372
((uint16_t*)x_result_array)[t_offset] = uint16_t(t_prop);
373373
if (t_advance == 2)
@@ -379,7 +379,7 @@ bool MCUnicodeGetProperty(const unichar_t *p_chars, uindex_t p_char_count, MCUni
379379
{
380380
int32_t t_prop;
381381
t_prop = MCUnicodeGetIntegerProperty(t_char, p_property);
382-
if (t_prop < 0 || t_prop > UINT32_MAX)
382+
if (t_prop < 0 || uint32_t(t_prop) > UINT32_MAX)
383383
return false;
384384
((uint32_t*)x_result_array)[t_offset] = uint32_t(t_prop);
385385
if (t_advance == 2)

0 commit comments

Comments
 (0)