Browse Source

Merge pull request #307 from dpogue/clang-fixes

Fix some warnings and some errors.
Michael Hansen 12 years ago
parent
commit
e89071f04d
  1. 2
      Sources/Plasma/FeatureLib/pfConsole/pfAvatarConsoleCommands.cpp
  2. 18
      Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp
  3. 9
      Sources/Plasma/FeatureLib/pfConsoleCore/pfConsoleCmd.cpp
  4. 10
      Sources/Plasma/FeatureLib/pfConsoleCore/pfConsoleCmd.h
  5. 1
      Sources/Plasma/FeatureLib/pfConsoleCore/pfConsoleContext.cpp
  6. 19
      Sources/Plasma/FeatureLib/pfConsoleCore/pfConsoleEngine.cpp
  7. 2
      Sources/Plasma/FeatureLib/pfConsoleCore/pfConsoleEngine.h
  8. 4
      Sources/Plasma/FeatureLib/pfPython/cyPythonInterface.cpp
  9. 4
      Sources/Plasma/FeatureLib/pfPython/cyPythonInterface.h
  10. 2
      Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp
  11. 2
      Sources/Plasma/PubUtilLib/plAvatar/plAvatarMgr.cpp
  12. 2
      Sources/Plasma/PubUtilLib/plAvatar/plAvatarMgr.h
  13. 2
      Sources/Plasma/PubUtilLib/plVault/plVaultNodeAccess.h

2
Sources/Plasma/FeatureLib/pfConsole/pfAvatarConsoleCommands.cpp

@ -677,7 +677,7 @@ PF_CONSOLE_CMD( Avatar_Anim, BlendAnimPri, "string Animation, float blendFactor,
PF_CONSOLE_CMD( Avatar_Anim, PlaySimpleAnim, "string AvatarName, string Animation", "Play a simple (root not animated) one time animation on the avatar")
{
plArmatureMod *avatar = plAvatarMgr::GetInstance()->FindAvatarByModelName(params[0]);
plArmatureMod *avatar = plAvatarMgr::GetInstance()->FindAvatarByModelName((const char*)params[0]);
if (avatar)
avatar->PlaySimpleAnim(plString::FromUtf8(params[1]));
}

18
Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp

@ -2003,10 +2003,13 @@ PF_CONSOLE_CMD( Graphics_Show, PhysicalsOnly, "", "Toggle only Physical geometry
PF_CONSOLE_CMD( Graphics_Show, Normal, "", "Toggle normal geometry visible")
{
static bool on = true;
if( on = !on )
on = !on;
if (on) {
pfConsole::GetPipeline()->SetDrawableTypeMask(pfConsole::GetPipeline()->GetDrawableTypeMask() | plDrawableSpans::kNormal);
else
} else {
pfConsole::GetPipeline()->SetDrawableTypeMask(pfConsole::GetPipeline()->GetDrawableTypeMask() & ~plDrawableSpans::kNormal);
}
char str[ 256 ];
sprintf( str, "Normal geometry now %s", on ? "visible" : "invisible" );
@ -2017,15 +2020,15 @@ PF_CONSOLE_CMD( Graphics_Show, NormalOnly, "", "Toggle only normal geometry visi
{
static bool on = false;
static uint32_t oldMask = plDrawableSpans::kNormal;
if( on = !on )
{
on = !on;
if (on) {
oldMask = pfConsole::GetPipeline()->GetDrawableTypeMask();
pfConsole::GetPipeline()->SetDrawableTypeMask(plDrawableSpans::kNormal);
}
else
{
} else {
pfConsole::GetPipeline()->SetDrawableTypeMask(oldMask);
}
char str[ 256 ];
sprintf( str, on ? "Now showing only normal geometry" : "Restoring previous render state" );
PrintString( str );
@ -3384,6 +3387,7 @@ Valid channels are: SoundFX, BgndMusic, Voice, GUI, NPCVoice and Ambience.")
case plgAudioSys::kAmbience: sprintf( msg, "Setting Ambience master volume to %4.2f", vol ); break;
case plgAudioSys::kGUI: sprintf( msg, "Setting GUI master volume to %4.2f", vol ); break;
case plgAudioSys::kNPCVoice: sprintf( msg, "Setting NPC Voice master volume to %4.2f", vol ); break;
default: break;
}
PrintString( msg );
}

9
Sources/Plasma/FeatureLib/pfConsoleCore/pfConsoleCmd.cpp

@ -45,6 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
// //
//////////////////////////////////////////////////////////////////////////////
#include "plString.h"
#include "pfConsoleCmd.h"
@ -141,7 +142,7 @@ void pfConsoleCmdGroup::AddSubGroup( pfConsoleCmdGroup *group )
//// FindCommand /////////////////////////////////////////////////////////////
// No longer recursive.
pfConsoleCmd *pfConsoleCmdGroup::FindCommand( char *name )
pfConsoleCmd *pfConsoleCmdGroup::FindCommand( const char *name )
{
pfConsoleCmd *cmd;
@ -198,7 +199,7 @@ pfConsoleCmd *pfConsoleCmdGroup::FindNestedPartialCommand( char *name, uint32
//// FindSubGroup ////////////////////////////////////////////////////////////
pfConsoleCmdGroup *pfConsoleCmdGroup::FindSubGroup( char *name )
pfConsoleCmdGroup *pfConsoleCmdGroup::FindSubGroup( const char *name )
{
pfConsoleCmdGroup *group;
@ -249,7 +250,7 @@ pfConsoleCmdGroup *pfConsoleCmdGroup::FindSubGroupRecurse( const char *name )
//// FindCommandNoCase ///////////////////////////////////////////////////////
// Case-insensitive version of FindCommand.
pfConsoleCmd *pfConsoleCmdGroup::FindCommandNoCase( char *name, uint8_t flags, pfConsoleCmd *start )
pfConsoleCmd *pfConsoleCmdGroup::FindCommandNoCase( const char *name, uint8_t flags, pfConsoleCmd *start )
{
pfConsoleCmd *cmd;
@ -284,7 +285,7 @@ pfConsoleCmd *pfConsoleCmdGroup::FindCommandNoCase( char *name, uint8_t flags
//// FindSubGroupNoCase //////////////////////////////////////////////////////
pfConsoleCmdGroup *pfConsoleCmdGroup::FindSubGroupNoCase( char *name, uint8_t flags, pfConsoleCmdGroup *start )
pfConsoleCmdGroup *pfConsoleCmdGroup::FindSubGroupNoCase( const char *name, uint8_t flags, pfConsoleCmdGroup *start )
{
pfConsoleCmdGroup *group;

10
Sources/Plasma/FeatureLib/pfConsoleCore/pfConsoleCmd.h

@ -96,12 +96,12 @@ class pfConsoleCmdGroup
static pfConsoleCmdGroup *GetBaseGroup( void );
pfConsoleCmd *FindCommand( char *name );
pfConsoleCmd *FindCommandNoCase( char *name, uint8_t flags = 0, pfConsoleCmd *start = nil );
pfConsoleCmd *FindCommand( const char *name );
pfConsoleCmd *FindCommandNoCase( const char *name, uint8_t flags = 0, pfConsoleCmd *start = nil );
pfConsoleCmd *FindNestedPartialCommand( char *name, uint32_t *counter );
pfConsoleCmdGroup *FindSubGroup( char *name );
pfConsoleCmdGroup *FindSubGroupNoCase( char *name, uint8_t flags = 0, pfConsoleCmdGroup *start = nil );
pfConsoleCmdGroup *FindSubGroup( const char *name );
pfConsoleCmdGroup *FindSubGroupNoCase( const char *name, uint8_t flags = 0, pfConsoleCmdGroup *start = nil );
pfConsoleCmd *GetFirstCommand( void ) { return fCommands; }
pfConsoleCmdGroup *GetFirstSubGroup( void ) { return fSubGroups; }
@ -120,7 +120,7 @@ class pfConsoleCmdParam
uint8_t fType;
typedef char *CharPtr;
typedef char* CharPtr;
union
{

1
Sources/Plasma/FeatureLib/pfConsoleCore/pfConsoleContext.cpp

@ -46,6 +46,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
//////////////////////////////////////////////////////////////////////////////
#include "HeadSpin.h"
#include "plString.h"
#include "pfConsoleContext.h"

19
Sources/Plasma/FeatureLib/pfConsoleCore/pfConsoleEngine.cpp

@ -58,7 +58,7 @@ static const char kTokenSeparators[] = " =\r\n\t,";
static const char kTokenGrpSeps[] = " =\r\n._\t,";
//WARNING: Potentially increments the pointer passed to it.
static char *console_strtok( char *&line, bool haveCommand )
static const char *console_strtok( char *&line, bool haveCommand )
{
char *begin = line;
@ -122,7 +122,7 @@ bool pfConsoleEngine::PrintCmdHelp( char *name, void (*PrintFn)( const char *
{
pfConsoleCmd *cmd;
pfConsoleCmdGroup *group, *subGrp;
char *ptr;
const char *ptr;
static char string[ 512 ];
static char tempString[ 512 ];
uint32_t i;
@ -203,7 +203,7 @@ const char *pfConsoleEngine::GetCmdSignature( char *name )
{
pfConsoleCmd *cmd;
pfConsoleCmdGroup *group, *subGrp;
char *ptr;
const char *ptr;
static char string[ 512 ];
@ -297,7 +297,7 @@ bool pfConsoleEngine::RunCommand( char *line, void (*PrintFn)( const char * )
pfConsoleCmdGroup *group, *subGrp;
int32_t numParams, i, numQuotedParams = 0;
pfConsoleCmdParam paramArray[ fMaxNumParams + 1 ];
char *ptr;
const char *ptr;
bool valid = true;
@ -395,9 +395,9 @@ bool pfConsoleEngine::RunCommand( char *line, void (*PrintFn)( const char * )
// Converts a null-terminated string representing a parameter to a
// pfConsoleCmdParam argument.
bool pfConsoleEngine::IConvertToParam( uint8_t type, char *string, pfConsoleCmdParam *param )
bool pfConsoleEngine::IConvertToParam( uint8_t type, const char *string, pfConsoleCmdParam *param )
{
char *c, expChars[] = "dDeE+-.";
const char *c, expChars[] = "dDeE+-.";
bool hasDecimal = false, hasLetters = false;
@ -422,12 +422,12 @@ bool pfConsoleEngine::IConvertToParam( uint8_t type, char *string, pfConsoleC
if( type == pfConsoleCmd::kAny )
{
/// Want "any"
param->SetAny( string );
param->SetAny( (char*)string );
}
else if( type == pfConsoleCmd::kString )
{
/// Want just a string
param->SetString( string );
param->SetString( (char*)string );
}
else if( type == pfConsoleCmd::kFloat )
{
@ -469,7 +469,8 @@ bool pfConsoleEngine::FindPartialCmd( char *line, bool findAgain, bool preser
pfConsoleCmdGroup *group, *subGrp;
bool foundMore = false;
static char *ptr = nil, *insertLoc = nil;
static const char *ptr = nil;
static char *insertLoc = nil;
static pfConsoleCmd *lastCmd = nil;
static pfConsoleCmdGroup *lastGroup = nil, *lastParentGroup = nil;
static char newStr[ 256 ];

2
Sources/Plasma/FeatureLib/pfConsoleCore/pfConsoleEngine.h

@ -70,7 +70,7 @@ class pfConsoleEngine
static const int32_t fMaxNumParams;
bool IConvertToParam( uint8_t type, char *string, pfConsoleCmdParam *param );
bool IConvertToParam( uint8_t type, const char *string, pfConsoleCmdParam *param );
char fErrorMsg[ 128 ];
char fLastErrorLine[ 512 ];

4
Sources/Plasma/FeatureLib/pfPython/cyPythonInterface.cpp

@ -2195,7 +2195,7 @@ PyObject* PythonInterface::LoadObject(char* pickle, int32_t size)
//
// RETURNS : pointer to PyObject that is the result of the command
//
bool PythonInterface::RunStringInteractive(char *command, PyObject* module)
bool PythonInterface::RunStringInteractive(const char *command, PyObject* module)
{
PyObject *d, *v;
// make sure that we're given a good module... or at least one with an address
@ -2231,7 +2231,7 @@ bool PythonInterface::RunStringInteractive(char *command, PyObject* module)
//
// PURPOSE : run a python string in a specific module name
//
bool PythonInterface::RunString(char *command, PyObject* module)
bool PythonInterface::RunString(const char *command, PyObject* module)
{
PyObject *d, *v;
// make sure that we're given a good module... or at least one with an address

4
Sources/Plasma/FeatureLib/pfPython/cyPythonInterface.h

@ -199,7 +199,7 @@ public:
// PURPOSE : run a python string in a specific module name
// : Interactive mode (displays results)
//
static bool RunStringInteractive(char *command, PyObject* module);
static bool RunStringInteractive(const char *command, PyObject* module);
/////////////////////////////////////////////////////////////////////////////
@ -210,7 +210,7 @@ public:
//
// PURPOSE : run a python string in a specific module name
//
static bool RunString(char *command, PyObject* module);
static bool RunString(const char *command, PyObject* module);
/////////////////////////////////////////////////////////////////////////////

2
Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp

@ -2533,7 +2533,7 @@ bool plPythonFileMod::MsgReceive(plMessage* msg)
PyObject* retVal = PyObject_CallMethod(
fPyFunctionInstances[kfunc_OnMovieEvent],
(char*)fFunctionNames[kfunc_OnMovieEvent],
"si", moviemsg->fMovieName, (uint32_t)moviemsg->fReason);
"si", moviemsg->fMovieName.AsString().c_str(), (uint32_t)moviemsg->fReason);
if ( retVal == nil )
{
#ifndef PLASMA_EXTERNAL_RELEASE

2
Sources/Plasma/PubUtilLib/plAvatar/plAvatarMgr.cpp

@ -728,7 +728,7 @@ plArmatureMod* plAvatarMgr::FindAvatarByPlayerID(uint32_t pid)
return nil;
}
plArmatureMod *plAvatarMgr::FindAvatarByModelName(char *name)
plArmatureMod *plAvatarMgr::FindAvatarByModelName(const plString& name)
{
plAvatarVec::iterator it;
for (it = fAvatars.begin(); it != fAvatars.end(); ++it)

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

@ -140,7 +140,7 @@ public:
plKey GetLocalAvatarKey();
static plArmatureMod *FindAvatar(plKey& avatarKey); // Key of the sceneObject
plArmatureMod *FindAvatarByPlayerID(uint32_t pid);
plArmatureMod *FindAvatarByModelName(char *name); // Probably only useful for custom NPCs. All players are
plArmatureMod *FindAvatarByModelName(const plString& name); // Probably only useful for custom NPCs. All players are
// either "Male" or "Female".
void FindAllAvatarsByModelName(const char* name, plArmatureModPtrVec& outVec);
plArmatureMod *GetFirstRemoteAvatar();

2
Sources/Plasma/PubUtilLib/plVault/plVaultNodeAccess.h

@ -79,7 +79,7 @@ struct NetVaultNodeAccess {
private:
NetVaultNodeAccess (const NetVaultNodeAccess &) { }
const NetVaultNodeAccess & operator= (const NetVaultNodeAccess &) { }
void operator= (const NetVaultNodeAccess &) { }
};
#define VNODE_ACCESSOR(type, name, basename) \

Loading…
Cancel
Save