Skip to content

Commit 94354fd

Browse files
authored
refactor(string): Fix constness of TheEmptyString (#1930)
1 parent 0410990 commit 94354fd

File tree

10 files changed

+12
-12
lines changed

10 files changed

+12
-12
lines changed

Core/GameEngine/Include/Common/AsciiString.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class AsciiString
125125
string, so we don't need to construct temporaries
126126
for such a common thing.
127127
*/
128-
static AsciiString TheEmptyString;
128+
static const AsciiString TheEmptyString;
129129

130130
/**
131131
Default constructor -- construct a new, empty AsciiString.

Core/GameEngine/Include/Common/UnicodeString.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class UnicodeString
125125
string, so we don't need to construct temporaries
126126
for such a common thing.
127127
*/
128-
static UnicodeString TheEmptyString;
128+
static const UnicodeString TheEmptyString;
129129

130130
/**
131131
Default constructor -- construct a new, empty UnicodeString.

Core/GameEngine/Source/Common/System/AsciiString.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949

5050
// -----------------------------------------------------
5151

52-
/*static*/ AsciiString AsciiString::TheEmptyString;
52+
/*static*/ const AsciiString AsciiString::TheEmptyString;
5353

5454
//-----------------------------------------------------------------------------
5555
inline char* skipSeps(char* p, const char* seps)

Core/GameEngine/Source/Common/System/UnicodeString.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949

5050
// -----------------------------------------------------
5151

52-
/*static*/ UnicodeString UnicodeString::TheEmptyString;
52+
/*static*/ const UnicodeString UnicodeString::TheEmptyString;
5353

5454
// -----------------------------------------------------
5555
#ifdef RTS_DEBUG

Generals/Code/GameEngine/Include/GameClient/IMEManager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class IMEManagerInterface : public SubsystemInterface
8888

8989

9090
virtual Int getCandidateCount() = 0; ///< Returns the total number of candidates
91-
virtual UnicodeString*getCandidate( Int index ) = 0; ///< Returns the candidate string
91+
virtual const UnicodeString* getCandidate( Int index ) = 0; ///< Returns the candidate string
9292
virtual Int getSelectedCandidateIndex() = 0; ///< Returns the indexed of the currently selected candidate
9393
virtual Int getCandidatePageSize() = 0; ///< Returns the page size for the candidates list
9494
virtual Int getCandidatePageStart() = 0; ///< Returns the index of the first visibel candidate

Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/IMECandidate.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ void IMECandidateTextAreaDraw( GameWindow *window, WinInstanceData *instData )
202202

203203
for ( Int i = 0; i < count; i++, y+= height )
204204
{
205-
UnicodeString *candidate = ime->getCandidate( first + i );
205+
const UnicodeString *candidate = ime->getCandidate( first + i );
206206
Int tcolor, bcolor;
207207

208208
if ( i == selected )

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class IMEManager : public IMEManagerInterface
109109
virtual Int getIndexBase( void ); ///< Get index base for candidate list
110110

111111
virtual Int getCandidateCount(); ///< Returns the total number of candidates
112-
virtual UnicodeString*getCandidate( Int index ); ///< Returns the candidate string
112+
virtual const UnicodeString* getCandidate( Int index ); ///< Returns the candidate string
113113
virtual Int getSelectedCandidateIndex(); ///< Returns the indexed of the currently selected candidate
114114
virtual Int getCandidatePageSize(); ///< Returns the page size for the candidates list
115115
virtual Int getCandidatePageStart(); ///< Returns the index of the first visibel candidate
@@ -1525,7 +1525,7 @@ Int IMEManager::getCandidateCount()
15251525
// IMEManager::getCandidate
15261526
//============================================================================
15271527

1528-
UnicodeString* IMEManager::getCandidate( Int index )
1528+
const UnicodeString* IMEManager::getCandidate( Int index )
15291529
{
15301530
if ( m_candidateString != NULL && index >=0 && index < m_candidateCount )
15311531
{

GeneralsMD/Code/GameEngine/Include/GameClient/IMEManager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class IMEManagerInterface : public SubsystemInterface
8888

8989

9090
virtual Int getCandidateCount() = 0; ///< Returns the total number of candidates
91-
virtual UnicodeString*getCandidate( Int index ) = 0; ///< Returns the candidate string
91+
virtual const UnicodeString* getCandidate( Int index ) = 0; ///< Returns the candidate string
9292
virtual Int getSelectedCandidateIndex() = 0; ///< Returns the indexed of the currently selected candidate
9393
virtual Int getCandidatePageSize() = 0; ///< Returns the page size for the candidates list
9494
virtual Int getCandidatePageStart() = 0; ///< Returns the index of the first visibel candidate

GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/IMECandidate.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ void IMECandidateTextAreaDraw( GameWindow *window, WinInstanceData *instData )
202202

203203
for ( Int i = 0; i < count; i++, y+= height )
204204
{
205-
UnicodeString *candidate = ime->getCandidate( first + i );
205+
const UnicodeString *candidate = ime->getCandidate( first + i );
206206
Int tcolor, bcolor;
207207

208208
if ( i == selected )

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class IMEManager : public IMEManagerInterface
109109
virtual Int getIndexBase( void ); ///< Get index base for candidate list
110110

111111
virtual Int getCandidateCount(); ///< Returns the total number of candidates
112-
virtual UnicodeString*getCandidate( Int index ); ///< Returns the candidate string
112+
virtual const UnicodeString* getCandidate( Int index ); ///< Returns the candidate string
113113
virtual Int getSelectedCandidateIndex(); ///< Returns the indexed of the currently selected candidate
114114
virtual Int getCandidatePageSize(); ///< Returns the page size for the candidates list
115115
virtual Int getCandidatePageStart(); ///< Returns the index of the first visibel candidate
@@ -1525,7 +1525,7 @@ Int IMEManager::getCandidateCount()
15251525
// IMEManager::getCandidate
15261526
//============================================================================
15271527

1528-
UnicodeString* IMEManager::getCandidate( Int index )
1528+
const UnicodeString* IMEManager::getCandidate( Int index )
15291529
{
15301530
if ( m_candidateString != NULL && index >=0 && index < m_candidateCount )
15311531
{

0 commit comments

Comments
 (0)