From 0beaf375faa5ea384ce25444e53ce88dfba153f6 Mon Sep 17 00:00:00 2001 From: Justin Scofield Date: Tue, 12 Jul 2022 21:33:19 -0400 Subject: [PATCH] formatting --- src/app/core/common.cc | 58 +++++++++++++++++++----------------------- src/app/core/common.h | 5 ---- 2 files changed, 26 insertions(+), 37 deletions(-) diff --git a/src/app/core/common.cc b/src/app/core/common.cc index 98a48e25..b116c437 100644 --- a/src/app/core/common.cc +++ b/src/app/core/common.cc @@ -18,42 +18,36 @@ int AddressFromBytes(uint8_t addr1, uint8_t addr2, uint8_t addr3) { return (addr1 << 16) | (addr2 << 8) | addr3; } -//hextodec has been imported from SNESDisasm to parse hex numbers -int HexToDec(char *input, int length) -{ - int result = 0; - int value; - int ceiling = length - 1; - int power16 = 16; +// hextodec has been imported from SNESDisasm to parse hex numbers +int HexToDec(char *input, int length) { + int result = 0; + int value; + int ceiling = length - 1; + int power16 = 16; - int j = ceiling; + int j = ceiling; - for( ; j >= 0; j--) - { - if(input[j] >= 'A' && input[j] <= 'F') - { - value = input[j] - 'F'; - value += 15; - } - else - { - value = input[j] - '9'; - value += 9; - } - - if(j == ceiling) - { - result += value; - continue; - } - - result += (value * power16); - power16 *= 16; + for (; j >= 0; j--) { + if (input[j] >= 'A' && input[j] <= 'F') { + value = input[j] - 'F'; + value += 15; + } else { + value = input[j] - '9'; + value += 9; } - - return result; + + if (j == ceiling) { + result += value; + continue; + } + + result += (value * power16); + power16 *= 16; + } + + return result; } } // namespace core } // namespace app -} // namespace premia +} // namespace yaze diff --git a/src/app/core/common.h b/src/app/core/common.h index 481a876f..5217f66f 100644 --- a/src/app/core/common.h +++ b/src/app/core/common.h @@ -11,11 +11,6 @@ unsigned int SnesToPc(unsigned int addr); int AddressFromBytes(uint8_t addr1, uint8_t addr2, uint8_t addr3); int HexToDec(char *input, int length); -template -T* ReserveBytes(size_t size) { - auto bytes = new T[size]; -} - } // namespace core } // namespace app } // namespace yaze