From 9772201345ab47cc820fd6c08247c133605f8b84 Mon Sep 17 00:00:00 2001 From: RSDuck Date: Fri, 4 Sep 2020 20:37:14 +0200 Subject: remove some UB - savestates used to read a four bytes from a single byte value - a few unassigned variables - some other things - also make the ROR macro an inline function --- src/ARM.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/ARM.h') diff --git a/src/ARM.h b/src/ARM.h index deacbee..52c971a 100644 --- a/src/ARM.h +++ b/src/ARM.h @@ -24,7 +24,10 @@ #include "types.h" #include "NDS.h" -#define ROR(x, n) (((x) >> (n)) | ((x) << (32-(n)))) +inline u32 ROR(u32 x, u32 n) +{ + return (x >> (n&0x1F)) | (x << ((32-n)&0x1F)); +} enum { -- cgit v1.2.3