From 0a4129ff567602d425fecc63ff9690c86dfc4a6e Mon Sep 17 00:00:00 2001 From: nukeykt Date: Tue, 3 Dec 2019 07:12:32 +0900 Subject: [PATCH] RandomWord should be unsigned --- source/exhumed/src/random.cpp | 2 +- source/exhumed/src/random.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/source/exhumed/src/random.cpp b/source/exhumed/src/random.cpp index dff326b0d..446061709 100644 --- a/source/exhumed/src/random.cpp +++ b/source/exhumed/src/random.cpp @@ -54,7 +54,7 @@ char RandomByte() return randByte; } -short RandomWord() +uint16_t RandomWord() { short randWord = RandomByte() << 8; randWord |= RandomByte(); diff --git a/source/exhumed/src/random.h b/source/exhumed/src/random.h index a6e847146..cec5a7abf 100644 --- a/source/exhumed/src/random.h +++ b/source/exhumed/src/random.h @@ -18,13 +18,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef __random_h__ #define __random_h__ +#include "compat.h" BEGIN_PS_NS void InitRandom(); int RandomBit(); char RandomByte(); -short RandomWord(); +uint16_t RandomWord(); int RandomLong(); int RandomSize(int nSize);