Browse Source

Merge pull request #72 from dpogue/mingw

Partial MinGW
Adam Johnson 13 years ago
parent
commit
109e389178
  1. 2
      Sources/Plasma/CoreLib/HeadSpin.cpp
  2. 12
      Sources/Plasma/CoreLib/hsConfig.h
  3. 36
      Sources/Plasma/CoreLib/hsMalloc.h
  4. 1
      Sources/Plasma/CoreLib/hsMemory.h
  5. 36
      Sources/Plasma/CoreLib/hsStlUtils.h
  6. 14
      Sources/Plasma/CoreLib/hsStream.cpp
  7. 6
      Sources/Plasma/CoreLib/hsTypes.h
  8. 70
      Sources/Plasma/CoreLib/hsUtils.h
  9. 2
      Sources/Plasma/CoreLibExe/Pch.h
  10. 2
      Sources/Plasma/CoreLibExe/hsExeError.cpp
  11. 2
      Sources/Plasma/CoreLibExe/hsExeMalloc.cpp
  12. 14
      Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp
  13. 15
      Sources/Plasma/FeatureLib/pfConsoleCore/pfConsoleCmd.cpp
  14. 12
      Sources/Plasma/FeatureLib/pfConsoleCore/pfConsoleCmd.h
  15. 6
      Sources/Plasma/FeatureLib/pfConsoleCore/pfConsoleEngine.cpp
  16. 2
      Sources/Plasma/FeatureLib/pfConsoleCore/pfConsoleEngine.h
  17. 2
      Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIDialogMod.cpp
  18. 2
      Sources/Plasma/FeatureLib/pfJournalBook/pfJournalBook.cpp
  19. 29
      Sources/Plasma/FeatureLib/pfLocalizationMgr/pfLocalizationDataMgr.cpp
  20. 13
      Sources/Plasma/FeatureLib/pfLocalizationMgr/pfLocalizedString.cpp
  21. 2
      Sources/Plasma/FeatureLib/pfLocalizationMgr/pfLocalizedString.h
  22. 4
      Sources/Plasma/FeatureLib/pfPython/cyPythonInterface.cpp
  23. 4
      Sources/Plasma/FeatureLib/pfPython/cyPythonInterface.h
  24. 296
      Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp
  25. 2
      Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.h
  26. 6
      Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifier.cpp
  27. 4
      Sources/Plasma/FeatureLib/pfPython/pyEnum.cpp
  28. 2
      Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBox.cpp
  29. 2
      Sources/Plasma/FeatureLib/pfPython/pyKeyMap.cpp
  30. 13
      Sources/Plasma/NucleusLib/inc/plProfileManager.cpp
  31. 14
      Sources/Plasma/NucleusLib/pnAddrInfo/pnAddrInfo.cpp
  32. 16
      Sources/Plasma/NucleusLib/pnAddrInfo/pnAddrInfo.h
  33. 2
      Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/W9x/pnAceW9xSocket.cpp
  34. 2
      Sources/Plasma/NucleusLib/pnFactory/plFactory.cpp
  35. 4
      Sources/Plasma/NucleusLib/pnInputCore/plControlDefinition.h
  36. 4
      Sources/Plasma/NucleusLib/pnInputCore/plInputMap.cpp
  37. 14
      Sources/Plasma/NucleusLib/pnInputCore/plKeyDef.h
  38. 2
      Sources/Plasma/NucleusLib/pnInputCore/plKeyMap.h
  39. 2
      Sources/Plasma/NucleusLib/pnNetBase/Private/pnNbAllIncludes.h
  40. 4
      Sources/Plasma/NucleusLib/pnNetBase/Private/pnNbError.h
  41. 2
      Sources/Plasma/NucleusLib/pnNetBase/pnNbConst.h
  42. 2
      Sources/Plasma/NucleusLib/pnNetCommon/plNetSharedState.cpp
  43. 2
      Sources/Plasma/NucleusLib/pnNetCommon/plNetSharedState.h
  44. 2
      Sources/Plasma/NucleusLib/pnNetCommon/plSynchedObject.cpp
  45. 123
      Sources/Plasma/NucleusLib/pnUtils/Private/pnUtHash.h
  46. 2
      Sources/Plasma/NucleusLib/pnUtils/Private/pnUtMisc.h
  47. 43
      Sources/Plasma/NucleusLib/pnUtils/Private/pnUtRef.h
  48. 4
      Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.cpp
  49. 2
      Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.h
  50. 2
      Sources/Plasma/PubUtilLib/plAgeDescription/plAgeManifest.cpp
  51. 2
      Sources/Plasma/PubUtilLib/plAgeDescription/plAgeManifest.h
  52. 2
      Sources/Plasma/PubUtilLib/plAvatar/plClothingLayout.h
  53. 1
      Sources/Plasma/PubUtilLib/plEncryption/plChecksum.cpp
  54. 2
      Sources/Plasma/PubUtilLib/plFile/hsFiles.cpp
  55. 4
      Sources/Plasma/PubUtilLib/plFile/plEncryptedStream.cpp
  56. 4
      Sources/Plasma/PubUtilLib/plFile/plFileUtils.cpp
  57. 2
      Sources/Plasma/PubUtilLib/plGImage/plFontCache.cpp
  58. 2
      Sources/Plasma/PubUtilLib/plGImage/plFontCache.h
  59. 2
      Sources/Plasma/PubUtilLib/plGImage/plWinFontCache.cpp
  60. 2
      Sources/Plasma/PubUtilLib/plGImage/plWinFontCache.h
  61. 24
      Sources/Plasma/PubUtilLib/plInputCore/plAvatarInputInterface.h
  62. 2
      Sources/Plasma/PubUtilLib/plInputCore/plInputDevice.h
  63. 2
      Sources/Plasma/PubUtilLib/plInputCore/plInputInterfaceMgr.cpp
  64. 4
      Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.cpp
  65. 2
      Sources/Plasma/PubUtilLib/plNetMessage/plNetMessage.h
  66. 2
      Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.cpp
  67. 2
      Sources/Plasma/PubUtilLib/plPipeline/plDebugText.h
  68. 2
      Sources/Plasma/PubUtilLib/plResMgr/plKeyFinder.cpp
  69. 4
      Sources/Plasma/PubUtilLib/plResMgr/plLocalization.cpp
  70. 6
      Sources/Plasma/PubUtilLib/plResMgr/plLocalization.h
  71. 3
      Sources/Plasma/PubUtilLib/plResMgr/plResManager.cpp
  72. 1
      Sources/Plasma/PubUtilLib/plResMgr/plResManager.h
  73. 1
      Sources/Plasma/PubUtilLib/plResMgr/plVersion.cpp
  74. 2
      Sources/Plasma/PubUtilLib/plSDL/plSDLMgr.cpp
  75. 16
      Sources/Plasma/PubUtilLib/plScene/plVisMgr.cpp
  76. 4
      Sources/Plasma/PubUtilLib/plScene/plVisMgr.h
  77. 2
      Sources/Plasma/PubUtilLib/plUnifiedTime/plUnifiedTime.cpp

2
Sources/Plasma/CoreLib/HeadSpin.cpp

@ -37,7 +37,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#endif
#if HS_BUILD_FOR_WIN32
#ifdef _MSC_VER
# include <crtdbg.h> /* for _RPT_BASE */
#endif
# define WIN32_LEAN_AND_MEAN
# define WIN32_EXTRA_LEAN
# include <windows.h> // For OutputDebugString()

12
Sources/Plasma/CoreLib/hsConfig.h

@ -74,8 +74,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
// 4018: signed/unsigned mismatch
// 4786: 255 character debug limit
// 4284: STL template defined operator-> for a class it doesn't make sense for (int, etc)
#if !__MWERKS__
#pragma warning( disable : 4305 4503 4018 4786 4284)
// 4800: 'int': forcing value to bool 'true' or 'false' (performance warning)
#ifdef _MSC_VER
#pragma warning( disable : 4305 4503 4018 4786 4284 4800)
#endif
// VC++ version greater than 6.0, must be building for .NET
@ -88,6 +89,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#endif
#ifdef HS_BUILD_FOR_WIN32
# define CDECL __cdecl
#else
# define CDECL
#endif
/////////////////////Debugging Defines ///////////////////////////////////
#if (defined(_DEBUG)||defined(UNIX_DEBUG)) && !defined(HS_DISABLE_ASSERT)

36
Sources/Plasma/CoreLib/hsMalloc.h

@ -97,21 +97,43 @@ void MemSetColor (unsigned short color);
#ifdef __cplusplus
#include <new>
#ifndef _MSC_VER
#define THROW(x) throw(x)
#define THROW_EMPTY throw()
#else
#define THROW(x)
#define THROW_EMPTY
#endif
// standard new and delete
inline void * __cdecl operator new (size_t bytes) { return MemAlloc((unsigned)bytes, 0, __FILE__, __LINE__); }
inline void __cdecl operator delete (void * ptr) { MemFree(ptr, 0); }
inline void* CDECL operator new (size_t bytes) THROW(std::bad_alloc)
{ return MemAlloc((unsigned)bytes, 0, __FILE__, __LINE__); }
inline void* CDECL operator new [](size_t bytes) THROW(std::bad_alloc)
{ return MemAlloc((unsigned)bytes, 0, __FILE__, __LINE__); }
inline void CDECL operator delete (void * ptr) THROW_EMPTY
{ MemFree(ptr, 0); }
inline void CDECL operator delete [](void * ptr) THROW_EMPTY
{ MemFree(ptr, 0); }
// memcheck-friendly new
inline void * __cdecl operator new (size_t bytes, const char file[], unsigned line) { return MemAlloc((unsigned)bytes, 0, file, line); }
inline void __cdecl operator delete (void * ptr, const char [] , unsigned) { return MemFree(ptr, 0); }
inline void* CDECL operator new (size_t bytes, const char file[], unsigned line)
{ return MemAlloc((unsigned)bytes, 0, file, line); }
inline void* CDECL operator new [](size_t bytes, const char file[], unsigned line)
{ return MemAlloc((unsigned)bytes, 0, file, line); }
inline void CDECL operator delete (void * ptr, const char [], unsigned)
{ return MemFree(ptr, 0); }
inline void CDECL operator delete [](void * ptr, const char [], unsigned)
{ return MemFree(ptr, 0); }
#define TRACKED_NEW new(__FILE__, __LINE__)
// placement new
#ifndef __PLACEMENT_NEW_INLINE
#if defined(_MSC_VER) && !defined(__PLACEMENT_NEW_INLINE)
#define __PLACEMENT_NEW_INLINE
inline void * __cdecl operator new (size_t, void * ptr) { return ptr; }
inline void __cdecl operator delete (void *, void *) {}
inline void* CDECL operator new (size_t, void * ptr) { return ptr; }
inline void CDECL operator delete (void *, void *) {}
#endif // ifndef __PLACEMENT_NEW_INLINE
#endif // ifdef __cplusplus

1
Sources/Plasma/CoreLib/hsMemory.h

@ -27,6 +27,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#define hsMemoryDefined
#include "hsTypes.h"
#include "hsMalloc.h"
//#include "hsTemplates.h"
class HSMemory {

36
Sources/Plasma/CoreLib/hsStlUtils.h

@ -27,7 +27,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#define hsStlUtils_h_inc
#include "hsUtils.h"
#include <xmemory>
//#include <xmemory>
#include <functional>
#include <algorithm>
#include <string>
@ -46,20 +46,20 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
// TEMPLATE CLASS cyallocator
template<class _Ty>
class cyallocator
: public std::_Allocator_base<_Ty>
: public std::allocator<_Ty>
{ // generic cyallocator for objects of class _Ty
public:
typedef std::_Allocator_base<_Ty> _Mybase;
typedef std::allocator<_Ty> _Mybase;
typedef typename _Mybase::value_type value_type;
typedef value_type _FARQ *pointer;
typedef value_type _FARQ& reference;
typedef const value_type _FARQ *const_pointer;
typedef const value_type _FARQ& const_reference;
typedef value_type* pointer;
typedef value_type& reference;
typedef const value_type* const_pointer;
typedef const value_type& const_reference;
typedef _SIZT size_type;
typedef _PDFT difference_type;
typedef size_t size_type;
typedef ptrdiff_t difference_type;
template<class _Other>
struct rebind
@ -106,7 +106,7 @@ public:
return (pointer)ALLOC(_Count * sizeof(_Ty));
}
pointer allocate(size_type _Count, const void _FARQ *)
pointer allocate(size_type _Count, const void*)
{ // allocate array of _Count elements, ignore hint
return (allocate(_Count));
}
@ -121,9 +121,9 @@ public:
std::_Destroy(_Ptr);
}
_SIZT max_size() const
size_t max_size() const
{ // estimate maximum array size
_SIZT _Count = (_SIZT)(-1) / sizeof (_Ty);
size_t _Count = (size_t)(-1) / sizeof (_Ty);
return (0 < _Count ? _Count : 1);
}
};
@ -143,13 +143,17 @@ template<class _Ty,
return (false);
}
#ifndef _CRTIMP2
#define _CRTIMP2
#endif
// CLASS cyallocator<void>
template<> class _CRTIMP2 cyallocator<void>
{ // generic cyallocator for type void
public:
typedef void _Ty;
typedef _Ty _FARQ *pointer;
typedef const _Ty _FARQ *const_pointer;
typedef _Ty* pointer;
typedef const _Ty* const_pointer;
typedef _Ty value_type;
template<class _Other>
@ -264,12 +268,12 @@ struct delete_map_ptr_T
struct stricmp_less : public std::binary_function<std::string, std::string, bool>
{
bool operator()(const std::string & _X, const std::string & _Y) const
{return ( _stricmp(_X.c_str(),_Y.c_str()) < 0); }
{return ( stricmp(_X.c_str(),_Y.c_str()) < 0); }
};
struct wstricmp_less : public std::binary_function<std::wstring, std::wstring, bool>
{
bool operator()(const std::wstring & _X, const std::wstring & _Y) const
{return ( _wcsicmp(_X.c_str(),_Y.c_str()) < 0); }
{return ( wcsicmp(_X.c_str(),_Y.c_str()) < 0); }
};
// struct stricmp_char_traits

14
Sources/Plasma/CoreLib/hsStream.cpp

@ -416,15 +416,15 @@ hsBool hsStream::GetToken(char *s, UInt32 maxLen, const char beginComment, const
s[k] = 0;
if( (k > 0)&&!_stricmp(s, "skip") )
if( (k > 0)&&!stricmp(s, "skip") )
{
int depth = 1;
while( depth && GetToken(s, maxLen, beginComment, endCom) )
{
if( !_stricmp(s, "skip") )
if( !stricmp(s, "skip") )
depth++;
else
if( !_stricmp(s, "piks") )
if( !stricmp(s, "piks") )
depth--;
}
return GetToken(s, maxLen, beginComment, endCom);
@ -466,15 +466,15 @@ hsBool hsStream::ReadLn(char *s, UInt32 maxLen, const char beginComment, const c
s[k] = 0;
if( (k > 0)&&!_stricmp(s, "skip") )
if( (k > 0)&&!stricmp(s, "skip") )
{
int depth = 1;
while( depth && ReadLn(s, maxLen, beginComment, endCom) )
{
if( !_stricmp(s, "skip") )
if( !stricmp(s, "skip") )
depth++;
else
if( !_stricmp(s, "piks") )
if( !stricmp(s, "piks") )
depth--;
}
return ReadLn(s, maxLen, beginComment, endCom);
@ -987,7 +987,7 @@ hsBool hsUNIXStream::Open(const char *name, const char *mode)
hsBool hsUNIXStream::Open(const wchar *name, const wchar *mode)
{
fPosition = 0;
fRef = _wfopen(name, mode);
fRef = hsWFopen(name, mode);
return (fRef) ? true : false;
}

6
Sources/Plasma/CoreLib/hsTypes.h

@ -521,8 +521,8 @@ hsDebugMessageProc hsSetDebugMessageProc(hsDebugMessageProc newProc);
extern hsDebugMessageProc gHSStatusProc;
hsDebugMessageProc hsSetStatusMessageProc(hsDebugMessageProc newProc);
void __cdecl ErrorAssert (int line, const char file[], const char fmt[], ...);
void __cdecl ErrorFatal (int line, const char file[], const char fmt[], ...);
void CDECL ErrorAssert (int line, const char file[], const char fmt[], ...);
void CDECL ErrorFatal (int line, const char file[], const char fmt[], ...);
void ErrorMinimizeAppWindow ();
enum EErrorOption {
@ -561,7 +561,7 @@ void DebugMsgV (const char fmt[], va_list args);
#define ASSERT(expr) NULL_STMT
#define ASSERTMSG(expr, msg) NULL_STMT
#define FATAL(msg) NULL_STMT
#define DEBUG_MSG NULL_STMT
#define DEBUG_MSG (void)
#define DEBUG_MSGV NULL_STMT
#define DEBUG_BREAK_IF_DEBUGGER_PRESENT NULL_STMT

70
Sources/Plasma/CoreLib/hsUtils.h

@ -45,17 +45,17 @@ char * hsFormatStr(const char * fmt, ...); // You are responsible for returned
char * hsFormatStrV(const char * fmt, va_list args); // You are responsible for returned memory.
// Use "correct" stricmp based on the selected compiler / library
#ifdef _MSC_VER
#define stricmp _stricmp
#define strnicmp _strnicmp
#define wcsicmp _wcsicmp
#define wcsnicmp _wcsnicmp
#define strlwr _strlwr
#if HS_BUILD_FOR_WIN32
# define stricmp _stricmp
# define strnicmp _strnicmp
# define wcsicmp _wcsicmp
# define wcsnicmp _wcsnicmp
# define strlwr _strlwr
#else
#define stricmp strcasecmp
#define strnicmp strncasecmp
#define wcsicmp wcscasecmp
#define wcsnicmp wcsncasecmp
# define stricmp strcasecmp
# define strnicmp strncasecmp
# define wcsicmp wcscasecmp
# define wcsnicmp wcsncasecmp
#endif
@ -125,41 +125,31 @@ inline hsBool hsCompare(hsScalar a, hsScalar b, hsScalar delta=0.0001)
#if HS_BUILD_FOR_WIN32
#define hsVsnprintf _vsnprintf
#define hsVsnwprintf _vsnwprintf
#define snprintf _snprintf
#define snwprintf _snwprintf
#define hsSnprintf snprintf
#define hsSnwprintf snwprintf
#else
#define hsVsnprintf vsnprintf
#define hsWvnwprintf vsnwprintf
#define hsSnprintf snprintf
#define hsSnwprintf snwprintf
#define _snprintf snprintf
#define _snwprintf snwprintf
#endif
#if HS_BUILD_FOR_UNIX || HS_BUILD_FOR_PS2
// This is for Windows
# define hsVsnprintf _vsnprintf
# define hsVsnwprintf _vsnwprintf
# define hsSnprintf _snprintf
# define hsSnwprintf _snwprintf
#define _stricmp(s1, s2) strcasecmp(s1, s2)
#define _strnicmp(s1, s2, n) strncasecmp(s1, s2, n)
#define stricmp(s1, s2) strcasecmp(s1, s2)
#define strnicmp(s1, s2, n) strncasecmp(s1, s2, n)
# define snprintf _snprintf
# define snwprintf _snwprintf
# define swprintf _snwprintf
#define _fileno(n) fileno(n)
# ifndef fileno
# define fileno(__F) _fileno(__F)
# endif
# define hsWFopen(name, mode) _wfopen(name, mode)
#else
// This is for Unix, Linux, OSX, etc.
# define hsVsnprintf vsnprintf
# define hsVsnwprintf vswprintf
# define hsSnprintf snprintf
# define hsSnwprintf swprintf
#elif HS_BUILD_FOR_MAC // HS_BUILD_FOR_UNIX || HS_BUILD_FOR_PS2
int hsStrcasecmp(const char s1[], const char s2[]);
int hsStrncasecmp(const char s1[], const char s2[], int n);
#define _stricmp(s1, s2) hsStrcasecmp(s1, s2)
#define _strnicmp(s1, s2, n) hsStrncasecmp(s1, s2, n)
# define hsWFopen(name, mode) fopen(hsWStringToString(name), hsWStringToString(mode))
#endif
#endif // HS_BUILD_FOR_UNIX || HS_BUILD_FOR_PS2
/////////////////////////////
// Physical memory functions

2
Sources/Plasma/CoreLibExe/Pch.h

@ -51,6 +51,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include <malloc.h>
#ifdef HS_BUILD_FOR_WIN32
#if _MSC_VER
#include <crtdbg.h>
#endif

2
Sources/Plasma/CoreLibExe/hsExeError.cpp

@ -56,7 +56,7 @@ static bool s_options[kNumErrorOptions];
AUTO_INIT_FUNC(hsExeErrorInit) {
// The critical section has to be initialized
// before program startup and never freed
static byte rawMemory[sizeof CCritSect];
static byte rawMemory[sizeof(CCritSect)];
s_critsect = new(rawMemory) CCritSect;
}

2
Sources/Plasma/CoreLibExe/hsExeMalloc.cpp

@ -329,6 +329,7 @@ static void __cdecl CheckLeaksOnExit () {
#endif // MEM_DEBUG
//============================================================================
#ifdef MEM_DEBUG
static int __cdecl CrtAllocHook (
int method,
void * pUserData,
@ -344,6 +345,7 @@ static int __cdecl CrtAllocHook (
return 1;
}
#endif // MEM_DEBUG
//===========================================================================
#ifdef MEM_DEBUG

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

@ -841,7 +841,7 @@ PF_CONSOLE_CMD( Console, SetVar, "string name, string value",
hsBool oldF = ctx.GetAddWhenNotFound();
ctx.SetAddWhenNotFound( true );
ctx.SetVar( params[ 0 ], params[ 1 ] );
ctx.SetVar((char*)params[ 0 ], (char*)params[ 1 ] );
ctx.SetAddWhenNotFound( oldF );
}
@ -2251,17 +2251,17 @@ PF_CONSOLE_CMD( App,
char* eventStr = params[1];
CallbackEvent event;
if( !_stricmp(eventStr, "Start") )
if( !stricmp(eventStr, "Start") )
{
event = kStart;
}
else
if( !_stricmp(eventStr, "Stop") )
if( !stricmp(eventStr, "Stop") )
{
event = kStop;
}
else
if( !_stricmp(eventStr, "Time") )
if( !stricmp(eventStr, "Time") )
{
event = kTime;
secs = params[2];
@ -2306,17 +2306,17 @@ PF_CONSOLE_CMD( App,
char* eventStr = params[1];
CallbackEvent event;
if( !_stricmp(eventStr, "Start") )
if( !stricmp(eventStr, "Start") )
{
event = kStart;
}
else
if( !_stricmp(eventStr, "Stop") )
if( !stricmp(eventStr, "Stop") )
{
event = kStop;
}
else
if( !_stricmp(eventStr, "Time") )
if( !stricmp(eventStr, "Time") )
{
event = kTime;
secs = params[2];

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

@ -43,7 +43,7 @@ UInt32 pfConsoleCmdGroup::fBaseCmdGroupRef = 0;
//// Constructor & Destructor ////////////////////////////////////////////////
pfConsoleCmdGroup::pfConsoleCmdGroup( char *name, char *parent )
pfConsoleCmdGroup::pfConsoleCmdGroup(const char *name, const char *parent )
{
fNext = nil;
fPrevPtr = nil;
@ -160,7 +160,7 @@ pfConsoleCmd *pfConsoleCmdGroup::FindNestedPartialCommand( char *name, UInt32
// Try us
for( cmd = fCommands; cmd != nil; cmd = cmd->GetNext() )
{
if( _strnicmp( cmd->GetName(), name, strlen( name ) ) == 0 )
if(strnicmp( cmd->GetName(), name, strlen( name ) ) == 0 )
{
if( *counter == 0 )
return cmd;
@ -250,7 +250,7 @@ pfConsoleCmd *pfConsoleCmdGroup::FindCommandNoCase( char *name, UInt8 flags,
{
for( cmd = start; cmd != nil; cmd = cmd->GetNext() )
{
if( _strnicmp( cmd->GetName(), name, strlen( name ) ) == 0 )
if(strnicmp( cmd->GetName(), name, strlen( name ) ) == 0 )
return cmd;
}
}
@ -285,7 +285,7 @@ pfConsoleCmdGroup *pfConsoleCmdGroup::FindSubGroupNoCase( char *name, UInt8 fl
{
for( group = start; group != nil; group = group->GetNext() )
{
if( _strnicmp( group->GetName(), name, strlen( name ) ) == 0 )
if(strnicmp( group->GetName(), name, strlen( name ) ) == 0 )
return group;
}
}
@ -355,7 +355,8 @@ int pfConsoleCmdGroup::IterateCommands(pfConsoleCmdIterator* t, int depth)
char pfConsoleCmd::fSigTypes[ kNumTypes ][ 8 ] = { "int", "float", "bool", "string", "char", "void", "..." };
pfConsoleCmd::pfConsoleCmd( char *group, char *name, char *paramList, char *help,
pfConsoleCmd::pfConsoleCmd(const char *group, const char *name,
const char *paramList, const char *help,
pfConsoleCmdPtr func, hsBool localOnly )
{
fNext = nil;
@ -390,7 +391,7 @@ pfConsoleCmd::~pfConsoleCmd()
//// ICreateSignature ////////////////////////////////////////////////////////
// Creates the signature and sig labels based on the given string.
void pfConsoleCmd::ICreateSignature( char *paramList )
void pfConsoleCmd::ICreateSignature(const char *paramList )
{
static char seps[] = " :-";
@ -461,7 +462,7 @@ void pfConsoleCmd::ICreateSignature( char *paramList )
// Finds the group this command should be in and registers it with that
// group.
void pfConsoleCmd::Register( char *group, char *name )
void pfConsoleCmd::Register(const char *group, const char *name )
{
pfConsoleCmdGroup *g;

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

@ -65,7 +65,7 @@ class pfConsoleCmdGroup
kFindPartial = 0x01
};
pfConsoleCmdGroup( char *name, char *parent );
pfConsoleCmdGroup(const char *name, const char *parent );
~pfConsoleCmdGroup();
void AddCommand( pfConsoleCmd *cmd );
@ -159,7 +159,7 @@ class pfConsoleCmd
{
protected:
char fName[ 128 ];
char *fHelpString;
const char* fHelpString;
pfConsoleCmdPtr fFunction;
hsBool fLocalOnly;
@ -172,7 +172,7 @@ class pfConsoleCmd
hsExpander<UInt8> fSignature;
hsExpander<char *> fSigLabels;
void ICreateSignature( char *paramList );
void ICreateSignature(const char *paramList );
public:
@ -192,10 +192,10 @@ class pfConsoleCmd
static char fSigTypes[ kNumTypes ][ 8 ];
pfConsoleCmd( char *group, char *name, char *paramList, char *help, pfConsoleCmdPtr func, hsBool localOnly = false );
pfConsoleCmd(const char *group, const char *name, const char *paramList, const char *help, pfConsoleCmdPtr func, hsBool localOnly = false );
~pfConsoleCmd();
void Register( char *group, char *name );
void Register(const char *group, const char *name );
void Unregister();
void Execute( Int32 numParams, pfConsoleCmdParam *params, void (*PrintFn)( const char * ) = nil );
@ -204,7 +204,7 @@ class pfConsoleCmd
pfConsoleCmd *GetNext( void ) { return fNext; }
char *GetName( void ) { return fName; }
char *GetHelp( void ) { return fHelpString; }
const char *GetHelp( void ) { return fHelpString; }
const char *GetSignature( void );
pfConsoleCmdGroup *GetParent( void ) { return fParentGroup; }

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

@ -149,8 +149,10 @@ hsBool pfConsoleEngine::PrintCmdHelp( char *name, void (*PrintFn)( const char *
PrintFn( " Commands:" );
for( cmd = group->GetFirstCommand(); cmd != nil; cmd = cmd->GetNext() )
{
for( ptr = cmd->GetHelp(), i = 0; ptr[ i ] != 0 && ptr[ i ] != '\n'; i++ )
tempString[ i ] = ptr[ i ];
const char* p = cmd->GetHelp();
for(i = 0; p[ i ] != 0 && p[ i ] != '\n'; i++) {
tempString[ i ] = p[ i ];
}
tempString[ i ] = 0;
sprintf( string, " %s: %s", cmd->GetName(), tempString );

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

@ -58,7 +58,7 @@ class pfConsoleEngine
char fErrorMsg[ 128 ];
char fLastErrorLine[ 512 ];
void ISetErrorMsg( char *msg ) { hsStrncpy( fErrorMsg, msg, sizeof( fErrorMsg ) ); }
void ISetErrorMsg(const char *msg ) { hsStrncpy( fErrorMsg, msg, sizeof( fErrorMsg ) ); }
// Recursive function to build a string of the groups a command is in
void IBuildCmdNameRecurse( pfConsoleCmdGroup *group, char *string );

2
Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIDialogMod.cpp

@ -428,7 +428,7 @@ static bool showBounds = false;
float y = sH * fControls[ i ]->fBoundsPoints[ j ].fY;
plDebugText::Instance().DrawRect( (UInt16)(x - 2), (UInt16)(y - 2), (UInt16)(x + 2), (UInt16)(y + 2), color );
char str[ 16 ];
itoa( j, str, 10 );
snprintf(str, 16, "%d", j);
plDebugText::Instance().DrawString( (UInt16)(x + 8), (UInt16)(y - 8), str, color );
}
}

2
Sources/Plasma/FeatureLib/pfJournalBook/pfJournalBook.cpp

@ -32,6 +32,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
// //
//////////////////////////////////////////////////////////////////////////////
#include <wchar.h>
#include "pfJournalBook.h"
#include "hsUtils.h"
#include "hsStlUtils.h"

29
Sources/Plasma/FeatureLib/pfLocalizationMgr/pfLocalizationDataMgr.cpp

@ -50,6 +50,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include <bxwchar.h>
#endif
// MinGW sucks
#if defined(_WIN32) && !defined(_MSC_VER)
# define swprintf _snwprintf
#endif
//////////////////////////////////////////////////////////////////////
//
// LocalizationXMLFile - a basic class for storing all the
@ -422,7 +427,7 @@ bool LocalizationXMLFile::Parse(const std::string & fileName)
if (XML_Parse(fParser, Buff, (int)len, done) == XML_STATUS_ERROR)
{
wchar_t lineNumber[256];
_itow(XML_GetCurrentLineNumber(fParser), lineNumber, 10);
swprintf(lineNumber, 256, L"%d", XML_GetCurrentLineNumber(fParser));
fLastError += L"ERROR: Parse error at line ";
fLastError += lineNumber;
fLastError += L": ";
@ -466,7 +471,7 @@ bool LocalizationXMLFile::Parse(const std::string & fileName)
void LocalizationXMLFile::AddError(const std::wstring & errorText)
{
wchar_t lineNumber[256];
_itow(XML_GetCurrentLineNumber(fParser), lineNumber, 10);
swprintf(lineNumber, 256, L"%d", XML_GetCurrentLineNumber(fParser));
fLastError += L"ERROR (line ";
fLastError += lineNumber;
fLastError += L"): " + errorText + L"\n";
@ -603,7 +608,7 @@ void LocalizationDatabase::IVerifyElement(const std::wstring &ageName, const std
int numLocales = plLocalization::GetNumLocales();
for (int curLocale = 0; curLocale <= numLocales; curLocale++)
{
char *name = plLocalization::GetLanguageName((plLocalization::Language)curLocale);
const char *name = plLocalization::GetLanguageName((plLocalization::Language)curLocale);
wchar_t *wName = hsStringToWString(name);
languageNames.push_back(wName);
delete [] wName;
@ -629,12 +634,7 @@ void LocalizationDatabase::IVerifyElement(const std::wstring &ageName, const std
{
fErrorString += L"ERROR: The language " + curTranslation->first + L" used by " + ageName + L"." + setName + L".";
fErrorString += elementName + L" is not supported, discarding translation\n";
#if !HS_BUILD_FOR_MAC
curTranslation = theElement.erase(curTranslation);
#else
// jfim: I thought std::map::erase returned void?
theElement.erase(curTranslation);
#endif
curTranslation--; // because this will be incremented on the next run through the loop
continue;
}
@ -645,12 +645,7 @@ void LocalizationDatabase::IVerifyElement(const std::wstring &ageName, const std
{
fErrorString += L"ERROR: Default language " + defaultLanguage + L" is missing from the translations in element ";
fErrorString += ageName + L"." + setName + L"." + elementName + L", deleting element\n";
#if !HS_BUILD_FOR_MAC
curElement = theSet.erase(curElement);
#else
// jfim: I thought std::map::erase returned void?
theSet.erase(curElement);
#endif
curElement--;
return;
}
@ -918,7 +913,7 @@ pfLocalizationDataMgr::localizedElement pfLocalizationDataMgr::ICreateLocalizedE
for (int curLocale = 0; curLocale <= numLocales; curLocale++)
{
char *name = plLocalization::GetLanguageName((plLocalization::Language)curLocale);
const char *name = plLocalization::GetLanguageName((plLocalization::Language)curLocale);
wchar_t *wName = hsStringToWString(name);
retVal[wName] = L"";
delete [] wName;
@ -932,7 +927,7 @@ pfLocalizationDataMgr::localizedElement pfLocalizationDataMgr::ICreateLocalizedE
std::wstring pfLocalizationDataMgr::IGetCurrentLanguageName()
{
std::wstring retVal;
char *name = plLocalization::GetLanguageName(plLocalization::GetLanguage());
const char *name = plLocalization::GetLanguageName(plLocalization::GetLanguage());
wchar_t *wName = hsStringToWString(name);
retVal = wName;
delete [] wName;
@ -948,7 +943,7 @@ std::vector<std::wstring> pfLocalizationDataMgr::IGetAllLanguageNames()
for (int curLocale = 0; curLocale <= numLocales; curLocale++)
{
char *name = plLocalization::GetLanguageName((plLocalization::Language)curLocale);
const char *name = plLocalization::GetLanguageName((plLocalization::Language)curLocale);
wchar_t *wName = hsStringToWString(name);
retVal.push_back(wName);
delete [] wName;
@ -1257,7 +1252,7 @@ std::wstring pfLocalizationDataMgr::GetElementPlainTextData(const std::wstring &
if (fLocalizedElements.exists(name))
{
if (fLocalizedElements[name].find(languageName) != fLocalizedElements[name].end())
retVal = (std::wstring)fLocalizedElements[name][languageName];
retVal = fLocalizedElements[name][languageName];
}
return retVal;
}

13
Sources/Plasma/FeatureLib/pfLocalizationMgr/pfLocalizedString.cpp

@ -40,6 +40,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include <bxwchar.h>
#endif
// MinGW sucks
#if defined(_WIN32) && !defined(_MSC_VER)
# define swprintf _snwprintf
#endif
//////////////////////////////////////////////////////////////////////
//// pfLocalizedString functions /////////////////////////////////////
//////////////////////////////////////////////////////////////////////
@ -114,7 +119,7 @@ void pfLocalizedString::IConvertFromPlainText(const std::wstring & plainText)
curTextBlock.fText = L"";
std::wstring number = plainText.substr(curIndex + 1, (endArgPos - (curIndex + 1)));
curTextBlock.fParamIndex = _wtoi(number.c_str()) - 1; // args are 1-based, vectors are 0-based
curTextBlock.fParamIndex = (UInt8)wcstol(number.c_str(), NULL, 10) - 1; // args are 1-based, vectors are 0-based
fText.push_back(curTextBlock);
curTextBlock.fIsParam = false;
@ -150,7 +155,7 @@ void pfLocalizedString::IUpdatePlainText()
{
std::wstring paramStr = L"%";
wchar_t buff[256];
_itow(curTextBlock.fParamIndex + 1, buff, 10);
swprintf(buff, 256, L"%d", curTextBlock.fParamIndex + 1);
paramStr += buff;
paramStr += L"s";
fPlainTextRep += paramStr;
@ -223,7 +228,7 @@ void pfLocalizedString::IConvertFromXML(const std::wstring & xml)
curTextBlock.fText = L"";
std::wstring number = xml.substr(curIndex + 1, (endArgPos - (curIndex + 1)));
curTextBlock.fParamIndex = _wtoi(number.c_str()) - 1; // args are 1-based, vectors are 0-based
curTextBlock.fParamIndex = (UInt8)wcstol(number.c_str(), nil, 10) - 1; // args are 1-based, vectors are 0-based
fText.push_back(curTextBlock);
curTextBlock.fIsParam = false;
@ -260,7 +265,7 @@ void pfLocalizedString::IUpdateXML()
{
std::wstring paramStr = L"%";
wchar_t buff[256];
_itow(curTextBlock.fParamIndex + 1, buff, 10);
swprintf(buff, 256, L"%d", curTextBlock.fParamIndex + 1);
paramStr += buff;
paramStr += L"s";
fXMLRep += paramStr;

2
Sources/Plasma/FeatureLib/pfLocalizationMgr/pfLocalizedString.h

@ -86,7 +86,7 @@ public:
bool operator>=(pfLocalizedString &obj);
bool operator!=(pfLocalizedString &obj);
operator const wchar_t *() {return fPlainTextRep.c_str();}
//operator const wchar_t *() {return fPlainTextRep.c_str();}
operator std::wstring() {return fPlainTextRep;}
pfLocalizedString operator+(pfLocalizedString &obj);

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

@ -1919,7 +1919,7 @@ void PythonInterface::WriteToStdErr(const char* text)
//
// PURPOSE : Find module. If it doesn't exist then don't create, return nil.
//
PyObject* PythonInterface::FindModule(char* module)
PyObject* PythonInterface::FindModule(const char* module)
{
PyObject *m;
// first we must get rid of any old modules of the same name, we'll replace it
@ -1960,7 +1960,7 @@ hsBool PythonInterface::IsModuleNameUnique(char* module)
//
// PURPOSE : create a new module with built-ins
//
PyObject* PythonInterface::CreateModule(char* module)
PyObject* PythonInterface::CreateModule(const char* module)
{
PyObject *m, *d;
// first we must get rid of any old modules of the same name, we'll replace it

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

@ -123,10 +123,10 @@ public:
static void WriteToStdErr(const char* text);
// Find module. If it doesn't exist then don't create, return nil.
static PyObject* FindModule(char* module);
static PyObject* FindModule(const char* module);
// create a new module with built-ins
static PyObject* CreateModule(char* module);
static PyObject* CreateModule(const char* module);
// checks to see if a specific function is defined in this module
// get an item (probably a function) from the Plasma module

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

@ -133,47 +133,47 @@ plProfile_CreateTimer("Update", "Python", PythonUpdate);
//
// fFunctionNames - the actual names of the functions for On[event] types
//
char* plPythonFileMod::fFunctionNames[] =
const char* plPythonFileMod::fFunctionNames[] =
{
{ "OnFirstUpdate" }, // kfunc_FirstUpdate
{ "OnUpdate" }, // kfunc_Update
{ "OnNotify" }, // kfunc_Notify
{ "OnTimer" }, // kfunc_AtTimer
{ "OnControlKeyEvent" }, // kfunc_OnKeyEvent
{ "Load" }, // kfunc_Load
{ "Save" }, // kfunc_Save
{ "OnGUINotify" }, // kfunc_GUINotify
{ "OnPageLoad" }, // kfunc_PageLoad
{ "OnClothingUpdate" }, // kfunc_ClothingUpdate
{ "OnKIMsg" }, // kfunc_KIMsg,
{ "OnMemberUpdate" }, // kfunc_MemberUpdate,
{ "OnRemoteAvatarInfo" }, // kfunc_RemoteAvatarInfo,
{ "OnRTChat" }, // kfunc_RTChat,
{ "OnVaultEvent" }, // kfunc_VaultEvent,
{ "AvatarPage" }, // kfunc_AvatarPage,
{ "OnSDLNotify" }, // kfunc_SDLNotify
{ "OnOwnershipChanged" }, // kfunc_OwnershipNotify
{ "OnAgeVaultEvent" }, // kfunc_AgeVaultEvent
{ "OnInit" }, // kfunc_Init,
{ "OnCCRMsg" }, // kfunc_OnCCRMsg,
{ "OnServerInitComplete" }, // kfunc_OnServerInitComplete
{ "OnVaultNotify" }, // kfunc_OnVaultNotify
{ "OnDefaultKeyCaught" }, // kfunc_OnDefaultKeyCaught
{ "OnMarkerMsg" }, // kfunc_OnMarkerMsg,
{ "OnBackdoorMsg" }, // kfunc_OnBackdoorMsg,
{ "OnBehaviorNotify" }, // kfunc_OnBehaviorNotify,
{ "OnLOSNotify" }, // kfunc_OnLOSNotify,
{ "BeginAgeUnLoad" }, // kfunc_OnBeginAgeLoad,
{ "OnMovieEvent" }, // kfunc_OnMovieEvent,
{ "OnScreenCaptureDone" }, // kfunc_OnScreenCaptureDone,
{ "OnClimbingBlockerEvent"},// kFunc_OnClimbingBlockerEvent,
{ "OnAvatarSpawn"}, // kFunc_OnAvatarSpawn
{ "OnAccountUpdate"}, // kFunc_OnAccountUpdate
{ "gotPublicAgeList"}, // kfunc_gotPublicAgeList
{ "OnGameMgrMsg" }, // kfunc_OnGameMgrMsg
{ "OnGameCliMsg" }, // kfunc_OnGameCliMsg
{ "OnAIMsg" }, // kfunc_OnAIMsg
{ nil }
"OnFirstUpdate", // kfunc_FirstUpdate
"OnUpdate", // kfunc_Update
"OnNotify", // kfunc_Notify
"OnTimer", // kfunc_AtTimer
"OnControlKeyEvent", // kfunc_OnKeyEvent
"Load", // kfunc_Load
"Save", // kfunc_Save
"OnGUINotify", // kfunc_GUINotify
"OnPageLoad", // kfunc_PageLoad
"OnClothingUpdate", // kfunc_ClothingUpdate
"OnKIMsg", // kfunc_KIMsg,
"OnMemberUpdate", // kfunc_MemberUpdate,
"OnRemoteAvatarInfo", // kfunc_RemoteAvatarInfo,
"OnRTChat", // kfunc_RTChat,
"OnVaultEvent", // kfunc_VaultEvent,
"AvatarPage", // kfunc_AvatarPage,
"OnSDLNotify", // kfunc_SDLNotify
"OnOwnershipChanged", // kfunc_OwnershipNotify
"OnAgeVaultEvent", // kfunc_AgeVaultEvent
"OnInit", // kfunc_Init,
"OnCCRMsg", // kfunc_OnCCRMsg,
"OnServerInitComplete", // kfunc_OnServerInitComplete
"OnVaultNotify", // kfunc_OnVaultNotify
"OnDefaultKeyCaught", // kfunc_OnDefaultKeyCaught
"OnMarkerMsg", // kfunc_OnMarkerMsg,
"OnBackdoorMsg", // kfunc_OnBackdoorMsg,
"OnBehaviorNotify", // kfunc_OnBehaviorNotify,
"OnLOSNotify", // kfunc_OnLOSNotify,
"BeginAgeUnLoad", // kfunc_OnBeginAgeLoad,
"OnMovieEvent", // kfunc_OnMovieEvent,
"OnScreenCaptureDone", // kfunc_OnScreenCaptureDone,
"OnClimbingBlockerEvent",// kFunc_OnClimbingBlockerEvent,
"OnAvatarSpawn", // kFunc_OnAvatarSpawn
"OnAccountUpdate", // kFunc_OnAccountUpdate
"gotPublicAgeList", // kfunc_gotPublicAgeList
"OnGameMgrMsg", // kfunc_OnGameMgrMsg
"OnGameCliMsg", // kfunc_OnGameCliMsg
"OnAIMsg", // kfunc_OnAIMsg
nil
};
//// Callback From the Vault Events //////////////////////////////////////////////
@ -199,9 +199,10 @@ public:
PyTuple_SetItem(ptuple, 0, pyVaultNodeRef::New(parentNode, childNode));
// call it
plProfile_BeginTiming(PythonUpdate);
PyObject* retVal = PyObject_CallMethod(fPyFileMod->fPyFunctionInstances[fFunctionIdx],
fPyFileMod->fFunctionNames[fFunctionIdx],
"lO",pyVault::kVaultNodeRefAdded,ptuple);
PyObject* retVal = PyObject_CallMethod(
fPyFileMod->fPyFunctionInstances[fFunctionIdx],
(char*)fPyFileMod->fFunctionNames[fFunctionIdx],
"lO",pyVault::kVaultNodeRefAdded,ptuple);
if ( retVal == nil )
{
#ifndef PLASMA_EXTERNAL_RELEASE
@ -228,9 +229,10 @@ public:
PyTuple_SetItem(ptuple, 0, pyVaultNodeRef::New(parentNode, childNode));
// call it
plProfile_BeginTiming(PythonUpdate);
PyObject* retVal = PyObject_CallMethod(fPyFileMod->fPyFunctionInstances[fFunctionIdx],
fPyFileMod->fFunctionNames[fFunctionIdx],
"lO",pyVault::kVaultRemovingNodeRef,ptuple);
PyObject* retVal = PyObject_CallMethod(
fPyFileMod->fPyFunctionInstances[fFunctionIdx],
(char*)fPyFileMod->fFunctionNames[fFunctionIdx],
"lO",pyVault::kVaultRemovingNodeRef,ptuple);
if ( retVal == nil )
{
#ifndef PLASMA_EXTERNAL_RELEASE
@ -257,9 +259,10 @@ public:
PyTuple_SetItem(ptuple, 0, pyVaultNode::New(changedNode));
// call it
plProfile_BeginTiming(PythonUpdate);
PyObject* retVal = PyObject_CallMethod(fPyFileMod->fPyFunctionInstances[fFunctionIdx],
fPyFileMod->fFunctionNames[fFunctionIdx],
"lO",pyVault::kVaultNodeSaved,ptuple);
PyObject* retVal = PyObject_CallMethod(
fPyFileMod->fPyFunctionInstances[fFunctionIdx],
(char*)fPyFileMod->fFunctionNames[fFunctionIdx],
"lO",pyVault::kVaultNodeSaved,ptuple);
if ( retVal == nil )
{
#ifndef PLASMA_EXTERNAL_RELEASE
@ -686,7 +689,7 @@ void plPythonFileMod::AddTarget(plSceneObject* sobj)
}
// - find functions in class they've defined.
PythonInterface::CheckInstanceForFunctions(fInstance,fFunctionNames,fPyFunctionInstances);
PythonInterface::CheckInstanceForFunctions(fInstance,(char**)fFunctionNames,fPyFunctionInstances);
// clear any errors created by checking for methods in a class
PyErr_Clear(); // clear the error
// register for messages that they have functions defined for
@ -818,7 +821,9 @@ void plPythonFileMod::AddTarget(plSceneObject* sobj)
{
plProfile_BeginTiming(PythonUpdate);
// call it
PyObject* retVal = PyObject_CallMethod(fPyFunctionInstances[kfunc_Init],fFunctionNames[kfunc_Init],nil);
PyObject* retVal = PyObject_CallMethod(
fPyFunctionInstances[kfunc_Init],
(char*)fFunctionNames[kfunc_Init], nil);
if ( retVal == nil )
{
#ifndef PLASMA_EXTERNAL_RELEASE
@ -894,8 +899,9 @@ void plPythonFileMod::HandleDiscardedKey( plKeyEventMsg *msg )
plProfile_BeginTiming( PythonUpdate );
PyObject* retVal = PyObject_CallMethod( fPyFunctionInstances[ kfunc_OnDefaultKeyCaught ],
fFunctionNames[ kfunc_OnDefaultKeyCaught ],
PyObject* retVal = PyObject_CallMethod(
fPyFunctionInstances[ kfunc_OnDefaultKeyCaught ],
(char*)fFunctionNames[ kfunc_OnDefaultKeyCaught ],
"ciiiii",
msg->GetKeyChar(),
(int)msg->GetKeyDown(),
@ -1123,7 +1129,9 @@ hsBool plPythonFileMod::IEval(double secs, hsScalar del, UInt32 dirty)
{
plProfile_BeginTiming(PythonUpdate);
// call it
PyObject* retVal = PyObject_CallMethod(fPyFunctionInstances[kfunc_FirstUpdate],fFunctionNames[kfunc_FirstUpdate],nil);
PyObject* retVal = PyObject_CallMethod(
fPyFunctionInstances[kfunc_FirstUpdate],
(char*)fFunctionNames[kfunc_FirstUpdate], nil);
if ( retVal == nil )
{
#ifndef PLASMA_EXTERNAL_RELEASE
@ -1145,7 +1153,10 @@ hsBool plPythonFileMod::IEval(double secs, hsScalar del, UInt32 dirty)
{
plProfile_BeginTiming(PythonUpdate);
// call it
PyObject* retVal = PyObject_CallMethod(fPyFunctionInstances[kfunc_Update],fFunctionNames[kfunc_Update],"df",secs,del);
PyObject* retVal = PyObject_CallMethod(
fPyFunctionInstances[kfunc_Update],
(char*)fFunctionNames[kfunc_Update],
"df", secs, del);
if ( retVal == nil )
{
#ifndef PLASMA_EXTERNAL_RELEASE
@ -1495,8 +1506,10 @@ hsBool plPythonFileMod::MsgReceive(plMessage* msg)
// call it
plProfile_BeginTiming(PythonUpdate);
PyObject* retVal = PyObject_CallMethod(fPyFunctionInstances[kfunc_Notify],fFunctionNames[kfunc_Notify],
"flO",pNtfyMsg->fState,id,levents);
PyObject* retVal = PyObject_CallMethod(
fPyFunctionInstances[kfunc_Notify],
(char*)fFunctionNames[kfunc_Notify],
"flO", pNtfyMsg->fState, id, levents);
if ( retVal == nil )
{
#ifndef PLASMA_EXTERNAL_RELEASE
@ -1525,8 +1538,11 @@ hsBool plPythonFileMod::MsgReceive(plMessage* msg)
{
// call it
plProfile_BeginTiming(PythonUpdate);
PyObject* retVal = PyObject_CallMethod(fPyFunctionInstances[kfunc_OnKeyEvent],fFunctionNames[kfunc_OnKeyEvent],
"ll",pEMsg->GetControlCode(),pEMsg->ControlActivated());
PyObject* retVal = PyObject_CallMethod(
fPyFunctionInstances[kfunc_OnKeyEvent],
(char*)fFunctionNames[kfunc_OnKeyEvent],
"ll", pEMsg->GetControlCode(),
pEMsg->ControlActivated());
if ( retVal == nil )
{
#ifndef PLASMA_EXTERNAL_RELEASE
@ -1556,8 +1572,10 @@ hsBool plPythonFileMod::MsgReceive(plMessage* msg)
// yes...
// call it
plProfile_BeginTiming(PythonUpdate);
PyObject* retVal = PyObject_CallMethod(fPyFunctionInstances[kfunc_AtTimer],fFunctionNames[kfunc_AtTimer],
"l",pTimerMsg->fID);
PyObject* retVal = PyObject_CallMethod(
fPyFunctionInstances[kfunc_AtTimer],
(char*)fFunctionNames[kfunc_AtTimer],
"l", pTimerMsg->fID);
if ( retVal == nil )
{
#ifndef PLASMA_EXTERNAL_RELEASE
@ -1690,8 +1708,10 @@ hsBool plPythonFileMod::MsgReceive(plMessage* msg)
// call their OnGUINotify method
plProfile_BeginTiming(PythonUpdate);
PyObject* retVal = PyObject_CallMethod(fPyFunctionInstances[kfunc_GUINotify],fFunctionNames[kfunc_GUINotify],
"lOl",id,pyControl,pGUIMsg->GetEvent() );
PyObject* retVal = PyObject_CallMethod(
fPyFunctionInstances[kfunc_GUINotify],
(char*)fFunctionNames[kfunc_GUINotify],
"lOl", id, pyControl, pGUIMsg->GetEvent());
if ( retVal == nil )
{
#ifndef PLASMA_EXTERNAL_RELEASE
@ -1725,8 +1745,10 @@ hsBool plPythonFileMod::MsgReceive(plMessage* msg)
roomname = (char*)pRLNMsg->GetRoom()->GetName();
plProfile_BeginTiming(PythonUpdate);
PyObject* retVal = PyObject_CallMethod(fPyFunctionInstances[kfunc_PageLoad],fFunctionNames[kfunc_PageLoad],
"ls",pRLNMsg->GetWhatHappen(),roomname);
PyObject* retVal = PyObject_CallMethod(
fPyFunctionInstances[kfunc_PageLoad],
(char*)fFunctionNames[kfunc_PageLoad],
"ls", pRLNMsg->GetWhatHappen(), roomname);
if ( retVal == nil )
{
#ifndef PLASMA_EXTERNAL_RELEASE
@ -1756,7 +1778,9 @@ hsBool plPythonFileMod::MsgReceive(plMessage* msg)
// yes...
// call it
plProfile_BeginTiming(PythonUpdate);
PyObject* retVal = PyObject_CallMethod(fPyFunctionInstances[kfunc_ClothingUpdate],fFunctionNames[kfunc_ClothingUpdate],nil);
PyObject* retVal = PyObject_CallMethod(
fPyFunctionInstances[kfunc_ClothingUpdate],
(char*)fFunctionNames[kfunc_ClothingUpdate], nil);
if ( retVal == nil )
{
#ifndef PLASMA_EXTERNAL_RELEASE
@ -1850,8 +1874,10 @@ hsBool plPythonFileMod::MsgReceive(plMessage* msg)
}
plProfile_BeginTiming(PythonUpdate);
PyObject* retVal = PyObject_CallMethod(fPyFunctionInstances[kfunc_KIMsg],fFunctionNames[kfunc_KIMsg],
"lO",pkimsg->GetCommand(),value);
PyObject* retVal = PyObject_CallMethod(
fPyFunctionInstances[kfunc_KIMsg],
(char*)fFunctionNames[kfunc_KIMsg],
"lO", pkimsg->GetCommand(), value);
if ( retVal == nil )
{
#ifndef PLASMA_EXTERNAL_RELEASE
@ -1880,7 +1906,9 @@ hsBool plPythonFileMod::MsgReceive(plMessage* msg)
{
// yes... then call it
plProfile_BeginTiming(PythonUpdate);
PyObject* retVal = PyObject_CallMethod(fPyFunctionInstances[kfunc_MemberUpdate],fFunctionNames[kfunc_MemberUpdate],nil);
PyObject* retVal = PyObject_CallMethod(
fPyFunctionInstances[kfunc_MemberUpdate],
(char*)fFunctionNames[kfunc_MemberUpdate], nil);
if ( retVal == nil )
{
#ifndef PLASMA_EXTERNAL_RELEASE
@ -1931,8 +1959,10 @@ hsBool plPythonFileMod::MsgReceive(plMessage* msg)
}
plProfile_BeginTiming(PythonUpdate);
PyObject* retVal = PyObject_CallMethod(fPyFunctionInstances[kfunc_RemoteAvatarInfo],fFunctionNames[kfunc_RemoteAvatarInfo],
"O",player);
PyObject* retVal = PyObject_CallMethod(
fPyFunctionInstances[kfunc_RemoteAvatarInfo],
(char*)fFunctionNames[kfunc_RemoteAvatarInfo],
"O", player);
if ( retVal == nil )
{
#ifndef PLASMA_EXTERNAL_RELEASE
@ -1964,8 +1994,11 @@ hsBool plPythonFileMod::MsgReceive(plMessage* msg)
if ( textmessage == nil)
textmessage = "";
plProfile_BeginTiming(PythonUpdate);
PyObject* retVal = PyObject_CallMethod(fPyFunctionInstances[kfunc_OnCCRMsg],fFunctionNames[kfunc_OnCCRMsg],
"lsl",ccrmsg->GetType(),textmessage,ccrmsg->GetCCRPlayerID());
PyObject* retVal = PyObject_CallMethod(
fPyFunctionInstances[kfunc_OnCCRMsg],
(char*)fFunctionNames[kfunc_OnCCRMsg],
"lsl", ccrmsg->GetType(), textmessage,
ccrmsg->GetCCRPlayerID());
if ( retVal == nil )
{
#ifndef PLASMA_EXTERNAL_RELEASE
@ -2023,8 +2056,10 @@ hsBool plPythonFileMod::MsgReceive(plMessage* msg)
}
plProfile_BeginTiming(PythonUpdate);
PyObject* retVal = PyObject_CallMethod(fPyFunctionInstances[kfunc_OnVaultNotify],fFunctionNames[kfunc_OnVaultNotify],
"lO",vaultNotifyMsg->GetType(),ptuple);
PyObject* retVal = PyObject_CallMethod(
fPyFunctionInstances[kfunc_OnVaultNotify],
(char*)fFunctionNames[kfunc_OnVaultNotify],
"lO", vaultNotifyMsg->GetType(), ptuple);
if ( retVal == nil )
{
#ifndef PLASMA_EXTERNAL_RELEASE
@ -2077,8 +2112,11 @@ hsBool plPythonFileMod::MsgReceive(plMessage* msg)
}
plProfile_BeginTiming(PythonUpdate);
PyObject* retVal = PyObject_CallMethod(fPyFunctionInstances[kfunc_RTChat],fFunctionNames[kfunc_RTChat],
"Osl",player,pkimsg->GetString().c_str(),pkimsg->GetFlags());
PyObject* retVal = PyObject_CallMethod(
fPyFunctionInstances[kfunc_RTChat],
(char*)fFunctionNames[kfunc_RTChat],
"Osl", player, pkimsg->GetString().c_str(),
pkimsg->GetFlags());
if ( retVal == nil )
{
#ifndef PLASMA_EXTERNAL_RELEASE
@ -2110,8 +2148,10 @@ hsBool plPythonFileMod::MsgReceive(plMessage* msg)
plProfile_BeginTiming(PythonUpdate);
plSynchEnabler ps(true); // enable dirty state tracking during shutdown
PyObject* retVal = PyObject_CallMethod(fPyFunctionInstances[kfunc_AvatarPage],fFunctionNames[kfunc_AvatarPage],
"Oli",pSobj,!ppMsg->fUnload,ppMsg->fLastOut);
PyObject* retVal = PyObject_CallMethod(
fPyFunctionInstances[kfunc_AvatarPage],
(char*)fFunctionNames[kfunc_AvatarPage],
"Oli", pSobj, !ppMsg->fUnload, ppMsg->fLastOut);
if ( retVal == nil )
{
#ifndef PLASMA_EXTERNAL_RELEASE
@ -2143,8 +2183,10 @@ hsBool plPythonFileMod::MsgReceive(plMessage* msg)
plProfile_BeginTiming(PythonUpdate);
plSynchEnabler ps(true); // enable dirty state tracking during shutdown
PyObject* retVal = PyObject_CallMethod(fPyFunctionInstances[kfunc_OnBeginAgeLoad],fFunctionNames[kfunc_OnBeginAgeLoad],
"O",pSobj);
PyObject* retVal = PyObject_CallMethod(
fPyFunctionInstances[kfunc_OnBeginAgeLoad],
(char*)fFunctionNames[kfunc_OnBeginAgeLoad],
"O", pSobj);
if ( retVal == nil )
{
#ifndef PLASMA_EXTERNAL_RELEASE
@ -2176,7 +2218,10 @@ hsBool plPythonFileMod::MsgReceive(plMessage* msg)
}
if (fPyFunctionInstances[kfunc_OnServerInitComplete])
{
PyObject* retVal = PyObject_CallMethod(fPyFunctionInstances[kfunc_OnServerInitComplete],fFunctionNames[kfunc_OnServerInitComplete],nil);
PyObject* retVal = PyObject_CallMethod(
fPyFunctionInstances[kfunc_OnServerInitComplete],
(char*)fFunctionNames[kfunc_OnServerInitComplete],
nil);
if ( retVal == nil )
{
#ifndef PLASMA_EXTERNAL_RELEASE
@ -2207,8 +2252,11 @@ hsBool plPythonFileMod::MsgReceive(plMessage* msg)
tag = "";
// yes... then call it
plProfile_BeginTiming(PythonUpdate);
PyObject* retVal = PyObject_CallMethod(fPyFunctionInstances[kfunc_SDLNotify],fFunctionNames[kfunc_SDLNotify],
"ssls",sn->fVar->GetName(),sn->fSDLName.c_str(),sn->fPlayerID,tag);
PyObject* retVal = PyObject_CallMethod(
fPyFunctionInstances[kfunc_SDLNotify],
(char*)fFunctionNames[kfunc_SDLNotify],
"ssls", sn->fVar->GetName(), sn->fSDLName.c_str(),
sn->fPlayerID, tag);
if ( retVal == nil )
{
#ifndef PLASMA_EXTERNAL_RELEASE
@ -2235,8 +2283,10 @@ hsBool plPythonFileMod::MsgReceive(plMessage* msg)
{
// yes... then call it
plProfile_BeginTiming(PythonUpdate);
PyObject* retVal = PyObject_CallMethod(fPyFunctionInstances[kfunc_OwnershipNotify],fFunctionNames[kfunc_OwnershipNotify],
nil);
PyObject* retVal = PyObject_CallMethod(
fPyFunctionInstances[kfunc_OwnershipNotify],
(char*)fFunctionNames[kfunc_OwnershipNotify],
nil);
if ( retVal == nil )
{
#ifndef PLASMA_EXTERNAL_RELEASE
@ -2274,8 +2324,10 @@ hsBool plPythonFileMod::MsgReceive(plMessage* msg)
break;
}
PyObject* retVal = PyObject_CallMethod(fPyFunctionInstances[kfunc_OnMarkerMsg], fFunctionNames[kfunc_OnMarkerMsg],
"lO", (UInt32)markermsg->fType, ptuple);
PyObject* retVal = PyObject_CallMethod(
fPyFunctionInstances[kfunc_OnMarkerMsg],
(char*)fFunctionNames[kfunc_OnMarkerMsg],
"lO", (UInt32)markermsg->fType, ptuple);
if (retVal == nil)
{
#ifndef PLASMA_EXTERNAL_RELEASE
@ -2305,9 +2357,10 @@ hsBool plPythonFileMod::MsgReceive(plMessage* msg)
{
// yes... then call it
plProfile_BeginTiming(PythonUpdate);
PyObject* retVal = PyObject_CallMethod(fPyFunctionInstances[kfunc_OnBackdoorMsg],
fFunctionNames[kfunc_OnBackdoorMsg],
"ss",dt->GetTarget(),dt->GetString());
PyObject* retVal = PyObject_CallMethod(
fPyFunctionInstances[kfunc_OnBackdoorMsg],
(char*)fFunctionNames[kfunc_OnBackdoorMsg],
"ss", dt->GetTarget(), dt->GetString());
if ( retVal == nil )
{
// if there was an error make sure that the stderr gets flushed so it can be seen
@ -2348,10 +2401,11 @@ hsBool plPythonFileMod::MsgReceive(plMessage* msg)
hitpoint = Py_None;
}
PyObject* retVal = PyObject_CallMethod(fPyFunctionInstances[kfunc_OnLOSNotify],
fFunctionNames[kfunc_OnLOSNotify],
"llOOf",pLOSMsg->fRequestID,pLOSMsg->fNoHit,
scobj, hitpoint, pLOSMsg->fDistance);
PyObject* retVal = PyObject_CallMethod(
fPyFunctionInstances[kfunc_OnLOSNotify],
(char*)fFunctionNames[kfunc_OnLOSNotify],
"llOOf", pLOSMsg->fRequestID, pLOSMsg->fNoHit,
scobj, hitpoint, pLOSMsg->fDistance);
if ( retVal == nil )
{
#ifndef PLASMA_EXTERNAL_RELEASE
@ -2395,9 +2449,11 @@ hsBool plPythonFileMod::MsgReceive(plMessage* msg)
Py_INCREF(Py_None);
pSobj = Py_None;
}
PyObject* retVal = PyObject_CallMethod(fPyFunctionInstances[kfunc_OnBehaviorNotify],
fFunctionNames[kfunc_OnBehaviorNotify],
"lOl",behNotifymsg->fType,pSobj,behNotifymsg->state);
PyObject* retVal = PyObject_CallMethod(
fPyFunctionInstances[kfunc_OnBehaviorNotify],
(char*)fFunctionNames[kfunc_OnBehaviorNotify],
"lOl", behNotifymsg->fType, pSobj,
behNotifymsg->state);
if ( retVal == nil )
{
#ifndef PLASMA_EXTERNAL_RELEASE
@ -2426,9 +2482,10 @@ hsBool plPythonFileMod::MsgReceive(plMessage* msg)
{
// yes... then call it
plProfile_BeginTiming(PythonUpdate);
PyObject* retVal = PyObject_CallMethod(fPyFunctionInstances[kfunc_OnMovieEvent],
fFunctionNames[kfunc_OnMovieEvent],
"si",moviemsg->fMovieName,(UInt32)moviemsg->fReason);
PyObject* retVal = PyObject_CallMethod(
fPyFunctionInstances[kfunc_OnMovieEvent],
(char*)fFunctionNames[kfunc_OnMovieEvent],
"si", moviemsg->fMovieName, (UInt32)moviemsg->fReason);
if ( retVal == nil )
{
#ifndef PLASMA_EXTERNAL_RELEASE
@ -2468,9 +2525,10 @@ hsBool plPythonFileMod::MsgReceive(plMessage* msg)
Py_INCREF(Py_None);
pSobj = Py_None;
}
PyObject* retVal = PyObject_CallMethod(fPyFunctionInstances[kfunc_OnScreenCaptureDone],
fFunctionNames[kfunc_OnScreenCaptureDone],
"O",pSobj);
PyObject* retVal = PyObject_CallMethod(
fPyFunctionInstances[kfunc_OnScreenCaptureDone],
(char*)fFunctionNames[kfunc_OnScreenCaptureDone],
"O", pSobj);
if ( retVal == nil )
{
#ifndef PLASMA_EXTERNAL_RELEASE
@ -2498,9 +2556,10 @@ hsBool plPythonFileMod::MsgReceive(plMessage* msg)
PyObject* pSobj = pySceneObject::New(pEvent->GetSender(), fSelfKey);
plProfile_BeginTiming(PythonUpdate);
PyObject* retVal = PyObject_CallMethod(fPyFunctionInstances[kfunc_OnClimbBlockerEvent],
fFunctionNames[kfunc_OnClimbBlockerEvent],
"O",pSobj);
PyObject* retVal = PyObject_CallMethod(
fPyFunctionInstances[kfunc_OnClimbBlockerEvent],
(char*)fFunctionNames[kfunc_OnClimbBlockerEvent],
"O", pSobj);
if ( retVal == nil )
{
#ifndef PLASMA_EXTERNAL_RELEASE
@ -2520,9 +2579,10 @@ hsBool plPythonFileMod::MsgReceive(plMessage* msg)
plAvatarSpawnNotifyMsg* pSpawn = plAvatarSpawnNotifyMsg::ConvertNoRef(msg);
if (pSpawn)
{
PyObject* retVal = PyObject_CallMethod(fPyFunctionInstances[kfunc_OnAvatarSpawn],
fFunctionNames[kfunc_OnAvatarSpawn],
"l",1);
PyObject* retVal = PyObject_CallMethod(
fPyFunctionInstances[kfunc_OnAvatarSpawn],
(char*)fFunctionNames[kfunc_OnAvatarSpawn],
"l", 1);
if ( retVal == nil )
{
#ifndef PLASMA_EXTERNAL_RELEASE
@ -2543,8 +2603,12 @@ hsBool plPythonFileMod::MsgReceive(plMessage* msg)
if (pUpdateMsg)
{
plProfile_BeginTiming(PythonUpdate);
PyObject* retVal = PyObject_CallMethod(fPyFunctionInstances[kfunc_OnAccountUpdate], fFunctionNames[kfunc_OnAccountUpdate],
"iii", (int)pUpdateMsg->GetUpdateType(), (int)pUpdateMsg->GetResult(), (int)pUpdateMsg->GetPlayerInt()
PyObject* retVal = PyObject_CallMethod(
fPyFunctionInstances[kfunc_OnAccountUpdate],
(char*)fFunctionNames[kfunc_OnAccountUpdate],
"iii", (int)pUpdateMsg->GetUpdateType(),
(int)pUpdateMsg->GetResult(),
(int)pUpdateMsg->GetPlayerInt()
);
if ( retVal == nil )
{
@ -2586,7 +2650,7 @@ hsBool plPythonFileMod::MsgReceive(plMessage* msg)
PyObject* retVal = PyObject_CallMethod(
fPyFunctionInstances[kfunc_gotPublicAgeList],
fFunctionNames[kfunc_gotPublicAgeList],
(char*)fFunctionNames[kfunc_gotPublicAgeList],
"O",
pyEL
);
@ -2617,7 +2681,7 @@ hsBool plPythonFileMod::MsgReceive(plMessage* msg)
PyObject* pythonMsg = pyGameMgrMsg::New(gameMgrMsg);
PyObject* retVal = PyObject_CallMethod(
fPyFunctionInstances[kfunc_OnGameMgrMsg],
fFunctionNames[kfunc_OnGameMgrMsg],
(char*)fFunctionNames[kfunc_OnGameMgrMsg],
"O",
pythonMsg
);
@ -2649,7 +2713,7 @@ hsBool plPythonFileMod::MsgReceive(plMessage* msg)
PyObject* pythonMsg = pyGameCliMsg::New(gameMgrMsg);
PyObject* retVal = PyObject_CallMethod(
fPyFunctionInstances[kfunc_OnGameCliMsg],
fFunctionNames[kfunc_OnGameCliMsg],
(char*)fFunctionNames[kfunc_OnGameCliMsg],
"O",
pythonMsg
);
@ -2720,7 +2784,7 @@ hsBool plPythonFileMod::MsgReceive(plMessage* msg)
// call the function with the above arguments
PyObject* retVal = PyObject_CallMethod(
fPyFunctionInstances[kfunc_OnAIMsg],
fFunctionNames[kfunc_OnAIMsg],
(char*)fFunctionNames[kfunc_OnAIMsg],
"OisO",
brainObj, msgType, aiMsg->BrainUserString().c_str(), args
);

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

@ -191,7 +191,7 @@ public:
// array of matching Python instance where the functions are, if defined
PyObject* fPyFunctionInstances[kfunc_lastone];
// array of the names of the standard functions that can be called
static char* fFunctionNames[];
static const char* fFunctionNames[];
// The konstant hard-coded name to be used for all global pythonFileMods
static char kGlobalNameKonstant[];

6
Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifier.cpp

@ -273,8 +273,10 @@ void plPythonSDLModifier::ISetCurrentStateFrom(const plStateDataRecord* srcState
// Notify the Python code that we updated the SDL record
if (fOwner->fPyFunctionInstances[plPythonFileMod::kfunc_Load] != nil)
{
PyObject* retVal = PyObject_CallMethod(fOwner->fPyFunctionInstances[plPythonFileMod::kfunc_Load],
fOwner->fFunctionNames[plPythonFileMod::kfunc_Load], nil);
PyObject* retVal = PyObject_CallMethod(
fOwner->fPyFunctionInstances[plPythonFileMod::kfunc_Load],
(char*)fOwner->fFunctionNames[plPythonFileMod::kfunc_Load],
nil);
if (retVal == nil)
{
#ifndef PLASMA_EXTERNAL_RELEASE

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

@ -274,7 +274,7 @@ PyObject *EnumValue_oct(EnumValue *v)
if (x == 0)
strcpy(buf, "0");
else
_snprintf(buf, sizeof(buf), "0%lo", x);
snprintf(buf, sizeof(buf), "0%lo", x);
return PyString_FromString(buf);
}
@ -287,7 +287,7 @@ PyObject *EnumValue_hex(EnumValue *v)
Py_INCREF(Py_NotImplemented);
return Py_NotImplemented;
}
_snprintf(buf, sizeof(buf), "0x%lx", x);
snprintf(buf, sizeof(buf), "0x%lx", x);
return PyString_FromString(buf);
}

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

@ -234,7 +234,7 @@ class pfColorListElement : public pfGUIListText
{
size_t length = wcslen( fString1 ) + wcslen( fString2 ) + 3;
thestring = TRACKED_NEW wchar_t[ length ];
swprintf( thestring, length, L"%s %s", fString1, fString2 );
snwprintf( thestring, length, L"%s %s", fString1, fString2 );
wemade_string = true;
}
else if (fString1)

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

@ -38,7 +38,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
// conversion functions
const char* pyKeyMap::ConvertVKeyToChar( UInt32 vk, UInt32 flags )
{
char *key = plKeyMap::ConvertVKeyToChar( vk );
const char *key = plKeyMap::ConvertVKeyToChar( vk );
static char shortKey[ 2 ];
if( key == nil )
{

13
Sources/Plasma/NucleusLib/inc/plProfileManager.cpp

@ -40,10 +40,16 @@ static UInt32 gCyclesPerMS = 0;
#pragma warning (push)
#pragma warning (disable : 4035) // disable no return value warning
__forceinline UInt32 GetPentiumCounter()
#ifdef _MSC_VER
#define forceinline __forceinline
#else
#define forceinline inline
#endif
forceinline UInt32 GetPentiumCounter()
{
__asm
{
#ifdef _MSC_VER
__asm {
xor eax,eax // VC won't realize that eax is modified w/out this
// instruction to modify the val.
// Problem shows up in release mode builds
@ -52,6 +58,7 @@ __forceinline UInt32 GetPentiumCounter()
xor edx,edx // so VC gets that edx is modified
}
#endif
}
#pragma warning (pop)

14
Sources/Plasma/NucleusLib/pnAddrInfo/pnAddrInfo.cpp

@ -29,12 +29,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "hsTypes.h"
#include "pnAddrInfo.h"
#include <string.h>
#if HS_BUILD_FOR_UNIX
#include <unistd.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <net/if.h>
#include <sys/ioctl.h>
# include <unistd.h>
# include <arpa/inet.h>
# include <netinet/in.h>
# include <net/if.h>
# include <sys/ioctl.h>
#endif
const pnAddrInfo* pnAddrInfo::GetInterface()
@ -138,7 +139,8 @@ void pnAddrInfo::GetLocalAddrs(List& addrslist, bool incLoopBack)
SOCKET s = socket(AF_INET, SOCK_DGRAM, 0);
if (WSAIoctl(s,SIO_GET_INTERFACE_LIST,NULL,NULL,(void*)infos,bufSize,&retSize,NULL,NULL) == 0)
if (WSAIoctl(s, SIO_GET_INTERFACE_LIST, NULL, 0,
(void*)infos, bufSize, &retSize, NULL, NULL) == 0)
{
unsigned int entries = retSize/sizeof(INTERFACE_INFO);
int i;

16
Sources/Plasma/NucleusLib/pnAddrInfo/pnAddrInfo.h

@ -33,15 +33,19 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
// Unix and XP use native code
#if HS_BUILD_FOR_UNIX
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
# include <sys/types.h>
# include <sys/socket.h>
# include <netdb.h>
#elif HS_BUILD_FOR_WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
# if (_WIN32_WINNT < 0x0501)
# define _WIN32_WINNT 0x0501
# endif
# include <winsock2.h>
# include <ws2tcpip.h>
#else
#error "pnAddrInfo Not Implemented!"
# error "pnAddrInfo Not Implemented!"
#endif
#include "hsTypes.h"
#include "hsStlUtils.h"

2
Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/W9x/pnAceW9xSocket.cpp

@ -605,7 +605,7 @@ void CSocket::ProcessQueue () {
// Dispatch it
switch (command->code) {
case command->WRITE: {
case Command::WRITE: {
AsyncNotifySocketWrite notify;
notify.param = command->param;
notify.asyncId = 0;

2
Sources/Plasma/NucleusLib/pnFactory/plFactory.cpp

@ -188,7 +188,7 @@ UInt16 plFactory::FindClassIndex(const char* className)
int i;
for( i = 0; i < theFactory->fCreators.GetCount(); i++ )
{
if( theFactory->fCreators[i] && !_stricmp(className, theFactory->fCreators[i]->ClassName()) )
if( theFactory->fCreators[i] && !stricmp(className, theFactory->fCreators[i]->ClassName()) )
{
return theFactory->fCreators[i]->ClassIndex();
}

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;
};

4
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())
@ -1093,4 +1093,4 @@ CommandConvert plInputMap::fCmdConvert[] =
{ END_CONTROLS, ""},
};
};

14
Sources/Plasma/NucleusLib/pnInputCore/plKeyDef.h

@ -33,6 +33,20 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include <windows.h>
#define VK_BACK_QUOTE 0xc0
// MinGW is missing these definitions:
#ifndef VK_OEM_PLUS
#define VK_OEM_PLUS 0xBB
#endif
#ifndef VK_OEM_COMMA
#define VK_OEM_COMMA 0xBC
#endif
#ifndef VK_OEM_MINUS
#define VK_OEM_MINUS 0xBD
#endif
#ifndef VK_OEM_PERIOD
#define VK_OEM_PERIOD 0xBE
#endif
//
// keyboard definitions:
//

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/NucleusLib/pnNetBase/Private/pnNbAllIncludes.h

@ -35,7 +35,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "pnProduct/pnProduct.h"
#include "pnNbConst.h"
#include "../pnNbConst.h"
#include "pnNbError.h"
#include "pnNbKeys.h"
#include "pnNbProtocol.h"

4
Sources/Plasma/NucleusLib/pnNetBase/Private/pnNbError.h

@ -103,10 +103,10 @@ enum ENetError {
kNumNetErrors,
// Net messages require ENetError to be sizeof(dword)
kNetErrorForceDword = (dword) -1
kNetErrorForceDword = (dword)(-1)
};
COMPILER_ASSERT_HEADER(pnNbError, sizeof(ENetError) == sizeof(dword));
//COMPILER_ASSERT_HEADER(pnNbError, sizeof(ENetError) == sizeof(dword));
#define IS_NET_ERROR(a) (((int)(a)) > kNetSuccess)
#define IS_NET_SUCCESS(a) (((int)(a)) == kNetSuccess)

2
Sources/Plasma/NucleusLib/pnNetBase/pnNbConst.h

@ -90,7 +90,7 @@ const unsigned kBillingTypeGameTap = 1 << 1;
struct AccountRoleInfo {
unsigned Role;
char* Descriptor;
const char* Descriptor;
};
// Account role flags

2
Sources/Plasma/NucleusLib/pnNetCommon/plNetSharedState.cpp

@ -28,7 +28,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plGenericVar.h"
#include "pnMessage/plMessage.h"
plNetSharedState::plNetSharedState(char* name) : fServerMayDelete(false)
plNetSharedState::plNetSharedState(const char* name) : fServerMayDelete(false)
{
SetName(name);
}

2
Sources/Plasma/NucleusLib/pnNetCommon/plNetSharedState.h

@ -44,7 +44,7 @@ protected:
bool fServerMayDelete; // ok to delete (don't save) since this state is equivalent to the default state
public:
plNetSharedState(char* name=nil);
plNetSharedState(const char* name=nil);
virtual ~plNetSharedState();
virtual void Copy(plNetSharedState* ss);

2
Sources/Plasma/NucleusLib/pnNetCommon/plSynchedObject.cpp

@ -514,7 +514,7 @@ plSynchedObject::SDLStateList::const_iterator plSynchedObject::IFindInSDLStateLi
SDLStateList::const_iterator it = list.begin();
for(; it != list.end(); it++)
if (!_stricmp((*it).c_str(), sdlName))
if (!stricmp((*it).c_str(), sdlName))
return it;
return it; // .end(), false

123
Sources/Plasma/NucleusLib/pnUtils/Private/pnUtHash.h

@ -63,6 +63,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#define HASHTABLEDECLSIZE(object,key,link,size) THashTableDecl<object, key, offsetof(object,link), size >
#if defined(_MSC_VER)
#define forceinline __forceinline
#else
#define forceinline inline
#endif
/****************************************************************************
*
* Forward declarations
@ -76,6 +83,64 @@ template<class T>
class TBaseHashTable;
/****************************************************************************
*
* CHashValue
*
***/
class CHashValue {
private:
static const dword s_hashTable[];
dword m_result;
inline void Construct () { m_result = 0x325d1eae; }
public:
static dword LookupHashBits (unsigned value) { ASSERT(value < 0x100); return s_hashTable[value]; }
inline CHashValue () { Construct() ; }
inline CHashValue (const CHashValue & source) { m_result = source.m_result; }
inline CHashValue (const void * data, unsigned bytes) { Construct(); Hash(data, bytes); }
inline CHashValue & operator= (const CHashValue & source) { m_result = source.m_result; return *this; }
inline bool operator== (const CHashValue & source) const { return (m_result == source.m_result); }
inline dword GetHash () const { return m_result; }
forceinline void Hash (const void * data, unsigned bytes);
forceinline void Hash8 (unsigned data);
forceinline void Hash16 (unsigned data);
forceinline void Hash32 (unsigned data);
};
//===========================================================================
void CHashValue::Hash (const void * data, unsigned bytes) {
for (const byte * curr = (const byte *)data, * term = curr + bytes; curr != term; ++curr)
Hash8(*curr);
}
//===========================================================================
void CHashValue::Hash8 (unsigned data) {
m_result += s_hashTable[m_result >> 24] ^ (m_result >> 6) ^ s_hashTable[data & 0xff];
}
//===========================================================================
void CHashValue::Hash16 (unsigned data) {
Hash8(data);
Hash8(data >> 8);
}
//===========================================================================
void CHashValue::Hash32 (unsigned data) {
Hash8(data);
Hash8(data >> 8);
Hash8(data >> 16);
Hash8(data >> 24);
}
/****************************************************************************
*
* THashLink
@ -661,61 +726,3 @@ typedef THashKeyStr< wchar, THashKeyStrCmp<wchar> > CHashKeyStr;
typedef THashKeyStr< wchar, THashKeyStrCmpI<wchar> > CHashKeyStrI;
typedef THashKeyStr< char, THashKeyStrCmp<char> > CHashKeyStrChar;
typedef THashKeyStr< char, THashKeyStrCmpI<char> > CHashKeyStrCharI;
/****************************************************************************
*
* CHashValue
*
***/
class CHashValue {
private:
static const dword s_hashTable[];
dword m_result;
inline void Construct () { m_result = 0x325d1eae; }
public:
static dword LookupHashBits (unsigned value) { ASSERT(value < 0x100); return s_hashTable[value]; }
inline CHashValue () { Construct() ; }
inline CHashValue (const CHashValue & source) { m_result = source.m_result; }
inline CHashValue (const void * data, unsigned bytes) { Construct(); Hash(data, bytes); }
inline CHashValue & operator= (const CHashValue & source) { m_result = source.m_result; return *this; }
inline bool operator== (const CHashValue & source) const { return (m_result == source.m_result); }
inline dword GetHash () const { return m_result; }
__forceinline void Hash (const void * data, unsigned bytes);
__forceinline void Hash8 (unsigned data);
__forceinline void Hash16 (unsigned data);
__forceinline void Hash32 (unsigned data);
};
//===========================================================================
void CHashValue::Hash (const void * data, unsigned bytes) {
for (const byte * curr = (const byte *)data, * term = curr + bytes; curr != term; ++curr)
Hash8(*curr);
}
//===========================================================================
void CHashValue::Hash8 (unsigned data) {
m_result += s_hashTable[m_result >> 24] ^ (m_result >> 6) ^ s_hashTable[data & 0xff];
}
//===========================================================================
void CHashValue::Hash16 (unsigned data) {
Hash8(data);
Hash8(data >> 8);
}
//===========================================================================
void CHashValue::Hash32 (unsigned data) {
Hash8(data);
Hash8(data >> 8);
Hash8(data >> 16);
Hash8(data >> 24);
}

2
Sources/Plasma/NucleusLib/pnUtils/Private/pnUtMisc.h

@ -79,7 +79,7 @@ void MachineGetName (wchar * computerName, unsigned length = 32);
***/
// used to dump the internal state of a module
typedef void (__cdecl * FStateDump)(
typedef void (CDECL * FStateDump)(
void * param,
const wchar fmt[],
...

43
Sources/Plasma/NucleusLib/pnUtils/Private/pnUtRef.h

@ -35,19 +35,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTREF_H
/*****************************************************************************
*
* Debug macros
*
***/
#ifdef REFCOUNT_DEBUGGING
#define REFTRACE DEBUG_MSG
#else
#define REFTRACE NULL_STMT
#endif
/****************************************************************************
*
* AtomicRef
@ -78,7 +65,9 @@ public:
ASSERT(!zeroed);
#endif
long prev = AtomicAdd(&m_ref, 1);
REFTRACE("Inc %p: %u", this, prev+1);
#ifdef REFCOUNT_DEBUGGING
DEBUG_MSG("Inc %p: %u", this, prev+1);
#endif
return prev+1;
}
inline long IncRef (const char tag[]) {
@ -86,7 +75,9 @@ public:
ASSERT(!zeroed);
#endif
long prev = AtomicAdd(&m_ref, 1);
REFTRACE("Inc %p %s: %u", this, tag, prev+1);
#ifdef REFCOUNT_DEBUGGING
DEBUG_MSG("Inc %p %s: %u", this, tag, prev+1);
#endif
return prev+1;
}
inline long IncRef (unsigned n) {
@ -94,7 +85,9 @@ public:
ASSERT(!zeroed);
#endif
long prev = AtomicAdd(&m_ref, n);
REFTRACE("Inc %p: %u", this, prev+n);
#ifdef REFCOUNT_DEBUGGING
DEBUG_MSG("Inc %p: %u", this, prev+n);
#endif
return prev+n;
}
inline long IncRef (unsigned n, const char tag[]) {
@ -102,7 +95,9 @@ public:
ASSERT(!zeroed);
#endif
long prev = AtomicAdd(&m_ref, n);
REFTRACE("Inc %p %s: %u", this, tag, prev+n);
#ifdef REFCOUNT_DEBUGGING
DEBUG_MSG("Inc %p %s: %u", this, tag, prev+n);
#endif
return prev+n;
}
@ -117,7 +112,9 @@ public:
#endif
OnZeroRef();
}
REFTRACE("Dec %p: %u", this, prev-1);
#ifdef REFCOUNT_DEBUGGING
DEBUG_MSG("Dec %p: %u", this, prev-1);
#endif
return prev-1;
}
inline long DecRef (const char tag[]) {
@ -131,7 +128,9 @@ public:
#endif
OnZeroRef();
}
REFTRACE("Dec %p %s: %u", this, tag, prev-1);
#ifdef REFCOUNT_DEBUGGING
DEBUG_MSG("Dec %p %s: %u", this, tag, prev-1);
#endif
return prev-1;
}
@ -142,8 +141,10 @@ public:
#ifdef HS_DEBUGGING
ASSERT(!zeroed);
#endif
REFTRACE("Inc %p %s: (xfer)", this, newTag);
REFTRACE("Dec %p %s: (xfer)", this, oldTag);
#ifdef REFCOUNT_DEBUGGING
DEBUG_MSG("Inc %p %s: (xfer)", this, newTag);
DEBUG_MSG("Dec %p %s: (xfer)", this, oldTag);
#endif
}
inline unsigned GetRefCount () {

4
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()
@ -546,4 +546,4 @@ bool plAgeDescription::FindLocation(const plLocation& loc) const
return true;
}
return false;
}
}

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;

1
Sources/Plasma/PubUtilLib/plEncryption/plChecksum.cpp

@ -26,6 +26,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plChecksum.h"
#include "hsStream.h"
#include <cstring>
plChecksum::plChecksum(unsigned int bufsize, const char* buffer)
{

2
Sources/Plasma/PubUtilLib/plFile/hsFiles.cpp

@ -133,7 +133,7 @@ hsBool hsFolderIterator::NextFileSuffix(const char suffix[])
{
while (this->NextFile())
{ const char* fileSuffix = ::strrchr(this->GetFileName(), '.');
if (fileSuffix != nil && ::_stricmp(fileSuffix, suffix) == 0)
if (fileSuffix != nil && stricmp(fileSuffix, suffix) == 0)
return true;
}
return false;

4
Sources/Plasma/PubUtilLib/plFile/plEncryptedStream.cpp

@ -114,7 +114,7 @@ hsBool plEncryptedStream::Open(const wchar* name, const wchar* mode)
{
if (wcscmp(mode, L"rb") == 0)
{
fRef = _wfopen(name, mode);
fRef = hsWFopen(name, mode);
fPosition = 0;
if (!fRef)
@ -515,7 +515,7 @@ bool plEncryptedStream::IsEncryptedFile(const char* fileName)
bool plEncryptedStream::IsEncryptedFile(const wchar* fileName)
{
FILE* fp = _wfopen(fileName, L"rb");
FILE* fp = hsWFopen(fileName, L"rb");
if (!fp)
return false;

4
Sources/Plasma/PubUtilLib/plFile/plFileUtils.cpp

@ -206,7 +206,7 @@ bool plFileUtils::FileMove(const wchar* existingFile, const wchar* newFile)
bool plFileUtils::FileExists(const wchar* file)
{
FILE* fp = _wfopen(file, L"rb");
FILE* fp = hsWFopen(file, L"rb");
bool retVal = (fp != nil);
if (fp)
fclose(fp);
@ -502,4 +502,4 @@ bool plFileUtils::GetSecureEncryptionKey(const wchar* filename, UInt32* key, uns
return false;
}
}
}

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

4
Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.cpp

@ -692,11 +692,11 @@ bool plNetServerSessionInfo::IsEqualTo(const plNetServerSessionInfo * other) con
if (match && IsFlagSet(kHasServerGuid) && other->IsFlagSet(kHasServerGuid))
match = match && fServerGuid.IsEqualTo(other->GetServerGuid());
if (match && IsFlagSet(kHasServerName) && other->IsFlagSet(kHasServerName))
match = match && (_stricmp(fServerName.c_str(),other->fServerName.c_str())==0);
match = match && (stricmp(fServerName.c_str(),other->fServerName.c_str())==0);
if (match && IsFlagSet(kHasServerType) && other->IsFlagSet(kHasServerType))
match = match && fServerType==other->fServerType;
if (match && IsFlagSet(kHasServerAddr) && other->IsFlagSet(kHasServerAddr))
match = match && (_stricmp(fServerAddr.c_str(),other->fServerAddr.c_str())==0);
match = match && (stricmp(fServerAddr.c_str(),other->fServerAddr.c_str())==0);
if (match && IsFlagSet(kHasServerPort) && other->IsFlagSet(kHasServerPort))
match = match && fServerPort==other->fServerPort;
return match;

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();

2
Sources/Plasma/PubUtilLib/plResMgr/plKeyFinder.cpp

@ -88,7 +88,7 @@ hsBool NameMatches(const char* obName, const char* pKName, hsBool subString)
if (!subString)
{
if (!_stricmp(o, p))
if (!stricmp(o, p))
return true; // FOUND IT!!!!!!!!!!!!!!!!!!!
}
else

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]; }

3
Sources/Plasma/PubUtilLib/plResMgr/plResManager.cpp

@ -298,7 +298,8 @@ hsBool plResManager::ReadObject(plKeyImp* key)
// it will just inc/dec the open/close count during its read, and not actually
// close the stream, so we don't lose our place, lose our file handle, and thrash.
kResMgrLog(4, ILog(4, " ...Opening page data stream for location 0x%x...", key->GetUoid().GetLocation()));
char locstr[64];
kResMgrLog(4, ILog(4, " ...Opening page data stream for location %s...", key->GetUoid().GetLocation().StringIze(locstr)));
plRegistryPageNode *pageNode = FindPage(key->GetUoid().GetLocation());
if (!pageNode)
{

1
Sources/Plasma/PubUtilLib/plResMgr/plResManager.h

@ -30,6 +30,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include <set>
#include <map>
#include <vector>
#include <string>
class plRegistryPageNode;
class plRegistryKeyIterator;

1
Sources/Plasma/PubUtilLib/plResMgr/plVersion.cpp

@ -26,6 +26,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plVersion.h"
#include "pnFactory/plFactory.h"
#include <vector>
#include <cstring>
#include "plCreatableIndex.h"
#define ChangedCreatable(ver, creatable) if (minorVersion == ver) creatables.push_back(CLASS_INDEX_SCOPED(creatable));

2
Sources/Plasma/PubUtilLib/plSDL/plSDLMgr.cpp

@ -100,7 +100,7 @@ plStateDescriptor* plSDLMgr::FindDescriptor(const char* name, int version, const
int highestFound = -1;
for(it=(*dl).begin(); it!= (*dl).end(); it++)
{
if (!_stricmp((*it)->GetName(), name) )
if (!stricmp((*it)->GetName(), name) )
{
if ( (*it)->GetVersion()==version )
{

16
Sources/Plasma/PubUtilLib/plScene/plVisMgr.cpp

@ -60,13 +60,13 @@ void plVisMgr::Write(hsStream* s, hsResMgr* mgr)
hsKeyedObject::Write(s, mgr);
}
void plVisMgr::Register(plVisRegion* reg, hsBool not)
void plVisMgr::Register(plVisRegion* reg, hsBool bnot)
{
// This should happen pretty infrequently, or
// I wouldn't be doing it so cloth-headed-ly.
hsTArray<plVisRegion*>& regions = not ? fNotRegions : fRegions;
hsBitVector& indices = not ? fIdxNot : fIdxSet;
int& maxIdx = not ? fMaxNot : fMaxSet;
hsTArray<plVisRegion*>& regions = bnot ? fNotRegions : fRegions;
hsBitVector& indices = bnot ? fIdxNot : fIdxSet;
int& maxIdx = bnot ? fMaxNot : fMaxSet;
int i;
for( i = kNumReserved; ; i++ )
{
@ -84,14 +84,14 @@ void plVisMgr::Register(plVisRegion* reg, hsBool not)
hsAssert(false, "Infinite bitvector has all bits set?");
}
void plVisMgr::UnRegister(plVisRegion* reg, hsBool not)
void plVisMgr::UnRegister(plVisRegion* reg, hsBool bnot)
{
// Mark our index for recycling
hsBitVector& indices= not ? fIdxNot : fIdxSet;
hsBitVector& indices= bnot ? fIdxNot : fIdxSet;
indices.ClearBit(reg->GetIndex());
// Nuke the region from our list.
hsTArray<plVisRegion*>& regions = not ? fNotRegions : fRegions;
hsTArray<plVisRegion*>& regions = bnot ? fNotRegions : fRegions;
int idx = regions.Find(reg);
if( regions.kMissingIndex != idx )
regions.Remove(idx);
@ -204,4 +204,4 @@ void plGlobalVisMgr::DeInit()
fInstance->UnRegisterAs(kGlobalVisMgr_KEY);
fInstance = nil;
}
}
}

4
Sources/Plasma/PubUtilLib/plScene/plVisMgr.h

@ -82,8 +82,8 @@ public:
virtual void Read(hsStream* stream, hsResMgr* mgr);
virtual void Write(hsStream* stream, hsResMgr* mgr);
void Register(plVisRegion* reg, hsBool not);
void UnRegister(plVisRegion* reg, hsBool not);
void Register(plVisRegion* reg, hsBool bnot);
void UnRegister(plVisRegion* reg, hsBool bnot);
void Eval(const hsPoint3& pos);

2
Sources/Plasma/PubUtilLib/plUnifiedTime/plUnifiedTime.cpp

@ -497,7 +497,7 @@ namespace pvt_strptime
#define match_char(ch1, ch2) if (ch1 != ch2) return NULL
#define match_string(cs1, s2) \
(_strnicmp((cs1), (s2), strlen (cs1)) ? 0 : ((s2) += strlen (cs1), 1))
(strnicmp((cs1), (s2), strlen (cs1)) ? 0 : ((s2) += strlen (cs1), 1))
#define get_number(from, to, n) \
do { \
int __n = n; \

Loading…
Cancel
Save