Browse Source

Make a bunch more strings const.

Darryl Pogue 14 years ago
parent
commit
ea3fa47eca
  1. 4
      Sources/Plasma/NucleusLib/pnInputCore/plControlDefinition.h
  2. 2
      Sources/Plasma/NucleusLib/pnInputCore/plInputMap.cpp
  3. 2
      Sources/Plasma/NucleusLib/pnInputCore/plKeyMap.h
  4. 2
      Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.cpp
  5. 2
      Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.h
  6. 2
      Sources/Plasma/PubUtilLib/plAgeDescription/plAgeManifest.cpp
  7. 2
      Sources/Plasma/PubUtilLib/plAgeDescription/plAgeManifest.h
  8. 2
      Sources/Plasma/PubUtilLib/plAvatar/plClothingLayout.h
  9. 2
      Sources/Plasma/PubUtilLib/plGImage/plFontCache.cpp
  10. 2
      Sources/Plasma/PubUtilLib/plGImage/plFontCache.h
  11. 2
      Sources/Plasma/PubUtilLib/plGImage/plWinFontCache.cpp
  12. 2
      Sources/Plasma/PubUtilLib/plGImage/plWinFontCache.h
  13. 24
      Sources/Plasma/PubUtilLib/plInputCore/plAvatarInputInterface.h
  14. 2
      Sources/Plasma/PubUtilLib/plInputCore/plInputDevice.h
  15. 2
      Sources/Plasma/PubUtilLib/plInputCore/plInputInterfaceMgr.cpp
  16. 2
      Sources/Plasma/PubUtilLib/plNetMessage/plNetMessage.h
  17. 2
      Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.cpp
  18. 2
      Sources/Plasma/PubUtilLib/plPipeline/plDebugText.h
  19. 4
      Sources/Plasma/PubUtilLib/plResMgr/plLocalization.cpp
  20. 6
      Sources/Plasma/PubUtilLib/plResMgr/plLocalization.h

4
Sources/Plasma/NucleusLib/pnInputCore/plControlDefinition.h

@ -97,13 +97,13 @@ enum
struct Win32keyConvert
{
UInt32 fVKey;
char* fKeyName;
const char* fKeyName;
};
struct CommandConvert
{
ControlEventCode fCode;
char* fDesc;
const char* fDesc;
};

2
Sources/Plasma/NucleusLib/pnInputCore/plInputMap.cpp

@ -501,7 +501,7 @@ void plKeyMap::EraseBinding( ControlEventCode code )
}
char* plKeyMap::ConvertVKeyToChar( UInt32 vk )
const char* plKeyMap::ConvertVKeyToChar( UInt32 vk )
{
Win32keyConvert* keyConvert = &fKeyConversionEnglish[0];
switch (plLocalization::GetLanguage())

2
Sources/Plasma/NucleusLib/pnInputCore/plKeyMap.h

@ -208,7 +208,7 @@ class plKeyMap : public plInputMap
const plKeyBinding &GetBinding( UInt32 i ) const { return *fBindings[ i ]; }
void HandleAutoDualBinding( plKeyDef key1, plKeyDef key2 );
static char *ConvertVKeyToChar( UInt32 vk );
static const char* ConvertVKeyToChar( UInt32 vk );
static plKeyDef ConvertCharToVKey( const char *c );
static Win32keyConvert fKeyConversionEnglish[];

2
Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.cpp

@ -147,7 +147,7 @@ char *plAgePage::GetAsString( void ) const
// static
char plAgeDescription::kAgeDescPath[]={"dat"PATH_SEPARATOR_STR};
char *plAgeDescription::fCommonPages[] = { "Textures", "BuiltIn" };
const char* plAgeDescription::fCommonPages[] = { "Textures", "BuiltIn" };
// Also gotta init the separators for our helper reading function
plAgeDescription::plAgeDescription() : plInitSectionTokenReader()

2
Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.h

@ -96,7 +96,7 @@ private:
Int32 fSeqPrefix;
UInt32 fReleaseVersion; // 0 for pre-release, 1+ for actual released ages
static char *fCommonPages[];
static const char* fCommonPages[];
void IInit( void );
void IDeInit( void );

2
Sources/Plasma/PubUtilLib/plAgeDescription/plAgeManifest.cpp

@ -100,7 +100,7 @@ bool plManifestFile::LocalExists()
//////////////////////////////////////////////////////////////////////////////
char* plManifest::fTimeFormat = "%m/%d/%y %H:%M:%S";
const char* plManifest::fTimeFormat = "%m/%d/%y %H:%M:%S";
static const UInt32 kLatestFormatVersion = 5;
plManifest::plManifest()

2
Sources/Plasma/PubUtilLib/plAgeDescription/plAgeManifest.h

@ -98,7 +98,7 @@ protected:
void IReset();
public:
static char* fTimeFormat; // Standard string for the printed version of our timestamps
static const char* fTimeFormat; // Standard string for the printed version of our timestamps
void SetFormatVersion(UInt32 v) { fFormatVersion = v; }
void AddFile(plManifestFile* file);

2
Sources/Plasma/PubUtilLib/plAvatar/plClothingLayout.h

@ -61,7 +61,7 @@ public:
UInt32 fWidth;
UInt32 fHeight;
plClothingElement(char *name, UInt32 xPos, UInt32 yPos, UInt32 width, UInt32 height)
plClothingElement(const char *name, UInt32 xPos, UInt32 yPos, UInt32 width, UInt32 height)
{
fName = hsStrcpy(name);
fXPos = xPos;

2
Sources/Plasma/PubUtilLib/plGImage/plFontCache.cpp

@ -48,7 +48,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "pnKeyedObject/plUoid.h"
char *plFontCache::kCustFontExtension = ".prf";
const char* plFontCache::kCustFontExtension = ".prf";
plFontCache *plFontCache::fInstance = nil;

2
Sources/Plasma/PubUtilLib/plGImage/plFontCache.h

@ -83,7 +83,7 @@ class plFontCache : public hsKeyedObject
void LoadCustomFonts( const char *dir );
// Our custom font extension
static char *kCustFontExtension;
static const char* kCustFontExtension;
};

2
Sources/Plasma/PubUtilLib/plGImage/plWinFontCache.cpp

@ -55,7 +55,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include <wingdi.h>
char *plWinFontCache::kCustFontExtension = ".prf";
const char* plWinFontCache::kCustFontExtension = ".prf";
plWinFontCache::plWinFontCache()

2
Sources/Plasma/PubUtilLib/plGImage/plWinFontCache.h

@ -107,7 +107,7 @@ class plWinFontCache
void LoadCustomFonts( const char *dir );
// Our custom font extension
static char *kCustFontExtension;
static const char* kCustFontExtension;
};

24
Sources/Plasma/PubUtilLib/plInputCore/plAvatarInputInterface.h

@ -66,7 +66,7 @@ class plAvatarInputMap
plAvatarInputMap();
virtual ~plAvatarInputMap();
virtual char *GetName() = 0;
virtual const char *GetName() = 0;
virtual hsBool IsBasic() { return false; }
plMouseMap *fMouseMap;
@ -78,7 +78,7 @@ class plSuspendedMovementMap : public plAvatarInputMap
{
public:
plSuspendedMovementMap();
virtual char *GetName() { return "Suspended Movement"; }
virtual const char *GetName() { return "Suspended Movement"; }
};
// The above, plus movement
@ -86,7 +86,7 @@ class plBasicControlMap : public plSuspendedMovementMap
{
public:
plBasicControlMap();
virtual char *GetName() { return "Basic"; }
virtual const char *GetName() { return "Basic"; }
virtual hsBool IsBasic() { return true; }
};
@ -95,28 +95,28 @@ class plBasicThirdPersonControlMap : public plBasicControlMap
{
public:
plBasicThirdPersonControlMap();
virtual char *GetName() { return "Basic Third Person"; }
virtual const char *GetName() { return "Basic Third Person"; }
};
class plLadderControlMap : public plSuspendedMovementMap
{
public:
plLadderControlMap();
virtual char *GetName() { return "LadderClimb"; }
virtual const char *GetName() { return "LadderClimb"; }
};
class plLadderMountMap : public plSuspendedMovementMap
{
public:
plLadderMountMap();
virtual char *GetName() { return "Ladder Mount"; }
virtual const char *GetName() { return "Ladder Mount"; }
};
class plLadderDismountMap : public plSuspendedMovementMap
{
public:
plLadderDismountMap();
virtual char *GetName() { return "Ladder Dismount"; }
virtual const char *GetName() { return "Ladder Dismount"; }
};
@ -124,7 +124,7 @@ class plBasicFirstPersonControlMap : public plBasicControlMap
{
public:
plBasicFirstPersonControlMap();
virtual char *GetName() { return "Basic First Person"; }
virtual const char *GetName() { return "Basic First Person"; }
};
// Mouse walk mode
@ -139,21 +139,21 @@ class pl3rdWalkForwardMap : public pl3rdWalkMap
{
public:
pl3rdWalkForwardMap();
virtual char *GetName() { return "Walking Forward"; }
virtual const char *GetName() { return "Walking Forward"; }
};
class pl3rdWalkBackwardMap : public pl3rdWalkMap
{
public:
pl3rdWalkBackwardMap();
virtual char *GetName() { return "Walking Backward"; }
virtual const char *GetName() { return "Walking Backward"; }
};
class pl3rdWalkBackwardLBMap : public pl3rdWalkMap
{
public:
pl3rdWalkBackwardLBMap();
virtual char *GetName() { return "Walking Backward (LB)"; }
virtual const char *GetName() { return "Walking Backward (LB)"; }
};
///////////////////////////////////////////////////////////////////////////////////
@ -215,7 +215,7 @@ class plAvatarInputInterface : public plInputInterface
virtual UInt32 GetPriorityLevel( void ) const { return kAvatarInputPriority; }
virtual UInt32 GetCurrentCursorID( void ) const { return fCurrentCursor; }
virtual hsScalar GetCurrentCursorOpacity( void ) const { return fCursorOpacity; }
char* GetInputMapName() { return fInputMap ? fInputMap->GetName() : ""; }
const char* GetInputMapName() { return fInputMap ? fInputMap->GetName() : ""; }
virtual hsBool InterpretInputEvent( plInputEventMsg *pMsg );
virtual void MissedInputEvent( plInputEventMsg *pMsg );

2
Sources/Plasma/PubUtilLib/plInputCore/plInputDevice.h

@ -32,10 +32,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "hsWindows.h"
//#include "pnInputCore/plControlDefinition.h"
#include "pnInputCore/plOSMsg.h"
#include "pnInputCore/plKeyDef.h"
#include "hsBitVector.h"
#include "hsTemplates.h"
class plMessage;
enum plKeyDef;
struct plMouseInfo;
class plPipeline;

2
Sources/Plasma/PubUtilLib/plInputCore/plInputInterfaceMgr.cpp

@ -861,7 +861,7 @@ const char *plInputInterfaceMgr::IKeyComboToString( const plKeyCombo &combo )
sprintf( str, "(unmapped)" );
else
{
char *c = plKeyMap::ConvertVKeyToChar( combo.fKey );
const char *c = plKeyMap::ConvertVKeyToChar( combo.fKey );
if( c != nil )
strncpy( str, c, sizeof( str ) );
else

2
Sources/Plasma/PubUtilLib/plNetMessage/plNetMessage.h

@ -232,7 +232,7 @@ public:
// debug
virtual std::string AsStdString() const
{
char * delim = "";
const char* delim = "";
std::stringstream ss;
if ( GetHasPlayerID() )

2
Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.cpp

@ -229,7 +229,7 @@ void hsG3DDeviceRecord::SetDeviceDesc( const char *s )
const char* hsG3DDeviceRecord::GetG3DDeviceTypeName() const
{
static char* deviceNames[hsG3DDeviceSelector::kNumDevTypes] = {
static const char* deviceNames[hsG3DDeviceSelector::kNumDevTypes] = {
"Unknown",
"Glide",
"Direct3D",

2
Sources/Plasma/PubUtilLib/plPipeline/plDebugText.h

@ -121,7 +121,7 @@ class plDebugText
void SetManager( plDebugTextManager *m ) { fManager = m; }
void SetFont( char *face, UInt16 size ) { hsStrncpy( fFontFace, face, sizeof( fFontFace ) ); fFontSize = size; }
void SetFont(const char *face, UInt16 size ) { hsStrncpy( fFontFace, face, sizeof( fFontFace ) ); fFontSize = size; }
const char *GetFontFace( void ) { return fFontFace; }
const UInt16 GetFontSize( void ) { return fFontSize; }
UInt16 GetFontHeight();

4
Sources/Plasma/PubUtilLib/plResMgr/plLocalization.cpp

@ -30,7 +30,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
plLocalization::Language plLocalization::fLanguage = plLocalization::kEnglish;
char* plLocalization::fLangTags[] =
const char* plLocalization::fLangTags[] =
{
"_eng", // kEnglish
"_fre", // kFrench
@ -41,7 +41,7 @@ char* plLocalization::fLangTags[] =
};
const int kLangTagLen = 4;
char* plLocalization::fLangNames[] =
const char* plLocalization::fLangNames[] =
{
"English", // kEnglish
"French", // kFrench

6
Sources/Plasma/PubUtilLib/plResMgr/plLocalization.h

@ -59,8 +59,8 @@ public:
protected:
static Language fLanguage;
static char* fLangTags[kNumLanguages];
static char* fLangNames[kNumLanguages];
static const char* fLangTags[kNumLanguages];
static const char* fLangNames[kNumLanguages];
static bool fUsesUnicode[kNumLanguages];
static encodingTypes fUnicodeEncoding[kNumLanguages];
@ -73,7 +73,7 @@ public:
static void SetLanguage(Language lang) { fLanguage = lang; }
static Language GetLanguage() { return fLanguage; }
static char* GetLanguageName(Language lang) { return fLangNames[lang]; }
static const char* GetLanguageName(Language lang) { return fLangNames[lang]; }
static hsBool UsingUnicode() { return fUsesUnicode[fLanguage]; }
static encodingTypes UnicodeEncoding() { return fUnicodeEncoding[fLanguage]; }

Loading…
Cancel
Save