Skip to content

Commit 5429d6c

Browse files
committed
Remove more signed to unsigned conversions in emotion_mmi.cpp, emotion_special.cpp
1 parent b3fa560 commit 5429d6c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/core/ee/emotion_mmi.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2631,7 +2631,7 @@ void EmotionInterpreter::div1(EmotionEngine &cpu, uint32_t instruction)
26312631
op2 = cpu.get_gpr<int32_t>(op2);
26322632
if (op1 == 0x80000000 && op2 == 0xFFFFFFFF)
26332633
{
2634-
cpu.set_LO_HI((int64_t)(int32_t)0x80000000, 0, true);
2634+
cpu.set_LO_HI(0xFFFFFFFF'80000000, 0, true);
26352635
}
26362636
else if (op2)
26372637
{
@@ -2660,7 +2660,7 @@ void EmotionInterpreter::divu1(EmotionEngine &cpu, uint32_t instruction)
26602660
}
26612661
else
26622662
{
2663-
cpu.set_LO_HI((int64_t)-1, (int64_t)(int32_t)op1, true);
2663+
cpu.set_LO_HI(UINT64_MAX, (int64_t)(int32_t)op1, true);
26642664
}
26652665
}
26662666

src/core/ee/emotion_special.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ void EmotionInterpreter::div(EmotionEngine &cpu, uint32_t instruction)
527527
op2 = cpu.get_gpr<int32_t>(op2);
528528
if (op1 == 0x80000000 && op2 == 0xFFFFFFFF)
529529
{
530-
cpu.set_LO_HI((int64_t)(int32_t)0x80000000, 0);
530+
cpu.set_LO_HI(0xFFFFFFFF'80000000, 0);
531531
}
532532
else if (op2)
533533
{
@@ -556,7 +556,7 @@ void EmotionInterpreter::divu(EmotionEngine &cpu, uint32_t instruction)
556556
}
557557
else
558558
{
559-
cpu.set_LO_HI((int64_t)-1, (int64_t)(int32_t)op1);
559+
cpu.set_LO_HI(UINT64_MAX, (int64_t)(int32_t)op1);
560560
}
561561
}
562562

0 commit comments

Comments
 (0)