Browse Source

String function fixes for mingw.

Darryl Pogue 14 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. 2
      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 "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)
{ {

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

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

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

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

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

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

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

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

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 <set>
#include <map> #include <map>
#include <vector> #include <vector>
#include <string>
class plRegistryPageNode; class plRegistryPageNode;
class plRegistryKeyIterator; 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 "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));

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

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

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_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; \

Loading…
Cancel
Save