From 9dea36ef6d117e0562f0079345a77ff1696d3a49 Mon Sep 17 00:00:00 2001 From: David Webster Date: Tue, 14 Dec 1999 23:32:53 +0000 Subject: [PATCH] Visualage C++ V4.0 updates git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4946 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/expr.h | 3 +++ include/wx/strconv.h | 3 +++ include/wx/string.h | 21 +++++++++++++++------ include/wx/wxchar.h | 42 +++++++++++++++++++++++++++++++++++++++++- src/os2/app.cpp | 10 +++++++--- src/os2/dcprint.cpp | 6 +++--- src/os2/font.cpp | 2 +- src/os2/gsocket.c | 9 ++++++++- src/os2/iniconf.cpp | 10 +++++----- src/os2/mdi.cpp | 2 +- src/os2/nativdlg.cpp | 2 +- src/os2/pen.cpp | 2 +- src/os2/textctrl.cpp | 8 +++++--- src/os2/utils.cpp | 20 ++++++++++---------- src/os2/utilsexc.cpp | 6 +++--- src/os2/wave.cpp | 19 ++++++++++++------- src/os2/window.cpp | 4 ++-- src/xpm/scan.c | 2 +- 18 files changed, 122 insertions(+), 49 deletions(-) diff --git a/include/wx/expr.h b/include/wx/expr.h index e964fd4e8c..52f45b9196 100644 --- a/include/wx/expr.h +++ b/include/wx/expr.h @@ -13,6 +13,9 @@ #define _WX_EXPRH__ #include +#if defined(__VISAGECPP__) && __IBMCPP__ >= 400 +# undef __BSEXCPT__ +#endif #include #ifdef ____HPUX__ diff --git a/include/wx/strconv.h b/include/wx/strconv.h index 2b76ae9859..fa3e22c42d 100644 --- a/include/wx/strconv.h +++ b/include/wx/strconv.h @@ -20,6 +20,9 @@ #include "wx/wxchar.h" #include "wx/buffer.h" +#if defined(__VISAGECPP__) && __IBMCPP__ >= 400 +# undef __BSEXCPT__ +#endif #include #if wxUSE_WCHAR_T diff --git a/include/wx/string.h b/include/wx/string.h index a47ca920c5..1bd7e000b2 100644 --- a/include/wx/string.h +++ b/include/wx/string.h @@ -38,7 +38,7 @@ // headers // ---------------------------------------------------------------------------- -#ifdef __WXMAC__ +#if defined(__WXMAC__) || defined(__VISAGECPP__) #include #endif @@ -46,11 +46,20 @@ #include #endif -#include -#include -#include -#include -#include +#if defined(__VISAGECPP__) && __IBMCPP__ >= 400 + // problem in VACPP V4 with including stdlib.h multiple times + // strconv includes it anyway +# include +# include +# include +# include +#else +# include +# include +# include +# include +# include +#endif #ifdef HAVE_STRINGS_H #include // for strcasecmp() diff --git a/include/wx/wxchar.h b/include/wx/wxchar.h index 53ff323588..b431806a44 100644 --- a/include/wx/wxchar.h +++ b/include/wx/wxchar.h @@ -61,6 +61,44 @@ #define wxNO_TCHAR_STDIO #define wxNO_TCHAR_STDLIB #define wxNO_TCHAR_TIME + #define wxNO_TCHAR_LOCALE + // + // supplemental VA V4 defs so at least we know what these are + // just define to standard defs + // + + // for wcslen + #include + + // locale.h functons -- not defined in tchar.h + #define wxSetlocale setlocale + // some stdio functions are defined others are not + // these are not + #define wxFgetchar fgetchar + #define wxFopen fopen + #define wxFputchar fputchar + #define wxFreopen freopen + #define wxGets gets + #define wxPerror perror + #define wxPuts puts + #define wxRemove remove + #define wxRename rename + #define wxTmpnam tmpnam + #define wxUngetc ungetc + #define wxVsscanf vsscanf + // stdlib not defined in VA V4 + #if !wxUSE_UNICODE + # define wxAtof atof + #endif + #define wxAtoi atoi + #define wxAtol atol + #define wxGetenv getenv + #define wxSystem system + // time.h functions -- none defined in tchar.h + #define wxAsctime asctime + #define wxCtime ctime + + #endif #ifdef wxHAVE_TCHAR_FUNCTIONS @@ -157,7 +195,7 @@ typedef _TUCHAR wxUChar; # define wxVprintf _vtprintf # define wxVsscanf _vstscanf # define wxVsprintf _vstprintf -#elif defined(__VISAGECPP__) +#elif defined(__VISAGECPP__) && (__IBMCPP__ >= 400) // it has some stdio.h functions, apparently # define wxFgetc _fgettc # define wxFgets _fgetts @@ -215,6 +253,8 @@ typedef _TUCHAR wxUChar; # define wxUSE_WCHAR_T 0 # elif defined(__WATCOMC__) # define wxUSE_WCHAR_T 0 +# elif defined(__VISAGECPP__) && (__IBMCPP__ >= 400) +# define wxUSE_WCHAR_T 1 # else // add additional compiler checks if this fails # define wxUSE_WCHAR_T 1 diff --git a/src/os2/app.cpp b/src/os2/app.cpp index 72c419454c..ee11aa649b 100644 --- a/src/os2/app.cpp +++ b/src/os2/app.cpp @@ -93,7 +93,11 @@ HICON wxDEFAULT_MDIPARENTFRAME_ICON = (HICON) NULL; HBRUSH wxDisableButtonBrush = (HBRUSH) 0; -MRESULT wxWndProc(HWND, UINT, MPARAM, MPARAM); +MRESULT wxWndProc( HWND + ,ULONG + ,MPARAM + ,MPARAM + ); // =========================================================================== // implementation @@ -399,7 +403,7 @@ int wxEntry( , char* argv[] ) { - HAB vHab; + HAB vHab = 0; if (!wxApp::Initialize(vHab)) return 0; @@ -874,7 +878,7 @@ void wxExit() // Yield to incoming messages bool wxYield() { - HAB vHab; + HAB vHab = 0; QMSG vMsg; // We want to go back to the main message loop // if we see a WM_QUIT. (?) diff --git a/src/os2/dcprint.cpp b/src/os2/dcprint.cpp index d6e1ee7922..eaff967696 100644 --- a/src/os2/dcprint.cpp +++ b/src/os2/dcprint.cpp @@ -35,8 +35,8 @@ IMPLEMENT_CLASS(wxPrinterDC, wxDC) // This form is deprecated wxPrinterDC::wxPrinterDC(const wxString& driver_name, const wxString& device_name, const wxString& file, bool interactive, int orientation) { - LONG lType; - HAB hab; + LONG lType = 0; + HAB hab = 0; DEVOPENSTRUC devOpen = { (char*)device_name.c_str() ,(char*)driver_name.c_str() ,NULL @@ -284,7 +284,7 @@ static bool wxGetDefaultDeviceName(wxString& deviceName, wxString& portName) // Gets an HDC for the specified printer configuration WXHDC WXDLLEXPORT wxGetPrinterDC(const wxPrintData& printDataConst) { - HDC hDC; + HDC hDC = NULLHANDLE; /* wxPrintData printData = printDataConst; printData.ConvertToNative(); diff --git a/src/os2/font.cpp b/src/os2/font.cpp index c205ca28bb..90094e4221 100644 --- a/src/os2/font.cpp +++ b/src/os2/font.cpp @@ -387,7 +387,7 @@ bool wxFont::RealizeResource() } // TODO: -WXHFONT hFont; +WXHFONT hFont = 0; // HFONT hFont = ::CreateFont // ( // nHeight, // height diff --git a/src/os2/gsocket.c b/src/os2/gsocket.c index cccf54e433..0ea14036b8 100644 --- a/src/os2/gsocket.c +++ b/src/os2/gsocket.c @@ -11,7 +11,7 @@ #if wxUSE_SOCKETS -#define BSD_SELECT // use Berkley Sockets select +#define BSD_SELECT /* use Berkley Sockets select */ #include #include @@ -28,6 +28,13 @@ #include #include #include +#define select(a,b,c,d,e) bsdselect(a,b,c,d,e) +int _System bsdselect(int, + struct fd_set *, + struct fd_set *, + struct fd_set *, + struct timeval *); +int _System soclose(int); #endif #include diff --git a/src/os2/iniconf.cpp b/src/os2/iniconf.cpp index a72bbfa961..3b49835c8a 100644 --- a/src/os2/iniconf.cpp +++ b/src/os2/iniconf.cpp @@ -323,7 +323,7 @@ bool wxIniConfig::Read(const wxString& szKey, long *pl) const static const int nMagic = 17; // 17 is some "rare" number static const int nMagic2 = 28; // arbitrary number != nMagic - long lVal; // = GetPrivateProfileInt(m_strGroup, strKey, nMagic, m_strLocalFilename); + long lVal = 0; // = GetPrivateProfileInt(m_strGroup, strKey, nMagic, m_strLocalFilename); if ( lVal != nMagic ) { // the value was read from the file *pl = lVal; @@ -349,7 +349,7 @@ bool wxIniConfig::Write(const wxString& szKey, const wxString& szValue) wxConfigPathChanger path(this, szKey); wxString strKey = GetPrivateKeyName(path.Name()); - bool bOk; // = WritePrivateProfileString(m_strGroup, strKey, + bool bOk = FALSE; // = WritePrivateProfileString(m_strGroup, strKey, // szValue, m_strLocalFilename) != 0; if ( !bOk ) @@ -394,7 +394,7 @@ bool wxIniConfig::DeleteEntry(const wxString& szKey, bool bGroupIfEmptyAlso) return TRUE; // delete the current group too - bool bOk; // = WritePrivateProfileString(m_strGroup, NULL, + bool bOk = FALSE; // = WritePrivateProfileString(m_strGroup, NULL, // NULL, m_strLocalFilename) != 0; if ( !bOk ) @@ -409,7 +409,7 @@ bool wxIniConfig::DeleteGroup(const wxString& szKey) // passing NULL as section name to WritePrivateProfileString deletes the // whole section according to the docs - bool bOk; // = WritePrivateProfileString(path.Name(), NULL, + bool bOk = FALSE; // = WritePrivateProfileString(path.Name(), NULL, // NULL, m_strLocalFilename) != 0; if ( !bOk ) @@ -429,7 +429,7 @@ bool wxIniConfig::DeleteAll() // then delete our own ini file char szBuf[MAX_PATH]; - size_t nRc; // = GetWindowsDirectory(szBuf, WXSIZEOF(szBuf)); + size_t nRc = 0; // = GetWindowsDirectory(szBuf, WXSIZEOF(szBuf)); if ( nRc == 0 ) { wxLogLastError("GetWindowsDirectory"); diff --git a/src/os2/mdi.cpp b/src/os2/mdi.cpp index 33756f0792..ceac2aa938 100644 --- a/src/os2/mdi.cpp +++ b/src/os2/mdi.cpp @@ -420,7 +420,7 @@ bool wxMDIParentFrame::HandleCommand(WXWORD id, WXWORD cmd, WXHWND hwnd) // is it one of standard MDI commands? WXWPARAM wParam = 0; - int msg; + int msg = 0; // TODO: /* diff --git a/src/os2/nativdlg.cpp b/src/os2/nativdlg.cpp index 4125ea3fef..040181cdbf 100644 --- a/src/os2/nativdlg.cpp +++ b/src/os2/nativdlg.cpp @@ -62,7 +62,7 @@ bool wxWindow::LoadNativeDialog(wxWindow* parent, wxWindowID& id) wxTopLevelWindows.Append(this); // Enumerate all children - HWND hWndNext; + HWND hWndNext = NULLHANDLE; // TODO hWndNext = ::GetWindow((HWND) m_hWnd, GW_CHILD); wxWindow* child = NULL; diff --git a/src/os2/pen.cpp b/src/os2/pen.cpp index ec5da7deed..98c58163e7 100644 --- a/src/os2/pen.cpp +++ b/src/os2/pen.cpp @@ -240,7 +240,7 @@ void wxPen::SetCap(int Cap) int wx2os2PenStyle(int wx_style) { - int cstyle; + int cstyle = 0; // TODO: /* switch (wx_style) diff --git a/src/os2/textctrl.cpp b/src/os2/textctrl.cpp index 1069c43882..2c23d29d1d 100644 --- a/src/os2/textctrl.cpp +++ b/src/os2/textctrl.cpp @@ -302,7 +302,8 @@ void wxTextCtrl::Paste() bool wxTextCtrl::CanCopy() const { // Can copy if there's a selection - long from, to; + long from = 0L; + long to = 0L; // GetSelection(& from, & to); return (from != to); } @@ -310,7 +311,8 @@ bool wxTextCtrl::CanCopy() const bool wxTextCtrl::CanCut() const { // Can cut if there's a selection - long from, to; + long from = 0L; + long to = 0L; // GetSelection(& from, & to); return (from != to); } @@ -527,7 +529,7 @@ bool wxTextCtrl::PositionToXY(long pos, long *x, long *y) const HWND hWnd = GetHwnd(); // This gets the line number containing the character - int lineNo; + int lineNo = -1; // lineNo = (int)SendMessage(hWnd, EM_LINEFROMCHAR, (WPARAM)pos, 0); if ( lineNo == -1 ) diff --git a/src/os2/utils.cpp b/src/os2/utils.cpp index 7183147cf2..a5dd628bad 100644 --- a/src/os2/utils.cpp +++ b/src/os2/utils.cpp @@ -65,9 +65,9 @@ bool wxGetHostName( char zServer[256]; char zComputer[256]; unsigned long ulLevel = 0; - unsigned char* zBuffer; - unsigned long ulBuffer; - unsigned long* pulTotalAvail; + unsigned char* zBuffer = NULL; + unsigned long ulBuffer = 256; + unsigned long* pulTotalAvail = NULL; NetBios32GetInfo( (const unsigned char*)zServer ,(const unsigned char*)zComputer @@ -197,7 +197,7 @@ bool wxShell( // Get free memory in bytes, or -1 if cannot determine amount (e.g. on UNIX) long wxGetFreeMemory() { - void* pMemptr; + void* pMemptr = NULL; ULONG lSize; ULONG lMemFlags; APIRET rc; @@ -336,8 +336,8 @@ bool wxWriteResource( , const wxString& rFile ) { - HAB hab; - HINI hIni; + HAB hab = 0; + HINI hIni = 0; if (rFile != "") { @@ -418,8 +418,8 @@ bool wxGetResource( , const wxString& rFile ) { - HAB hab; - HINI hIni; + HAB hab = 0; + HINI hIni = 0; wxChar zDefunkt[] = _T("$$default"); char zBuf[1000]; @@ -669,8 +669,8 @@ bool wxCheckForInterrupt( if(pWnd) { QMSG vMsg; - HAB hab; - HWND hwndFilter; + HAB hab = 0; + HWND hwndFilter = NULLHANDLE; HWND hwndWin= (HWND) pWnd->GetHWND(); while(::WinPeekMsg(hab, &vMsg, hwndFilter, 0, 0, PM_REMOVE)) diff --git a/src/os2/utilsexc.cpp b/src/os2/utilsexc.cpp index 19afebe4d9..f80036e7d4 100644 --- a/src/os2/utilsexc.cpp +++ b/src/os2/utilsexc.cpp @@ -248,9 +248,9 @@ bool wxGetFullHostName( char zServer[256]; char zComputer[256]; unsigned long ulLevel = 0; - unsigned char* zBuffer; - unsigned long ulBuffer; - unsigned long* pulTotalAvail; + unsigned char* zBuffer = NULL; + unsigned long ulBuffer = 256; + unsigned long* pulTotalAvail = NULL; NetBios32GetInfo( (const unsigned char*)zServer ,(const unsigned char*)zComputer diff --git a/src/os2/wave.cpp b/src/os2/wave.cpp index ed70fafdb8..4d4ac669f9 100644 --- a/src/os2/wave.cpp +++ b/src/os2/wave.cpp @@ -18,13 +18,18 @@ #include "wx/file.h" #include "wx/os2/wave.h" -#include "wx/os2/private.h" - -#ifdef RECT - #undef RECT -#endif -#include -#include +#define INCL_32 /* force 32 bit compile */ +#define INCL_GPIBITMAPS +#define INCL_DOSFILEMGR +#define INCL_WIN +#define INCL_GPI +#define INCL_PM +#include +#include +#include +#include +#include +#include wxWave::wxWave() : m_waveData(NULL), m_waveLength(0), m_isResource(FALSE) diff --git a/src/os2/window.cpp b/src/os2/window.cpp index 8d2385f4d1..865455f6c6 100644 --- a/src/os2/window.cpp +++ b/src/os2/window.cpp @@ -623,7 +623,7 @@ WXDWORD wxWindow::MakeExtendedStyle(long style, bool eliminateBorders) WXDWORD wxWindow::Determine3DEffects(WXDWORD defaultBorderStyle, bool *want3D) const { - DWORD exStyle; // remove after implementation doe + DWORD exStyle = 0L; // remove after implementation doe /* TODO: this ought to be fun * // If matches certain criteria, then assume no 3D effects @@ -977,7 +977,7 @@ void wxWindow::UnpackMenuSelect(WXWPARAM wParam, WXLPARAM lParam, wxWindow *wxWndHook = NULL; // Main window proc -MRESULT wxWndProc(HWND hWnd, UINT message, MPARAM wParam, MPARAM lParam) +MRESULT wxWndProc(HWND hWnd, ULONG message, MPARAM wParam, MPARAM lParam) { // trace all messages - useful for the debugging #ifdef __WXDEBUG__ diff --git a/src/xpm/scan.c b/src/xpm/scan.c index 16c1d2e674..620657a346 100644 --- a/src/xpm/scan.c +++ b/src/xpm/scan.c @@ -411,7 +411,7 @@ ScanOtherColors(Display *display, XpmColor *colors, int ncolors, Pixel *pixels, xcolor->pixel = *pixels; } -#ifdef wx_msw +#if defined(wx_msw) || defined(wx_pm) XQueryColors(display, (Colormap *)colormap, xcolors, ncolors); #else XQueryColors(display, (Colormap)colormap, xcolors, ncolors); -- 2.45.2