mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-18 19:29:09 +00:00
Fix some warnings and some errors.
This commit is contained in:
@ -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;
|
||||
|
||||
|
@ -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
|
||||
{
|
||||
@ -153,7 +153,7 @@ class pfConsoleCmdParam
|
||||
operator int() const { return IToInt(); }
|
||||
operator float() const { return IToFloat(); }
|
||||
operator bool() const { return IToBool(); }
|
||||
operator const CharPtr() const { return IToString(); }
|
||||
operator CharPtr() const { return IToString(); }
|
||||
operator char() const { return IToChar(); }
|
||||
|
||||
uint8_t GetType( void ) { return fType; }
|
||||
|
@ -46,6 +46,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "HeadSpin.h"
|
||||
#include "plString.h"
|
||||
#include "pfConsoleContext.h"
|
||||
|
||||
|
||||
|
@ -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 ];
|
||||
|
@ -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 ];
|
||||
|
Reference in New Issue
Block a user