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 "plChecksum.h"
|
||||||
#include "hsStream.h"
|
#include "hsStream.h"
|
||||||
|
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
plChecksum::plChecksum(unsigned int bufsize, const char* buffer)
|
plChecksum::plChecksum(unsigned int bufsize, const char* buffer)
|
||||||
{
|
{
|
||||||
|
@ -133,7 +133,7 @@ hsBool hsFolderIterator::NextFileSuffix(const char suffix[])
|
|||||||
{
|
{
|
||||||
while (this->NextFile())
|
while (this->NextFile())
|
||||||
{ const char* fileSuffix = ::strrchr(this->GetFileName(), '.');
|
{ const char* fileSuffix = ::strrchr(this->GetFileName(), '.');
|
||||||
if (fileSuffix != nil && ::_stricmp(fileSuffix, suffix) == 0)
|
if (fileSuffix != nil && stricmp(fileSuffix, suffix) == 0)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -114,7 +114,7 @@ hsBool plEncryptedStream::Open(const wchar* name, const wchar* mode)
|
|||||||
{
|
{
|
||||||
if (wcscmp(mode, L"rb") == 0)
|
if (wcscmp(mode, L"rb") == 0)
|
||||||
{
|
{
|
||||||
fRef = _wfopen(name, mode);
|
fRef = hsWFopen(name, mode);
|
||||||
fPosition = 0;
|
fPosition = 0;
|
||||||
|
|
||||||
if (!fRef)
|
if (!fRef)
|
||||||
@ -515,7 +515,7 @@ bool plEncryptedStream::IsEncryptedFile(const char* fileName)
|
|||||||
|
|
||||||
bool plEncryptedStream::IsEncryptedFile(const wchar* fileName)
|
bool plEncryptedStream::IsEncryptedFile(const wchar* fileName)
|
||||||
{
|
{
|
||||||
FILE* fp = _wfopen(fileName, L"rb");
|
FILE* fp = hsWFopen(fileName, L"rb");
|
||||||
if (!fp)
|
if (!fp)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -206,7 +206,7 @@ bool plFileUtils::FileMove(const wchar* existingFile, const wchar* newFile)
|
|||||||
|
|
||||||
bool plFileUtils::FileExists(const wchar* file)
|
bool plFileUtils::FileExists(const wchar* file)
|
||||||
{
|
{
|
||||||
FILE* fp = _wfopen(file, L"rb");
|
FILE* fp = hsWFopen(file, L"rb");
|
||||||
bool retVal = (fp != nil);
|
bool retVal = (fp != nil);
|
||||||
if (fp)
|
if (fp)
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
@ -502,4 +502,4 @@ bool plFileUtils::GetSecureEncryptionKey(const wchar* filename, UInt32* key, uns
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -692,11 +692,11 @@ bool plNetServerSessionInfo::IsEqualTo(const plNetServerSessionInfo * other) con
|
|||||||
if (match && IsFlagSet(kHasServerGuid) && other->IsFlagSet(kHasServerGuid))
|
if (match && IsFlagSet(kHasServerGuid) && other->IsFlagSet(kHasServerGuid))
|
||||||
match = match && fServerGuid.IsEqualTo(other->GetServerGuid());
|
match = match && fServerGuid.IsEqualTo(other->GetServerGuid());
|
||||||
if (match && IsFlagSet(kHasServerName) && other->IsFlagSet(kHasServerName))
|
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))
|
if (match && IsFlagSet(kHasServerType) && other->IsFlagSet(kHasServerType))
|
||||||
match = match && fServerType==other->fServerType;
|
match = match && fServerType==other->fServerType;
|
||||||
if (match && IsFlagSet(kHasServerAddr) && other->IsFlagSet(kHasServerAddr))
|
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))
|
if (match && IsFlagSet(kHasServerPort) && other->IsFlagSet(kHasServerPort))
|
||||||
match = match && fServerPort==other->fServerPort;
|
match = match && fServerPort==other->fServerPort;
|
||||||
return match;
|
return match;
|
||||||
|
@ -88,7 +88,7 @@ hsBool NameMatches(const char* obName, const char* pKName, hsBool subString)
|
|||||||
|
|
||||||
if (!subString)
|
if (!subString)
|
||||||
{
|
{
|
||||||
if (!_stricmp(o, p))
|
if (!stricmp(o, p))
|
||||||
return true; // FOUND IT!!!!!!!!!!!!!!!!!!!
|
return true; // FOUND IT!!!!!!!!!!!!!!!!!!!
|
||||||
}
|
}
|
||||||
else
|
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
|
// 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.
|
// 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());
|
plRegistryPageNode *pageNode = FindPage(key->GetUoid().GetLocation());
|
||||||
if (!pageNode)
|
if (!pageNode)
|
||||||
{
|
{
|
||||||
|
@ -30,6 +30,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
|||||||
#include <set>
|
#include <set>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
class plRegistryPageNode;
|
class plRegistryPageNode;
|
||||||
class plRegistryKeyIterator;
|
class plRegistryKeyIterator;
|
||||||
|
@ -26,6 +26,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
|||||||
#include "plVersion.h"
|
#include "plVersion.h"
|
||||||
#include "pnFactory/plFactory.h"
|
#include "pnFactory/plFactory.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
#include "plCreatableIndex.h"
|
#include "plCreatableIndex.h"
|
||||||
#define ChangedCreatable(ver, creatable) if (minorVersion == ver) creatables.push_back(CLASS_INDEX_SCOPED(creatable));
|
#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;
|
int highestFound = -1;
|
||||||
for(it=(*dl).begin(); it!= (*dl).end(); it++)
|
for(it=(*dl).begin(); it!= (*dl).end(); it++)
|
||||||
{
|
{
|
||||||
if (!_stricmp((*it)->GetName(), name) )
|
if (!stricmp((*it)->GetName(), name) )
|
||||||
{
|
{
|
||||||
if ( (*it)->GetVersion()==version )
|
if ( (*it)->GetVersion()==version )
|
||||||
{
|
{
|
||||||
|
@ -497,7 +497,7 @@ namespace pvt_strptime
|
|||||||
|
|
||||||
#define match_char(ch1, ch2) if (ch1 != ch2) return NULL
|
#define match_char(ch1, ch2) if (ch1 != ch2) return NULL
|
||||||
#define match_string(cs1, s2) \
|
#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) \
|
#define get_number(from, to, n) \
|
||||||
do { \
|
do { \
|
||||||
int __n = n; \
|
int __n = n; \
|
||||||
|
Reference in New Issue
Block a user