Skip to content

Commit 1a5f659

Browse files
committed
[Bug 15639] Remove some signed/unsigned comparison errors.
1 parent 5499931 commit 1a5f659

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

engine/src/graphics_util.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ inline MCGRectangle MCRectangle32ToMCGRectangle(const MCRectangle32 &p_rect)
107107
inline MCRectangle32 MCRectangle32FromMCGIntegerRectangle(const MCGIntegerRectangle &p_rect)
108108
{
109109
return MCRectangle32Make(p_rect.origin.x, p_rect.origin.y,
110-
int32_t(MCMin(p_rect.size.width, INT32_MAX)),
111-
int32_t(MCMin(p_rect.size.height, INT32_MAX)));
110+
int32_t(MCMin(p_rect.size.width, uint32_t(INT32_MAX))),
111+
int32_t(MCMin(p_rect.size.height, uint32_t(INT32_MAX))));
112112
}
113113

114114
inline MCGIntegerRectangle MCRectangle32ToMCGIntegerRectangle(const MCRectangle32 &p_rect)
@@ -129,8 +129,8 @@ inline MCRectangle MCRectangleFromMCGIntegerRectangle(const MCGIntegerRectangle
129129
{
130130
return MCRectangleMake(int16_t(MCClamp(p_rect.origin.x, INT16_MIN, INT16_MAX)),
131131
int16_t(MCClamp(p_rect.origin.y, INT16_MIN, INT16_MAX)),
132-
uint16_t(MCClamp(p_rect.size.width, 0, UINT16_MAX)),
133-
uint16_t(MCClamp(p_rect.size.height, 0, UINT16_MAX)));
132+
uint16_t(MCClamp(p_rect.size.width, 0U, uint32_t(UINT16_MAX))),
133+
uint16_t(MCClamp(p_rect.size.height, 0U, uint32_t(UINT16_MAX))));
134134
}
135135

136136
////////////////////////////////////////////////////////////////////////////////

libscript/src/script-builder.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,10 +1239,10 @@ void MCScriptEndHandlerInModule(MCScriptModuleBuilderRef self)
12391239

12401240
__emit_position(self, t_pos_address_offset + t_address, self -> instructions[i] . file, self -> instructions[i] . line);
12411241

1242-
__emit_bytecode_byte(self, t_op | (MCMin(t_arity, 15) << 4));
1242+
__emit_bytecode_byte(self, t_op | (MCMin(t_arity, 15U) << 4));
12431243

1244-
if (t_arity >= 15)
1245-
__emit_bytecode_byte(self, t_arity - 15);
1244+
if (t_arity >= 15U)
1245+
__emit_bytecode_byte(self, t_arity - 15U);
12461246

12471247
for(uindex_t j = 0; j < t_arity; j++)
12481248
__emit_bytecode_uint(self, t_operands[j]);

0 commit comments

Comments
 (0)