changeset 517:2b2d9aa25330

* 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.
author jld
date Mon, 20 Jan 2003 15:12:11 +0000
parents 36f23a513952
children 94f334d9be6e
files host/tools/configtool/ChangeLog host/tools/configtool/standalone/wxwin/configtooldoc.cpp host/tools/configtool/standalone/wxwin/ecutils.cpp host/tools/configtool/standalone/wxwin/ecutils.h host/tools/configtool/standalone/wxwin/filename.cpp
diffstat 5 files changed, 29 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/host/tools/configtool/ChangeLog
+++ b/host/tools/configtool/ChangeLog
@@ -1,3 +1,20 @@
+2002-01-20  John Dallaway  <jld@ecoscentric.com>
+
+	* 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  <jld@ecoscentric.com>
 
 	* standalone/wxwin/makefile.gnu: New makefile for GNU tools
--- 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);
--- 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);
--- 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;
--- 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 <direct.h>
-#include <dos.h>
+//#include <direct.h>
+//#include <dos.h>
 
 #include <windows.h>
 #include <shlwapi.h>
@@ -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