Random minor fixes (#757)

* Fix incorrect/questionable assert() usage

Originally reported by https://lgtm.com/projects/g/Arisotura/melonDS/?mode=tree&ruleFocus=2159000700,
but also includes a bunch of other fixes.

* Fix some `printf` warnings

Rule https://lgtm.com/projects/g/Arisotura/melonDS/?mode=tree&ruleFocus=2160310550

* Remove useless check

It is never passed thanks to `if (num_in < 1) {...; return}` before
Rule https://lgtm.com/projects/g/Arisotura/melonDS/?mode=tree&ruleFocus=2154840804

* Add missing header guard, rename other to avoid conflicts

Rule https://lgtm.com/projects/g/Arisotura/melonDS/?mode=tree&ruleFocus=2163210746

* Make DSi_SDDevice destructor virtual

Rule https://lgtm.com/projects/g/Arisotura/melonDS/?mode=tree&ruleFocus=2158670642

* Use thread-safe localtime_r, assign `time` result directly

Rule https://lgtm.com/projects/g/Arisotura/melonDS/?mode=tree&ruleFocus=2154840805

* Fix MinGW build

It needs _POSIX_THREAD_SAFE_FUNCTIONS to export `localtime_r`
This commit is contained in:
Valeri
2020-10-01 14:44:09 +03:00
committed by GitHub
parent 9d5791f8e5
commit 0d845c9e69
12 changed files with 44 additions and 37 deletions

View File

@ -209,7 +209,8 @@ void Compiler::A_Comp_Arith()
Comp_ArithTriOp(&Compiler::AND, rd, rn, op2, carryUsed, sFlag|opSymmetric|opInvertOp2);
break;
default:
assert("unimplemented");
printf("this is a JIT bug! %04x\n", op);
abort();
}
if (CurInstr.A_Reg(12) == 15)
@ -566,7 +567,7 @@ OpArg Compiler::Comp_RegShiftImm(int op, int amount, OpArg rm, bool S, bool& car
return R(RSCRATCH);
}
assert(false);
abort();
}
void Compiler::T_Comp_ShiftImm()
@ -779,4 +780,4 @@ void Compiler::T_Comp_RelAddr()
MOV(32, rd, Imm32((R15 & ~2) + offset));
}
}
}

View File

@ -1,5 +1,5 @@
#ifndef ARMJIT_COMPILER_H
#define ARMJIT_COMPILER_H
#ifndef ARMJIT_X64_COMPILER_H
#define ARMJIT_X64_COMPILER_H
#include "../dolphin/x64Emitter.h"
@ -252,4 +252,4 @@ public:
}
#endif
#endif

View File

@ -39,7 +39,7 @@ s32 Compiler::RewriteMemAccess(u64 pc)
return patch.Offset;
}
printf("this is a JIT bug %x\n", pc);
printf("this is a JIT bug %llx\n", pc);
abort();
}
@ -819,4 +819,4 @@ void Compiler::T_Comp_LDMIA_STMIA()
ADD(32, rb, Imm8(offset));
}
}
}