diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/CoreLib/hsUtils.h b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/CoreLib/hsUtils.h index e657298b..208ca2b0 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/CoreLib/hsUtils.h +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/CoreLib/hsUtils.h @@ -44,6 +44,19 @@ void hsStrLower(char *s); char * hsFormatStr(const char * fmt, ...); // You are responsible for returned memory. 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 +#else +#define stricmp strcasecmp +#define strnicmp strncasecmp +#define wcsicmp wcscasecmp +#define wcsnicmp wcsncasecmp +#endif + // A pstring has a length byte at the beginning, and no trailing 0 char* hsP2CString(const UInt8 pstring[], char cstring[]); diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfGameMgr/BlueSpiral/pfGmBlueSpiral.cpp b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfGameMgr/BlueSpiral/pfGmBlueSpiral.cpp index b41bcf98..7a21fc1f 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfGameMgr/BlueSpiral/pfGmBlueSpiral.cpp +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfGameMgr/BlueSpiral/pfGmBlueSpiral.cpp @@ -253,7 +253,7 @@ void pfGmBlueSpiral::HitCloth (int clothNum) { msg.messageBytes = sizeof(msg); msg.recvGameId = GetGameId(); // send to GameSrv on server msg.transId = 0; - msg.clothNum = clothNum; + msg.clothNum = (byte)clothNum; GameMgrSend(&msg); } diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp index 45eaf29d..acb5a369 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp @@ -1247,7 +1247,7 @@ hsBool plPythonFileMod::MsgReceive(plMessage* msg) if (pNtfyMsg) { // remember if this was a Local Broad cast or not - fLocalNotify = (pNtfyMsg->HasBCastFlag(plMessage ::plBCastFlags::kNetNonLocal)) ? false : true; + fLocalNotify = (pNtfyMsg->HasBCastFlag(plMessage::kNetNonLocal)) ? false : true; // create a list for the event records PyObject* levents = PyList_New(0); // start with a list of no elements diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfPython/pyDynamicTextGlue.cpp b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfPython/pyDynamicTextGlue.cpp index a73124ff..3049e3eb 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfPython/pyDynamicTextGlue.cpp +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfPython/pyDynamicTextGlue.cpp @@ -471,8 +471,8 @@ void pyDynamicText::AddPlasmaClasses(PyObject *m) void pyDynamicText::AddPlasmaConstantsClasses(PyObject *m) { PYTHON_ENUM_START(PtJustify); - PYTHON_ENUM_ELEMENT(PtJustify, kCenter, plDynamicTextMap::Justify::kCenter); - PYTHON_ENUM_ELEMENT(PtJustify, kLeftJustify, plDynamicTextMap::Justify::kLeftJustify); - PYTHON_ENUM_ELEMENT(PtJustify, kRightJustify, plDynamicTextMap::Justify::kRightJustify); + PYTHON_ENUM_ELEMENT(PtJustify, kCenter, plDynamicTextMap::kCenter); + PYTHON_ENUM_ELEMENT(PtJustify, kLeftJustify, plDynamicTextMap::kLeftJustify); + PYTHON_ENUM_ELEMENT(PtJustify, kRightJustify, plDynamicTextMap::kRightJustify); PYTHON_ENUM_END(m, PtJustify); } \ No newline at end of file diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBox.cpp b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBox.cpp index aa275cec..694e8afe 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBox.cpp +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBox.cpp @@ -232,8 +232,9 @@ class pfColorListElement : public pfGUIListText wchar_t* thestring; if ( fString1 && fString2 ) { - thestring = TRACKED_NEW wchar_t[ wcslen( fString1 ) + wcslen( fString2 ) + 3 ]; - swprintf( thestring, L"%s %s", fString1, fString2 ); + size_t length = wcslen( fString1 ) + wcslen( fString2 ) + 3; + thestring = TRACKED_NEW wchar_t[ length ]; + swprintf( thestring, length, L"%s %s", fString1, fString2 ); wemade_string = true; } else if (fString1) diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfPython/pyImage.cpp b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfPython/pyImage.cpp index bc4d821f..07feda3a 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfPython/pyImage.cpp +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfPython/pyImage.cpp @@ -169,7 +169,7 @@ PyObject* pyImage::LoadJPEGFromDisk(const wchar* filename, UInt16 width, UInt16 { if (width > 0 && height > 0) { - if (!theMipmap->ResizeNicely(width, height, plMipmap::ScaleFilter::kDefaultFilter)) + if (!theMipmap->ResizeNicely(width, height, plMipmap::kDefaultFilter)) { delete theMipmap; PYTHON_RETURN_NONE;