Browse Source

String function fixes for mingw.

Darryl Pogue 13 years ago
parent
commit
ee23f01736
  1. 1
      Sources/Plasma/PubUtilLib/plEncryption/plChecksum.cpp
  2. 2
      Sources/Plasma/PubUtilLib/plFile/hsFiles.cpp
  3. 4
      Sources/Plasma/PubUtilLib/plFile/plEncryptedStream.cpp
  4. 4
      Sources/Plasma/PubUtilLib/plFile/plFileUtils.cpp
  5. 4
      Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.cpp
  6. 2
      Sources/Plasma/PubUtilLib/plResMgr/plKeyFinder.cpp
  7. 3
      Sources/Plasma/PubUtilLib/plResMgr/plResManager.cpp
  8. 1
      Sources/Plasma/PubUtilLib/plResMgr/plResManager.h
  9. 1
      Sources/Plasma/PubUtilLib/plResMgr/plVersion.cpp
  10. 2
      Sources/Plasma/PubUtilLib/plSDL/plSDLMgr.cpp
  11. 2
      Sources/Plasma/PubUtilLib/plUnifiedTime/plUnifiedTime.cpp

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

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/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

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 )
{

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