From 52d81357096301fc2da4985fb12c137a853f60b6 Mon Sep 17 00:00:00 2001 From: NorthFury Date: Sat, 27 May 2023 17:17:14 +0200 Subject: [PATCH] inline for loop variable --- Standard Gaming Platform/mousesystem.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Standard Gaming Platform/mousesystem.cpp b/Standard Gaming Platform/mousesystem.cpp index ffa479b8..55109c57 100644 --- a/Standard Gaming Platform/mousesystem.cpp +++ b/Standard Gaming Platform/mousesystem.cpp @@ -1377,10 +1377,9 @@ UINT16 GetScaledFontHeight() INT16 GetNumberOfLinesInHeight(const STR16 inputString) { INT32 fontHeight = GetScaledFontHeight(); - INT32 i; INT32 count = 1; INT32 stringLength = (INT32)wcslen(inputString); - for (i = 0; i < stringLength && count * (fontHeight + 1) < (SCREEN_HEIGHT - 10); i++) { + for (int i = 0; i < stringLength && count * (fontHeight + 1) < (SCREEN_HEIGHT - 10); i++) { if (inputString[i] == '\n' && i + 1 < stringLength) { count++; } @@ -1465,9 +1464,8 @@ INT16 GetWidthOfString(const STR16 inputString) INT16 lineWidth = 0; INT32 lineCounter = 0; - INT32 i; INT32 stringLength = (INT32)wcslen(inputString); - for (i = 0; i < stringLength; i++) { + for (int i = 0; i < stringLength; i++) { if (inputString[i] == '\n') { // if the lines don't fit the screen the last line is ... if ((lineCounter + 2) * (iFontHeight + 1) > (SCREEN_HEIGHT - 10)) { @@ -1534,9 +1532,8 @@ void DisplayHelpTokenizedString(const STR16 inputString, INT16 sX, INT16 sY) INT16 xDelta = 0; INT32 lineCounter = 0; - INT32 i; INT32 stringLength = (INT32)wcslen(inputString); - for (i = 0; i < stringLength; i++) { + for (int i = 0; i < stringLength; i++) { if (inputString[i] == '\n') { // if the lines don't fit the screen the last line is ... if ((lineCounter + 2) * (fontHeight + 1) > (SCREEN_HEIGHT - 10)) {