# HG changeset patch # User jld # Date 1043075531 0 # Node ID 2b2d9aa25330b16eaddc4def6be9ce0a3021f175 # Parent 36f23a5139529ab25928b155a1ad300c5ab519cb * standalone/wxwin/configtooldoc.cpp: Use wxString::GetChar() rather than array element. * standalone/wxwin/filename.cpp: Use wxString::GetChar() and SetChar() rather than array element. Add some explicit casts to allow building with GNU/Cygwin tools. Use MAX_PATH rather than _MAX_PATH for portability. * standalone/wxwin/ecutils.cpp: Call wxNewKill() rather than wKill() for Cygsin builds. * standalone/wxwin/ecutils.h: Use wxLongLong_t rather than __int64 for portability. diff --git a/host/tools/configtool/ChangeLog b/host/tools/configtool/ChangeLog --- a/host/tools/configtool/ChangeLog +++ b/host/tools/configtool/ChangeLog @@ -1,3 +1,20 @@ +2002-01-20 John Dallaway + + * standalone/wxwin/configtooldoc.cpp: + Use wxString::GetChar() rather than an array element. + + * standalone/wxwin/filename.cpp: + Use wxString::GetChar() and wxString::SetChar rather than an array + element. + Add some explicit casts to allow building with GNU tools on Cygwin. + Use MAX_PATH rather than _MAX_PATH for portability. + + * standalone/wxwin/ecutils.cpp: + Call wxNewKill() rather than wxKill() for Cygwin builds. + + * standalone/wxwin/ecutils.h: + Use wxLongLong_t rather than __int64 for portability. + 2003-01-17 John Dallaway * standalone/wxwin/makefile.gnu: New makefile for GNU tools diff --git a/host/tools/configtool/standalone/wxwin/configtooldoc.cpp b/host/tools/configtool/standalone/wxwin/configtooldoc.cpp --- a/host/tools/configtool/standalone/wxwin/configtooldoc.cpp +++ b/host/tools/configtool/standalone/wxwin/configtooldoc.cpp @@ -1195,7 +1195,7 @@ wxString ecConfigToolDoc::GetDefaultHard bool bMore = config.GetFirstGroup(key, index); while (bMore) { - if (wxIsdigit(key[0]) && versionKey.CompareTo(key) < 0) + if (wxIsdigit(key.GetChar(0)) && versionKey.CompareTo(key) < 0) versionKey = key; bMore = config.GetNextGroup(key, index); diff --git a/host/tools/configtool/standalone/wxwin/ecutils.cpp b/host/tools/configtool/standalone/wxwin/ecutils.cpp --- a/host/tools/configtool/standalone/wxwin/ecutils.cpp +++ b/host/tools/configtool/standalone/wxwin/ecutils.cpp @@ -1223,7 +1223,7 @@ int wxNewKill(long pid, wxSignal sig, ec int ecKill(long pid, wxSignal sig) { -#ifdef __UNIX__ +#if defined(__UNIX__) && !defined(__CYGWIN__) return wxKill(pid, sig); #elif defined(__WXMSW__) return wxNewKill(pid, sig); diff --git a/host/tools/configtool/standalone/wxwin/ecutils.h b/host/tools/configtool/standalone/wxwin/ecutils.h --- a/host/tools/configtool/standalone/wxwin/ecutils.h +++ b/host/tools/configtool/standalone/wxwin/ecutils.h @@ -251,7 +251,7 @@ protected: struct wxPInfo { wxPInfo *pParent; #ifdef _WIN32 - __int64 tCreation; + wxLongLong_t tCreation; #endif long tCpu; int PID; diff --git a/host/tools/configtool/standalone/wxwin/filename.cpp b/host/tools/configtool/standalone/wxwin/filename.cpp --- a/host/tools/configtool/standalone/wxwin/filename.cpp +++ b/host/tools/configtool/standalone/wxwin/filename.cpp @@ -40,8 +40,8 @@ #include "filename.h" #ifdef __WXMSW__ -#include -#include +//#include +//#include #include #include @@ -446,9 +446,9 @@ ecFileName ecFileName::Relative(const wx { #ifdef __WXMSW__ wxString rc; - bool b=(TRUE==PathRelativePathTo(rc.GetWriteBuf(1+MAX_PATH),current,FILE_ATTRIBUTE_DIRECTORY,compare,0)); + bool b=(TRUE==PathRelativePathTo(rc.GetWriteBuf(1+MAX_PATH),current,FILE_ATTRIBUTE_DIRECTORY,(const WCHAR*)compare,0)); rc.UngetWriteBuf(); - return b?rc:compare; + return b?(ecFileName)rc:(ecFileName)compare; #else wxFAIL_MSG("ecFileName::Relative not implemented on this platform."); return ecFileName(); @@ -529,9 +529,9 @@ ecFileName ecFileName::GetTempPath() ecFileName f; #ifdef __WXMSW__ #ifdef _UNICODE - ::GetTempPathW(1+_MAX_PATH,f.GetWriteBuf(1+_MAX_PATH)); + ::GetTempPathW(1+MAX_PATH,f.GetWriteBuf(1+MAX_PATH)); #else - ::GetTempPathA(1+_MAX_PATH,f.GetWriteBuf(1+_MAX_PATH)); + ::GetTempPathA(1+MAX_PATH,f.GetWriteBuf(1+MAX_PATH)); #endif f.UngetWriteBuf(); #elif defined(__WXGTK__) @@ -579,12 +579,12 @@ bool ecFileName::CreateDirectory(bool bP #ifdef __WXMSW__ // If the path is a network path, ignore the first part of the path - if (len > 2 && (rest[0] == wxT('\\') || rest[0] == wxT('/')) && (rest[1] == wxT('\\') || rest[1] == wxT('/'))) + if (len > 2 && (rest.GetChar(0) == wxT('\\') || rest.GetChar(0) == wxT('/')) && (rest.GetChar(1) == wxT('\\') || rest.GetChar(1) == wxT('/'))) { - rest[(size_t) 0] = wxT('_'); rest[(size_t) 1] = wxT('_'); + rest.SetChar(0,wxT('_')); rest.SetChar(1,wxT('_')); lastPos = rest.Find(cSep); if (lastPos != -1 && lastPos >= 0) - rest[lastPos] = wxT('_'); + rest.SetChar(lastPos,wxT('_')); } #endif