Skip to content

Commit 98e4f7e

Browse files
authored
refactor: Remove superfluous defines from Language.h (#1739)
1 parent 84017ea commit 98e4f7e

File tree

8 files changed

+10
-54
lines changed

8 files changed

+10
-54
lines changed

Generals/Code/GameEngine/Include/Common/Language.h

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -75,27 +75,6 @@ typedef enum
7575

7676
} LanguageID;
7777

78-
#define GameStrcpy wcscpy
79-
#define GameStrlen wcslen
80-
#define GameStrcat wcscat
81-
#define GameStrcmp wcscmp
82-
#define GameStrncmp wcsncmp
83-
#define GameStricmp wcsicmp
84-
#define GameStrnicmp wcsnicmp
85-
#define GameStrtok wcstok
86-
#define GameSprintf swprintf
87-
#define GameVsprintf vswprintf
88-
/// @todo -- add a non-malloc-based string dup func #define GameStrdup wcsdup
89-
#define GameAtoi(S) wcstol( (S), NULL, 10)
90-
#define GameAtod(S) wcstod( (S), NULL )
91-
#define GameItoa _itow
92-
#define GameSscanf swscanf
93-
#define GameStrstr wcsstr
94-
#define GameStrchr wcschr
95-
#define GameIsDigit iswdigit
96-
#define GameIsAscii iswascii
97-
#define GameIsAlNum iswalnum
98-
#define GameIsAlpha iswalpha
9978
#define GameArrayEnd(array) (array)[(sizeof(array)/sizeof((array)[0]))-1] = 0
10079

10180
// INLINING ///////////////////////////////////////////////////////////////////

Generals/Code/GameEngine/Source/GameClient/GUI/GameWindowGlobal.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
#include "PreRTS.h" // This must go first in EVERY cpp file int the GameEngine
4949

5050
// USER INCLUDES //////////////////////////////////////////////////////////////
51-
#include "Common/Language.h"
5251
#include "GameClient/Image.h"
5352
#include "GameClient/Display.h"
5453
#include "GameClient/GameWindowManager.h"
@@ -196,7 +195,7 @@ Int GameWindowManager::winFontHeight( GameFont *font )
196195
Int GameWindowManager::winIsDigit( Int c )
197196
{
198197

199-
return GameIsDigit( c );
198+
return iswdigit( c );
200199

201200
}
202201

@@ -206,7 +205,7 @@ Int GameWindowManager::winIsDigit( Int c )
206205
Int GameWindowManager::winIsAscii( Int c )
207206
{
208207

209-
return GameIsAscii( c );
208+
return iswascii( c );
210209

211210
}
212211

@@ -216,7 +215,7 @@ Int GameWindowManager::winIsAscii( Int c )
216215
Int GameWindowManager::winIsAlNum( Int c )
217216
{
218217

219-
return GameIsAlNum( c );
218+
return iswalnum( c );
220219

221220
}
222221

Generals/Code/GameEngine/Source/GameClient/GUI/IMEManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1130,7 +1130,7 @@ void IMEManager::updateCompositionString( void )
11301130
else
11311131
{
11321132
m_compositionCursorPos = (ImmGetCompositionString( m_context, GCS_CURSORPOS, NULL, 0) & 0xffff );
1133-
convRes = GameStrlen ( m_compositionString );
1133+
convRes = wcslen( m_compositionString );
11341134
}
11351135

11361136
// m_compositionCursorPos is in DBCS characters, need to convert it to Wide characters

Generals/Code/GameEngine/Source/GameClient/Input/Keyboard.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,7 @@ WideChar Keyboard::translateKey( WideChar keyCode )
927927
return( m_keyNames[ ubKeyCode ].shifted2 );
928928
}
929929

930-
if( isShift() || getCapsState() && GameIsAlpha( m_keyNames[ ubKeyCode ].stdKey ) )
930+
if( isShift() || getCapsState() && iswalpha( m_keyNames[ ubKeyCode ].stdKey ) )
931931
{
932932
return( m_keyNames[ ubKeyCode ].shifted );
933933
}

GeneralsMD/Code/GameEngine/Include/Common/Language.h

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -75,27 +75,6 @@ typedef enum
7575

7676
} LanguageID;
7777

78-
#define GameStrcpy wcscpy
79-
#define GameStrlen wcslen
80-
#define GameStrcat wcscat
81-
#define GameStrcmp wcscmp
82-
#define GameStrncmp wcsncmp
83-
#define GameStricmp wcsicmp
84-
#define GameStrnicmp wcsnicmp
85-
#define GameStrtok wcstok
86-
#define GameSprintf swprintf
87-
#define GameVsprintf vswprintf
88-
/// @todo -- add a non-malloc-based string dup func #define GameStrdup wcsdup
89-
#define GameAtoi(S) wcstol( (S), NULL, 10)
90-
#define GameAtod(S) wcstod( (S), NULL )
91-
#define GameItoa _itow
92-
#define GameSscanf swscanf
93-
#define GameStrstr wcsstr
94-
#define GameStrchr wcschr
95-
#define GameIsDigit iswdigit
96-
#define GameIsAscii iswascii
97-
#define GameIsAlNum iswalnum
98-
#define GameIsAlpha iswalpha
9978
#define GameArrayEnd(array) (array)[(sizeof(array)/sizeof((array)[0]))-1] = 0
10079

10180
// INLINING ///////////////////////////////////////////////////////////////////

GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowGlobal.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
#include "PreRTS.h" // This must go first in EVERY cpp file int the GameEngine
4949

5050
// USER INCLUDES //////////////////////////////////////////////////////////////
51-
#include "Common/Language.h"
5251
#include "GameClient/Image.h"
5352
#include "GameClient/Display.h"
5453
#include "GameClient/GameWindowManager.h"
@@ -196,7 +195,7 @@ Int GameWindowManager::winFontHeight( GameFont *font )
196195
Int GameWindowManager::winIsDigit( Int c )
197196
{
198197

199-
return GameIsDigit( c );
198+
return iswdigit( c );
200199

201200
}
202201

@@ -206,7 +205,7 @@ Int GameWindowManager::winIsDigit( Int c )
206205
Int GameWindowManager::winIsAscii( Int c )
207206
{
208207

209-
return GameIsAscii( c );
208+
return iswascii( c );
210209

211210
}
212211

@@ -216,7 +215,7 @@ Int GameWindowManager::winIsAscii( Int c )
216215
Int GameWindowManager::winIsAlNum( Int c )
217216
{
218217

219-
return GameIsAlNum( c );
218+
return iswalnum( c );
220219

221220
}
222221

GeneralsMD/Code/GameEngine/Source/GameClient/GUI/IMEManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1130,7 +1130,7 @@ void IMEManager::updateCompositionString( void )
11301130
else
11311131
{
11321132
m_compositionCursorPos = (ImmGetCompositionString( m_context, GCS_CURSORPOS, NULL, 0) & 0xffff );
1133-
convRes = GameStrlen ( m_compositionString );
1133+
convRes = wcslen( m_compositionString );
11341134
}
11351135

11361136
// m_compositionCursorPos is in DBCS characters, need to convert it to Wide characters

GeneralsMD/Code/GameEngine/Source/GameClient/Input/Keyboard.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,7 @@ WideChar Keyboard::translateKey( WideChar keyCode )
927927
return( m_keyNames[ ubKeyCode ].shifted2 );
928928
}
929929

930-
if( isShift() || getCapsState() && GameIsAlpha( m_keyNames[ ubKeyCode ].stdKey ) )
930+
if( isShift() || getCapsState() && iswalpha( m_keyNames[ ubKeyCode ].stdKey ) )
931931
{
932932
return( m_keyNames[ ubKeyCode ].shifted );
933933
}

0 commit comments

Comments
 (0)