Skip to content

Commit 6a6fd9d

Browse files
committed
[GEN] Fix constness errors for Generals build (#484)
1 parent 2d200dc commit 6a6fd9d

File tree

84 files changed

+209
-197
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+209
-197
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ enum AudioType
4848
AT_SoundEffect
4949
};
5050

51-
extern char *theAudioPriorityNames[];
51+
extern const char *theAudioPriorityNames[];
5252
enum AudioPriority
5353
{
5454
AP_LOWEST,
@@ -58,7 +58,7 @@ enum AudioPriority
5858
AP_CRITICAL
5959
};
6060

61-
extern char *theSoundTypeNames[];
61+
extern const char *theSoundTypeNames[];
6262
enum SoundType
6363
{
6464
ST_UI = 0x0001,
@@ -72,7 +72,7 @@ enum SoundType
7272
ST_EVERYONE = 0x0100,
7373
};
7474

75-
extern char *theAudioControlNames[];
75+
extern const char *theAudioControlNames[];
7676
enum AudioControl
7777
{
7878
AC_LOOP = 0x0001,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
#include "Lib/BaseType.h"
3636

3737
// do NOT use these functions directly, rather use the macros below
38-
extern Int GetGameAudioRandomValue( int lo, int hi, char *file, int line );
39-
extern Real GetGameAudioRandomValueReal( Real lo, Real hi, char *file, int line );
38+
extern Int GetGameAudioRandomValue( int lo, int hi, const char *file, int line );
39+
extern Real GetGameAudioRandomValueReal( Real lo, Real hi, const char *file, int line );
4040

4141
// use these macros to access the random value functions
4242
#define GameAudioRandomValue( lo, hi ) GetGameAudioRandomValue( lo, hi, __FILE__, __LINE__ )

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

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

2323
struct BorderColor
2424
{
25-
char *m_colorName;
25+
const char *m_colorName;
2626
long m_borderColor;
2727
};
2828

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class DataChunkOutput
126126
DataChunkOutput( OutputStream *pOut );
127127
~DataChunkOutput();
128128

129-
void openDataChunk( char *name, DataChunkVersionType ver );
129+
void openDataChunk( const char *name, DataChunkVersionType ver );
130130
void closeDataChunk( void );
131131

132132
void writeReal(Real r);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ enum TimeOfDay
7575
TIME_OF_DAY_COUNT // keep this last
7676
};
7777

78-
extern char *TimeOfDayNames[];
78+
extern const char *TimeOfDayNames[];
7979
// defined in Common/GameType.cpp
8080

8181
//-------------------------------------------------------------------------------------------------
@@ -87,7 +87,7 @@ enum Weather
8787
WEATHER_COUNT // keep this last
8888
};
8989

90-
extern char *WeatherNames[];
90+
extern const char *WeatherNames[];
9191

9292
enum Scorches
9393
{

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ typedef void (*INIFieldParseProc)( INI *ini, void *instance, void *store, const
9999

100100
//-------------------------------------------------------------------------------------------------
101101
typedef const char* ConstCharPtr;
102-
typedef const ConstCharPtr* ConstCharPtrArray;
102+
typedef ConstCharPtr* ConstCharPtrArray;
103103

104104
//-------------------------------------------------------------------------------------------------
105105
struct LookupListRec

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class LadderPref
5050
UnsignedShort port;
5151
time_t lastPlayDate;
5252

53-
bool operator== (const LadderPref& other)
53+
bool operator== (const LadderPref& other) const
5454
{
5555
return ( address==other.address && port==other.port );
5656
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ typedef enum
7474

7575
} TerrainClass;
7676
#ifdef DEFINE_TERRAIN_TYPE_NAMES
77-
static char *terrainTypeNames[] =
77+
static const char *terrainTypeNames[] =
7878
{
7979
"NONE",
8080
"DESERT_1",

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ enum EditorSortingType
5656

5757
};
5858
#ifdef DEFINE_EDITOR_SORTING_NAMES
59-
static char *EditorSortingNames[] =
59+
static const char *EditorSortingNames[] =
6060
{
6161
"NONE",
6262
"STRUCTURE",

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ enum UpgradeType
104104
NUM_UPGRADE_TYPES, // keep this last
105105
};
106106
#ifdef DEFINE_UPGRADE_TYPE_NAMES
107-
static Char *UpgradeTypeNames[] =
107+
static const Char *UpgradeTypeNames[] =
108108
{
109109
"PLAYER",
110110
"OBJECT",

0 commit comments

Comments
 (0)