mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-14 02:27:40 -04:00
String function fixes for mingw.
This commit is contained in:
@ -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)
|
||||
{
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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;
|
||||
|
@ -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));
|
||||
|
@ -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 )
|
||||
{
|
||||
|
@ -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; \
|
||||
|
Reference in New Issue
Block a user