From 33ac7e6f01acbac1cff0ad400d8ea7f0bfd0a62f Mon Sep 17 00:00:00 2001 From: Kendall Bennett Date: Wed, 2 May 2001 19:48:15 +0000 Subject: [PATCH] Updates to fix Watcom C/C++ 11.0 compiler warning problems. Now compiles clean with this compiler. Hopefully I did this without breaking other compilers. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9967 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/datetime.h | 4 +- include/wx/dc.h | 2 +- include/wx/defs.h | 17 +- include/wx/event.h | 2 +- include/wx/generic/dragimgg.h | 6 +- include/wx/generic/statusbr.h | 2 +- include/wx/generic/treelay.h | 32 +-- include/wx/gsocket.h | 14 +- include/wx/msw/mimetype.h | 6 +- include/wx/msw/ole/dataform.h | 2 +- include/wx/msw/window.h | 8 +- include/wx/object.h | 7 + include/wx/tbarbase.h | 2 +- src/common/cmndata.cpp | 18 +- src/common/cshelp.cpp | 10 +- src/common/cwy_tab.c | 2 +- src/common/datetime.cpp | 6 +- src/common/dynlib.cpp | 3 +- src/common/effects.cpp | 6 +- src/common/encconv.cpp | 9 +- src/common/filefn.cpp | 38 +--- src/common/filename.cpp | 10 +- src/common/fontcmn.cpp | 4 +- src/common/gifdecod.cpp | 9 +- src/common/imagbmp.cpp | 26 +-- src/common/image.cpp | 18 +- src/common/imagjpeg.cpp | 13 +- src/common/imagpcx.cpp | 16 +- src/common/imagpng.cpp | 16 +- src/common/imagxpm.cpp | 18 +- src/common/memory.cpp | 7 +- src/common/mimecmn.cpp | 5 +- src/common/resource.cpp | 399 +++++++++++++++++----------------- src/common/sizer.cpp | 10 +- src/common/timercmn.cpp | 3 +- src/common/wincmn.cpp | 6 +- src/generic/dirctrlg.cpp | 27 ++- src/generic/grid.cpp | 2 +- src/generic/splash.cpp | 12 +- src/generic/tipwin.cpp | 11 +- src/generic/treectlg.cpp | 14 +- src/html/helpctrl.cpp | 11 +- src/html/helpfrm.cpp | 7 +- src/html/htmlwin.cpp | 66 +++--- src/html/m_fonts.cpp | 42 ++-- src/html/m_layout.cpp | 50 +++-- src/msw/app.cpp | 9 +- src/msw/bmpbuttn.cpp | 5 +- src/msw/button.cpp | 2 +- src/msw/checkbox.cpp | 4 +- src/msw/choice.cpp | 12 +- src/msw/clipbrd.cpp | 9 +- src/msw/colordlg.cpp | 2 +- src/msw/combobox.cpp | 14 +- src/msw/control.cpp | 8 +- src/msw/curico.cpp | 18 +- src/msw/dc.cpp | 2 +- src/msw/dcprint.cpp | 4 +- src/msw/dialog.cpp | 10 +- src/msw/dib.cpp | 6 +- src/msw/dibutils.cpp | 10 +- src/msw/enhmeta.cpp | 4 +- src/msw/filedlg.cpp | 2 +- src/msw/font.cpp | 18 +- src/msw/gauge95.cpp | 4 +- src/msw/gdiimage.cpp | 4 +- src/msw/gsocket.c | 23 +- src/msw/gsockmsw.c | 3 +- src/msw/listbox.cpp | 2 +- src/msw/listctrl.cpp | 8 +- src/msw/main.cpp | 5 +- src/msw/mimetype.cpp | 8 +- src/msw/ole/dataobj.cpp | 41 ++-- src/msw/ole/droptgt.cpp | 9 +- src/msw/ownerdrw.cpp | 38 ++-- src/msw/palette.cpp | 6 +- src/msw/pen.cpp | 2 +- src/msw/printwin.cpp | 8 +- src/msw/radiobox.cpp | 10 +- src/msw/radiobut.cpp | 10 +- src/msw/regconf.cpp | 6 +- src/msw/scrolbar.cpp | 10 +- src/msw/spinbutt.cpp | 6 +- src/msw/statbr95.cpp | 2 +- src/msw/tbar95.cpp | 7 +- src/msw/textctrl.cpp | 10 +- src/msw/treectrl.cpp | 10 +- src/msw/utils.cpp | 8 +- src/msw/utilsexc.cpp | 2 +- src/msw/window.cpp | 48 ++-- src/msw/xpmhand.cpp | 17 +- src/xpm/create.c | 9 +- src/xpm/data.c | 6 - 93 files changed, 739 insertions(+), 720 deletions(-) diff --git a/include/wx/datetime.h b/include/wx/datetime.h index a9842fd982..55484c7b47 100644 --- a/include/wx/datetime.h +++ b/include/wx/datetime.h @@ -561,7 +561,7 @@ public: wxDateTime_t millisec = 0); // from separate values for each component with explicit date inline wxDateTime(wxDateTime_t day, // day of the month - Month month = Inv_Month, + Month month, int year = Inv_Year, // 1999, not 99 please! wxDateTime_t hour = 0, wxDateTime_t minute = 0, @@ -604,7 +604,7 @@ public: // from separate values for each component with explicit date // (defaults for month and year are the current values) wxDateTime& Set(wxDateTime_t day, - Month month = Inv_Month, + Month month, int year = Inv_Year, // 1999, not 99 please! wxDateTime_t hour = 0, wxDateTime_t minute = 0, diff --git a/include/wx/dc.h b/include/wx/dc.h index dcff29cc03..7ddcda916c 100644 --- a/include/wx/dc.h +++ b/include/wx/dc.h @@ -44,7 +44,7 @@ public: virtual ~wxDrawObject() { } - virtual void Draw(wxDCBase& dc) const { } + virtual void Draw(wxDCBase&) const { } virtual void CalcBoundingBox(wxCoord x, wxCoord y) { diff --git a/include/wx/defs.h b/include/wx/defs.h index aa702b207e..696587f263 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -119,7 +119,6 @@ #elif defined(__BCPLUSPLUS__) && !defined(__BORLANDC__) #define __BORLANDC__ #elif defined(__WATCOMC__) - //#define __WATCOMC__ #elif defined(__SC__) #define __SYMANTECC__ #endif // compiler @@ -148,6 +147,12 @@ #endif #endif // __VISUALC__ +// suppress some Watcom C++ warnings +#ifdef __WATCOMC__ +# pragma warning 849 9 // Disable 'virtual function hidden' +# pragma warning 549 9 // Disable 'operand contains compiler generated information' +#endif // __VISUALC__ + // suppress some Salford C++ warnings #ifdef __SALFORDC__ # pragma suppress 353 // Possible nested comments @@ -414,8 +419,8 @@ typedef int wxWindowID; #if defined(__WXMSW__) -// __declspec works in BC++ 5 and later, as well as VC++ and gcc -#if defined(__VISUALC__) || defined(__BORLANDC__) || defined(__GNUC__) +// __declspec works in BC++ 5 and later, Watcom C++ 11.0 and later as well as VC++ and gcc +#if defined(__VISUALC__) || defined(__BORLANDC__) || defined(__GNUC__) || defined(__WATCOMC__) # ifdef WXMAKINGDLL # define WXDLLEXPORT __declspec( dllexport ) # define WXDLLEXPORT_DATA(type) __declspec( dllexport ) type @@ -477,8 +482,10 @@ typedef int wxWindowID; # define WXDLLIMPORT #endif +#ifdef __cplusplus class WXDLLEXPORT wxObject; class WXDLLEXPORT wxEvent; +#endif /** symbolic constant used by all Find()-like functions returning positive integer on success as failure indicator */ @@ -489,7 +496,9 @@ class WXDLLEXPORT wxEvent; // ---------------------------------------------------------------------------- // everybody gets the assert and other debug macros +#ifdef __cplusplus #include "wx/debug.h" +#endif //@{ /// delete pointer if it is not NULL and NULL it afterwards @@ -558,7 +567,9 @@ class WXDLLEXPORT wxEvent; #endif // Callback function type definition +#ifdef __cplusplus typedef void (*wxFunction) (wxObject&, wxEvent&); +#endif // ---------------------------------------------------------------------------- // OS mnemonics -- Identify the running OS (useful for Windows) diff --git a/include/wx/event.h b/include/wx/event.h index 6dfc82a6ef..ca452cf849 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -1575,7 +1575,7 @@ public: wxObject *userData = (wxObject *) NULL ) { Connect(id, -1, eventType, func, userData); } - bool Disconnect( int id, int lastId = -1, wxEventType eventType = wxEVT_NULL, + bool Disconnect( int id, int lastId, wxEventType eventType, wxObjectEventFunction func = NULL, wxObject *userData = (wxObject *) NULL ); diff --git a/include/wx/generic/dragimgg.h b/include/wx/generic/dragimgg.h index 9595a2cb7d..64fef65b2a 100644 --- a/include/wx/generic/dragimgg.h +++ b/include/wx/generic/dragimgg.h @@ -190,7 +190,7 @@ public: // Create a drag image from a bitmap and optional cursor bool Create(const wxBitmap& image, const wxCursor& cursor = wxNullCursor); - bool Create(const wxBitmap& image, const wxCursor& cursor, const wxPoint& cursorHotspot) + bool Create(const wxBitmap& image, const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot)) { wxLogDebug(wxT("wxDragImage::Create: use of a cursor hotspot is now deprecated. Please omit this argument.")); return Create(image, cursor); @@ -198,7 +198,7 @@ public: // Create a drag image from an icon and optional cursor bool Create(const wxIcon& image, const wxCursor& cursor = wxNullCursor); - bool Create(const wxIcon& image, const wxCursor& cursor, const wxPoint& cursorHotspot) + bool Create(const wxIcon& image, const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot)) { wxLogDebug(wxT("wxDragImage::Create: use of a cursor hotspot is now deprecated. Please omit this argument.")); return Create(image, cursor); @@ -206,7 +206,7 @@ public: // Create a drag image from a string and optional cursor bool Create(const wxString& str, const wxCursor& cursor = wxNullCursor); - bool Create(const wxString& str, const wxCursor& cursor, const wxPoint& cursorHotspot) + bool Create(const wxString& str, const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot)) { wxLogDebug(wxT("wxDragImage::Create: use of a cursor hotspot is now deprecated. Please omit this argument.")); return Create(str, cursor); diff --git a/include/wx/generic/statusbr.h b/include/wx/generic/statusbr.h index 7a3b8a4820..47a834f1c1 100644 --- a/include/wx/generic/statusbr.h +++ b/include/wx/generic/statusbr.h @@ -55,7 +55,7 @@ public: } bool Create(wxWindow *parent, wxWindowID id, - long style = 0, + long style, const wxString& name = wxPanelNameStr); // Create status line diff --git a/include/wx/generic/treelay.h b/include/wx/generic/treelay.h index 02a697132f..92963b63db 100644 --- a/include/wx/generic/treelay.h +++ b/include/wx/generic/treelay.h @@ -2,7 +2,7 @@ // Name: treelay.h // Purpose: wxTreeLayout class // Author: Julian Smart -// Modified by: +// Modified by: // Created: 7/4/98 // RCS-ID: $Id$ // Copyright: (c) 1998 Julian Smart @@ -24,7 +24,7 @@ class WXDLLEXPORT wxTreeLayout: public wxObject public: wxTreeLayout(); - + // Redefine these virtual void GetChildren(long id, wxList& list) = 0; virtual long GetNextNode(long id) = 0; @@ -35,21 +35,21 @@ public: virtual void SetNodeY(long id, long y) = 0; virtual void ActivateNode(long id, bool active) = 0; virtual bool NodeActive(long id) = 0; - + // Optional redefinition void Initialize(void); - inline virtual void SetNodeName(long id, const wxString& name) {} - inline virtual wxString GetNodeName(long id) { return wxString(""); } + inline virtual void SetNodeName(long WXUNUSED(id), const wxString& WXUNUSED(name)) {} + inline virtual wxString GetNodeName(long WXUNUSED(id)) { return wxString(""); } virtual void GetNodeSize(long id, long *x, long *y, wxDC& dc); virtual void Draw(wxDC& dc); virtual void DrawNodes(wxDC& dc); virtual void DrawBranches(wxDC& dc); virtual void DrawNode(long id, wxDC& dc); virtual void DrawBranch(long from, long to, wxDC& dc); - + // Don't redefine virtual void DoLayout(wxDC& dc, long topNode = -1); - + // Accessors -- don't redefine inline void SetTopNode(long id) { m_parentNode = id; } inline long GetTopNode(void) const { return m_parentNode; } @@ -59,15 +59,15 @@ public: inline void SetMargins(long x, long y) { m_leftMargin = x; m_topMargin = y; } inline long GetTopMargin(void) const { return m_topMargin; } inline long GetLeftMargin(void) const { return m_leftMargin; } - + inline bool GetOrientation(void) const { return m_orientation; } inline void SetOrientation(bool orient) { m_orientation = orient; } - + private: void CalcLayout(long node_id, int level, wxDC& dc); - + // Members - + protected: long m_parentNode; long m_lastY; @@ -100,12 +100,12 @@ public: wxTreeLayoutStored(int noNodes = 200); ~wxTreeLayoutStored(void); void Initialize(int n); - + wxString HitTest(wxMouseEvent& event, wxDC& dc); wxStoredNode* GetNode(long id) const; inline int GetNumNodes() const { return m_maxNodes; }; inline int GetNodeCount() const { return m_num; }; - + virtual void GetChildren(long id, wxList& list); virtual long GetNextNode(long id); virtual long GetNodeParent(long id); @@ -119,10 +119,10 @@ public: virtual bool NodeActive(long id); virtual void SetClientData(long id, long clientData); virtual long GetClientData(long id) const; - + virtual long AddChild(const wxString& name, const wxString& parent = ""); virtual long NameToId(const wxString& name); - + // Data members private: wxStoredNode* m_nodes; @@ -135,4 +135,4 @@ private: #endif // _WX_TREELAY_H_ - + diff --git a/include/wx/gsocket.h b/include/wx/gsocket.h index 069a531fc3..5f6924aed3 100644 --- a/include/wx/gsocket.h +++ b/include/wx/gsocket.h @@ -1,7 +1,7 @@ /* ------------------------------------------------------------------------- * Project: GSocket (Generic Socket) * Name: gsocket.h - * Author: Guilhem Lavaux + * Author: Guilhem Lavaux * Guillermo Rodriguez Garcia (maintainer) * Purpose: GSocket include file (system independent) * CVSID: $Id$ @@ -126,11 +126,11 @@ GAddress *GSocket_GetPeer(GSocket *socket); * Sets up this socket as a server. The local address must have been * set with GSocket_SetLocal() before GSocket_SetServer() is called. * Returns GSOCK_NOERROR on success, one of the following otherwise: - * + * * Error codes: * GSOCK_INVSOCK - the socket is in use. * GSOCK_INVADDR - the local address has not been set. - * GSOCK_IOERR - low-level error. + * GSOCK_IOERR - low-level error. */ GSocketError GSocket_SetServer(GSocket *socket); @@ -144,7 +144,7 @@ GSocketError GSocket_SetServer(GSocket *socket); * GSOCK_TIMEDOUT - timeout, no incoming connections. * GSOCK_WOULDBLOCK - the call would block and the socket is nonblocking. * GSOCK_MEMERR - couldn't allocate memory. - * GSOCK_IOERR - low-level error. + * GSOCK_IOERR - low-level error. */ GSocket *GSocket_WaitConnection(GSocket *socket); @@ -172,7 +172,7 @@ GSocket *GSocket_WaitConnection(GSocket *socket); * GSOCK_TIMEDOUT - timeout, the connection failed. * GSOCK_WOULDBLOCK - connection in progress (nonblocking sockets only) * GSOCK_MEMERR - couldn't allocate memory. - * GSOCK_IOERR - low-level error. + * GSOCK_IOERR - low-level error. */ GSocketError GSocket_Connect(GSocket *socket, GSocketStream stream); @@ -188,7 +188,7 @@ GSocketError GSocket_Connect(GSocket *socket, GSocketStream stream); * Error codes: * GSOCK_INVSOCK - the socket is in use. * GSOCK_INVADDR - the local address has not been set. - * GSOCK_IOERR - low-level error. + * GSOCK_IOERR - low-level error. */ GSocketError GSocket_SetNonOriented(GSocket *socket); @@ -243,7 +243,7 @@ GSocketError GSocket_GetError(GSocket *socket); * operation, there is still data available, the callback function will * be called again. * GSOCK_OUTPUT: - * The socket is available for writing. That is, the next write call + * The socket is available for writing. That is, the next write call * won't block. This event is generated only once, when the connection is * first established, and then only if a call failed with GSOCK_WOULDBLOCK, * when the output buffer empties again. This means that the app should diff --git a/include/wx/msw/mimetype.h b/include/wx/msw/mimetype.h index 724b64de55..7de0730b2f 100644 --- a/include/wx/msw/mimetype.h +++ b/include/wx/msw/mimetype.h @@ -104,10 +104,10 @@ public: size_t EnumAllFileTypes(wxArrayString& mimetypes); - // these are NOPs under Windows - bool ReadMailcap(const wxString& filename, bool fallback = TRUE) + // this are NOPs under Windows + bool ReadMailcap(const wxString& WXUNUSED(filename), bool WXUNUSED(fallback) = TRUE) { return TRUE; } - bool ReadMimeTypes(const wxString& filename) + bool ReadMimeTypes(const wxString& WXUNUSED(filename)) { return TRUE; } // create a new filetype association diff --git a/include/wx/msw/ole/dataform.h b/include/wx/msw/ole/dataform.h index f071c37461..f66e2923c5 100644 --- a/include/wx/msw/ole/dataform.h +++ b/include/wx/msw/ole/dataform.h @@ -19,7 +19,7 @@ class WXDLLEXPORT wxDataFormat { public: - // the clipboard formats under Win32 are WORDs + // the clipboard formats under Win32 are WORD's typedef unsigned short NativeFormat; wxDataFormat(NativeFormat format = wxDF_INVALID) { m_format = format; } diff --git a/include/wx/msw/window.h b/include/wx/msw/window.h index f09bd3419f..a19f12da28 100644 --- a/include/wx/msw/window.h +++ b/include/wx/msw/window.h @@ -87,7 +87,7 @@ public: virtual void SetFocus(); - virtual bool Reparent( wxWindow *newParent ); + virtual bool Reparent( wxWindowBase *newParent ); virtual void WarpPointer(int x, int y); virtual void CaptureMouse(); @@ -328,9 +328,9 @@ public: bool HandleMouseEvent(WXUINT msg, int x, int y, WXUINT flags); bool HandleMouseMove(int x, int y, WXUINT flags); - bool HandleChar(WXWORD wParam, WXLPARAM lParam, bool isASCII = FALSE); - bool HandleKeyDown(WXWORD wParam, WXLPARAM lParam); - bool HandleKeyUp(WXWORD wParam, WXLPARAM lParam); + bool HandleChar(WXWPARAM wParam, WXLPARAM lParam, bool isASCII = FALSE); + bool HandleKeyDown(WXWPARAM wParam, WXLPARAM lParam); + bool HandleKeyUp(WXWPARAM wParam, WXLPARAM lParam); bool HandleQueryDragIcon(WXHICON *hIcon); diff --git a/include/wx/object.h b/include/wx/object.h index f6b11f8594..4603f3b123 100644 --- a/include/wx/object.h +++ b/include/wx/object.h @@ -175,6 +175,13 @@ wxObject* WXDLLEXPORT_CTORFN wxConstructorFor##name(void) \ ? (className *)(obj) \ : (className *)0) +// The 'this' pointer is always true, so use this version to cast the this +// pointer and avoid compiler warnings. +#define wxDynamicThisCast(obj, className) \ + (((obj)->IsKindOf(&className::sm_class##className)) \ + ? (className *)(obj) \ + : (className *)0) + #define wxConstCast(obj, className) ((className *)(obj)) #ifdef __WXDEBUG__ diff --git a/include/wx/tbarbase.h b/include/wx/tbarbase.h index ea970821bf..81062fe304 100644 --- a/include/wx/tbarbase.h +++ b/include/wx/tbarbase.h @@ -236,7 +236,7 @@ public: // between the two states. wxToolBarToolBase *AddTool(int id, const wxBitmap& bitmap, - const wxBitmap& pushedBitmap = wxNullBitmap, + const wxBitmap& pushedBitmap, bool toggle = FALSE, wxObject *clientData = NULL, const wxString& shortHelpString = wxEmptyString, diff --git a/src/common/cmndata.cpp b/src/common/cmndata.cpp index c863c5ba73..741840dc8a 100644 --- a/src/common/cmndata.cpp +++ b/src/common/cmndata.cpp @@ -181,7 +181,7 @@ wxPrintData::wxPrintData() m_macPrintSettings = kPMNoPrintSettings; #else m_macPrintInfo = (THPrint) NewHandleClear( sizeof( TPrint ) ) ; - (**m_macPrintInfo).iPrVersion = 0; // something invalid + (**m_macPrintInfo).iPrVersion = 0; // something invalid (**m_macPrintInfo).prInfo.iHRes = 72; (**m_macPrintInfo).prInfo.iVRes = 72; @@ -190,8 +190,8 @@ wxPrintData::wxPrintData() Rect r2 = { -18, -36, 8*72 - 18, 11*72 - 36 } ; (**m_macPrintInfo).rPaper = r2; - (**m_macPrintInfo).prStl.iPageV = 11 * 120 ; // 11 inches in 120th of an inch - (**m_macPrintInfo).prStl.iPageH = 8 * 120 ; // 8 inches in 120th of an inch + (**m_macPrintInfo).prStl.iPageV = 11 * 120 ; // 11 inches in 120th of an inch + (**m_macPrintInfo).prStl.iPageH = 8 * 120 ; // 8 inches in 120th of an inch #endif #endif m_printOrientation = wxPORTRAIT; @@ -259,7 +259,7 @@ wxPrintData::~wxPrintData() } #else wxASSERT( m_macPrintInfo ) ; - // we should perhaps delete + // we should perhaps delete #endif #endif } @@ -915,11 +915,11 @@ void wxPrintDialogData::ConvertToNative() m_printData.SetNativeDataDevNames((void*) NULL); pd->hDC = (HDC) NULL; - pd->nFromPage = (UINT)m_printFromPage; - pd->nToPage = (UINT)m_printToPage; - pd->nMinPage = (UINT)m_printMinPage; - pd->nMaxPage = (UINT)m_printMaxPage; - pd->nCopies = (UINT)m_printNoCopies; + pd->nFromPage = (WORD)m_printFromPage; + pd->nToPage = (WORD)m_printToPage; + pd->nMinPage = (WORD)m_printMinPage; + pd->nMaxPage = (WORD)m_printMaxPage; + pd->nCopies = (WORD)m_printNoCopies; pd->Flags = PD_RETURNDC ; diff --git a/src/common/cshelp.cpp b/src/common/cshelp.cpp index 3921a21c96..cb9a8d895f 100644 --- a/src/common/cshelp.cpp +++ b/src/common/cshelp.cpp @@ -167,7 +167,7 @@ bool wxContextHelpEvtHandler::ProcessEvent(wxEvent& event) m_contextHelp->EndContextHelp(); return TRUE; } - + if ((event.GetEventType() == wxEVT_CHAR) || (event.GetEventType() == wxEVT_KEY_DOWN) || (event.GetEventType() == wxEVT_ACTIVATE) || @@ -177,14 +177,14 @@ bool wxContextHelpEvtHandler::ProcessEvent(wxEvent& event) m_contextHelp->EndContextHelp(); return TRUE; } - + if ((event.GetEventType() == wxEVT_PAINT) || (event.GetEventType() == wxEVT_ERASE_BACKGROUND)) { event.Skip(); return FALSE; } - + return TRUE; } @@ -198,7 +198,7 @@ bool wxContextHelp::DispatchEvent(wxWindow* win, const wxPoint& pt) wxHelpEvent helpEvent(wxEVT_HELP, subjectOfHelp->GetId(), pt) ; helpEvent.SetEventObject(this); eventProcessed = win->GetEventHandler()->ProcessEvent(helpEvent); - + // Go up the window hierarchy until the event is handled (or not). // I.e. keep submitting ancestor windows until one is recognised // by the app code that processes the ids and displays help. @@ -251,7 +251,7 @@ wxContextHelpButton::wxContextHelpButton(wxWindow* parent, { } -void wxContextHelpButton::OnContextHelp(wxCommandEvent& event) +void wxContextHelpButton::OnContextHelp(wxCommandEvent& WXUNUSED(event)) { wxContextHelp contextHelp(GetParent()); } diff --git a/src/common/cwy_tab.c b/src/common/cwy_tab.c index ef1e1a2df7..b83301066b 100644 --- a/src/common/cwy_tab.c +++ b/src/common/cwy_tab.c @@ -33,7 +33,7 @@ int _read( int , void * , size_t ) ; #define read _read #endif #ifdef __WXMSW__ -int fileno( FILE* ) ; +//int fileno( FILE* ) ; This is defined in watcom #else #if __MSL__ < 0x6000 int fileno( void* ) ; diff --git a/src/common/datetime.cpp b/src/common/datetime.cpp index f648ca26f4..a38960ec05 100644 --- a/src/common/datetime.cpp +++ b/src/common/datetime.cpp @@ -1249,7 +1249,7 @@ wxDateTime::Tm wxDateTime::GetTm(const TimeZone& tz) const else { time += (time_t)tz.GetOffset(); -#ifdef __VMS__ // time is unsigned so avoid warning +#if defined(__VMS__) || defined(__WATCOMC__) // time is unsigned so avoid warning int time2 = (int) time; if ( time2 >= 0 ) #else @@ -1816,7 +1816,7 @@ wxString wxDateTime::Format(const wxChar *format, const TimeZone& tz) const { time += (int)tz.GetOffset(); -#ifdef __VMS__ // time is unsigned so avoid the warning +#if defined(__VMS__) || defined(__WATCOMC__) // time is unsigned so avoid warning int time2 = (int) time; if ( time2 >= 0 ) #else @@ -3251,7 +3251,7 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date) haveDay = TRUE; - day = n + 1; + day = (wxDateTime_t)(n + 1); } } } diff --git a/src/common/dynlib.cpp b/src/common/dynlib.cpp index 2c82172f8f..f90788fb17 100644 --- a/src/common/dynlib.cpp +++ b/src/common/dynlib.cpp @@ -363,8 +363,7 @@ wxLibrary *wxLibraries::LoadLibrary(const wxString& name) if (node != NULL) return ((wxLibrary *)node->Data()); #else // !OS/2 - node = m_loaded.Find(name.GetData()); - if ( node ) + if ( (node = m_loaded.Find(name.GetData())) != NULL) return ((wxLibrary *)node->Data()); #endif // If DLL shares data, this is necessary. diff --git a/src/common/effects.cpp b/src/common/effects.cpp index af4cb226f4..ae4c66e40f 100644 --- a/src/common/effects.cpp +++ b/src/common/effects.cpp @@ -54,7 +54,7 @@ wxEffects::wxEffects(const wxColour& highlightColour, const wxColour& lightShado } // Draw a sunken edge -void wxEffects::DrawSunkenEdge(wxDC& dc, const wxRect& rect, int borderSize) +void wxEffects::DrawSunkenEdge(wxDC& dc, const wxRect& rect, int WXUNUSED(borderSize)) { wxPen highlightPen(m_highlightColour, 1, wxSOLID); wxPen lightShadowPen(m_lightShadow, 1, wxSOLID); @@ -93,9 +93,9 @@ bool wxEffects::TileBitmap(const wxRect& rect, wxDC& dc, wxBitmap& bitmap) int w = bitmap.GetWidth(); int h = bitmap.GetHeight(); - + wxMemoryDC dcMem; - + if (bitmap.GetPalette() && !hiColour) { dc.SetPalette(* bitmap.GetPalette()); diff --git a/src/common/encconv.cpp b/src/common/encconv.cpp index d4f8aebebe..7a288485d4 100644 --- a/src/common/encconv.cpp +++ b/src/common/encconv.cpp @@ -138,7 +138,8 @@ bool wxEncodingConverter::Init(wxFontEncoding input_enc, wxFontEncoding output_e else { CharsetItem *rev = BuildReverseTable(out_tbl); - CharsetItem *item, key; + CharsetItem *item; + CharsetItem key; for (i = 0; i < 128; i++) { @@ -150,7 +151,11 @@ bool wxEncodingConverter::Init(wxFontEncoding input_enc, wxFontEncoding output_e if (item) m_Table[128 + i] = (tchar)item -> c; else - m_Table[128 + i] = 128 + i; // don't know => don't touch +#if wxUSE_WCHAR_T + m_Table[128 + i] = (wchar_t)(128 + i); +#else + m_Table[128 + i] = (char)(128 + i); +#endif } delete[] rev; diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp index 4cfc2036a1..f9aa7c75ea 100644 --- a/src/common/filefn.cpp +++ b/src/common/filefn.cpp @@ -444,7 +444,7 @@ wxChar *wxExpandPath(wxChar *buf, const wxChar *name) { register wxChar *d, *s, *nm; wxChar lnm[_MAXPATHLEN]; - int q; + int q; // Some compilers don't like this line. // const wxChar trimchars[] = wxT("\n \t"); @@ -500,7 +500,7 @@ wxChar *wxExpandPath(wxChar *buf, const wxChar *name) } else #else - while ((*d++ = *s)) { + while ((*d++ = *s) != NULL) { # ifndef __WXMSW__ if (*s == wxT('\\')) { if ((*(d - 1) = *++s)) { @@ -520,13 +520,7 @@ wxChar *wxExpandPath(wxChar *buf, const wxChar *name) register wxChar *start = d; register int braces = (*s == wxT('{') || *s == wxT('(')); register wxChar *value; -#ifdef __VISAGECPP__ - // VA gives assignment in logical expr warning - while (*d) - *d++ = *s; -#else - while ((*d++ = *s)) -#endif + while ((*d++ = *s) != NULL) if (braces ? (*s == wxT('}') || *s == wxT(')')) : !(wxIsalnum(*s) || *s == wxT('_')) ) break; else @@ -534,12 +528,7 @@ wxChar *wxExpandPath(wxChar *buf, const wxChar *name) *--d = 0; value = wxGetenv(braces ? start + 1 : start); if (value) { -#ifdef __VISAGECPP__ - // VA gives assignment in logical expr warning - for ((d = start - 1); (*d); *d++ = *value++); -#else - for ((d = start - 1); (*d++ = *value++);); -#endif + for ((d = start - 1); (*d++ = *value++) != NULL;); d--; if (braces && *s) s++; @@ -591,13 +580,7 @@ wxChar *wxExpandPath(wxChar *buf, const wxChar *name) *(d - 1) = SEP; } s = nm; -#ifdef __VISAGECPP__ - // VA gives assignment in logical expr warning - while (*d) - *d++ = *s++; -#else - while ((*d++ = *s++)); -#endif + while ((*d++ = *s++) != NULL); delete[] nm_tmp; // clean up alloc /* Now clean up the buffer */ return wxRealPath(buf); @@ -1127,6 +1110,7 @@ bool wxMkdir(const wxString& dir, int perm) #elif defined(__WXPM__) if (::DosCreateDir((PSZ)dirname, NULL) != 0) // enhance for EAB's?? #else // !MSW and !OS/2 VAC++ + (void)perm; if ( wxMkDir(wxFNSTRINGCAST wxFNCONV(dirname)) != 0 ) #endif // !MSW/MSW { @@ -1708,7 +1692,7 @@ wxChar *wxGetWorkingDirectory(wxChar *buf, int sz) pb.ioRefNum = LMGetCurApRefNum(); pb.ioFCBIndx = 0; error = PBGetFCBInfoSync(&pb); - if ( error == noErr ) + if ( error == noErr ) { cwdSpec.vRefNum = pb.ioFCBVRefNum; cwdSpec.parID = pb.ioFCBParID; @@ -1722,9 +1706,9 @@ wxChar *wxGetWorkingDirectory(wxChar *buf, int sz) buf[0] = 0 ; /* this version will not always give back the application directory on mac - enum - { - SFSaveDisk = 0x214, CurDirStore = 0x398 + enum + { + SFSaveDisk = 0x214, CurDirStore = 0x398 }; FSSpec cwdSpec ; @@ -1952,7 +1936,7 @@ bool wxMatchWild( const wxString& pat, const wxString& text, bool dot_special ) pattern++; ret_code = FALSE; while ((*str!=wxT('\0')) - && (!(ret_code=wxMatchWild(pattern, str++, FALSE)))) + && ((ret_code=wxMatchWild(pattern, str++, FALSE)) == 0)) /*loop*/; if (ret_code) { while (*str != wxT('\0')) diff --git a/src/common/filename.cpp b/src/common/filename.cpp index cebec267bc..aad2543db4 100644 --- a/src/common/filename.cpp +++ b/src/common/filename.cpp @@ -464,6 +464,7 @@ bool wxFileName::IsWild( wxPathFormat format ) { // FIXME: this is probably false for Mac and this is surely wrong for most // of Unix shells (think about "[...]") + (void)format; return m_name.find_first_of(_T("*?")) != wxString::npos; } @@ -529,6 +530,7 @@ wxString wxFileName::GetPath( bool add_separator, wxPathFormat format ) const wxString wxFileName::GetFullPath( wxPathFormat format ) const { + (void)format; return GetPathWithSep() + GetFullName(); } @@ -571,17 +573,16 @@ wxString wxFileName::GetLongPath() const typedef DWORD (*GET_LONG_PATH_NAME)(const wxChar *, wxChar *, DWORD); static bool s_triedToLoad = FALSE; - static GET_LONG_PATH_NAME s_pfnGetLongPathName = NULL; if ( !s_triedToLoad ) { s_triedToLoad = TRUE; - +#if 0 wxDllType dllKernel = wxDllLoader::LoadLibrary(_T("kernel32")); - short avoidCompilerWarning = 0; - if ( avoidCompilerWarning ) // dllKernel ) + if ( dllKernel ) { // may succeed or fail depending on the Windows version + static GET_LONG_PATH_NAME s_pfnGetLongPathName = NULL; #ifdef _UNICODE s_pfnGetLongPathName = (GET_LONG_PATH_NAME) wxDllLoader::GetSymbol(dllKernel, _T("GetLongPathNameW")); #else @@ -614,6 +615,7 @@ wxString wxFileName::GetLongPath() const } } } +#endif } if (success) return pathOut; diff --git a/src/common/fontcmn.cpp b/src/common/fontcmn.cpp index 44cca93b72..d785a3339a 100644 --- a/src/common/fontcmn.cpp +++ b/src/common/fontcmn.cpp @@ -104,6 +104,8 @@ void wxFontBase::SetNativeFontInfo(const wxNativeFontInfo& info) SetUnderlined(info.underlined); SetFaceName(info.faceName); SetEncoding(info.encoding); +#else + (void)info; #endif } @@ -212,7 +214,7 @@ bool wxNativeFontInfo::FromString(const wxString& s) // // Ignore the version for now // - + token = tokenizer.GetNextToken(); if ( !token.ToLong(&l) ) return FALSE; diff --git a/src/common/gifdecod.cpp b/src/common/gifdecod.cpp index 131c5ecb80..828afb82c8 100644 --- a/src/common/gifdecod.cpp +++ b/src/common/gifdecod.cpp @@ -465,9 +465,9 @@ int wxGIFDecoder::dgif(GIFImage *img, int interl, int bits) while (code != ab_fin); #ifdef __WXMAC__ - delete [] ab_prefix ; - delete [] ab_tail ; - delete [] stack ; + delete [] ab_prefix ; + delete [] ab_tail ; + delete [] stack ; #endif return 0; } @@ -504,7 +504,8 @@ int wxGIFDecoder::ReadGIF() unsigned char type = 0; unsigned char pal[768]; unsigned char buf[16]; - GIFImage **ppimg, *pimg, *pprev; + GIFImage **ppimg; + GIFImage *pimg, *pprev; /* check GIF signature */ if (!CanRead()) diff --git a/src/common/imagbmp.cpp b/src/common/imagbmp.cpp index 9f92b3c8fc..e443eb4147 100644 --- a/src/common/imagbmp.cpp +++ b/src/common/imagbmp.cpp @@ -68,9 +68,9 @@ bool wxBMPHandler::SaveFile(wxImage *image, } unsigned width = image->GetWidth(); - unsigned row_width = width * 3 + + unsigned row_width = width * 3 + (((width % 4) == 0) ? 0 : (4 - (width * 3) % 4)); - // each row must be aligned to dwords + // each row must be aligned to dwords struct { // BitmapHeader: @@ -78,7 +78,7 @@ bool wxBMPHandler::SaveFile(wxImage *image, wxUint32 filesize; // total file size, inc. headers wxUint32 reserved; // for future use wxUint32 data_offset; // image data offset in the file - + // BitmapInfoHeader: wxUint32 bih_size; // 2nd part's size wxUint32 width, height; // bitmap's dimensions @@ -94,19 +94,19 @@ bool wxBMPHandler::SaveFile(wxImage *image, hdr.magic = wxUINT16_SWAP_ON_BE(0x4D42/*'BM'*/); hdr.filesize = wxUINT32_SWAP_ON_BE( - hdr_size + + hdr_size + row_width * image->GetHeight() ); hdr.reserved = 0; hdr.data_offset = wxUINT32_SWAP_ON_BE(hdr_size); - + hdr.bih_size = wxUINT32_SWAP_ON_BE(hdr_size - 14); hdr.width = wxUINT32_SWAP_ON_BE(image->GetWidth()); hdr.height = wxUINT32_SWAP_ON_BE(image->GetHeight()); hdr.planes = wxUINT16_SWAP_ON_BE(1); // always 1 plane hdr.bpp = wxUINT16_SWAP_ON_BE(24); // always TrueColor hdr.compression = 0; // RGB uncompressed - hdr.size_of_bmp = wxUINT32_SWAP_ON_BE(row_width * image->GetHeight()); + hdr.size_of_bmp = wxUINT32_SWAP_ON_BE(row_width * image->GetHeight()); hdr.h_res = hdr.v_res = wxUINT32_SWAP_ON_BE(72); // 72dpi is standard hdr.num_clrs = 0; // maximal possible = 2^24 hdr.num_signif_clrs = 0; // all colors are significant @@ -129,7 +129,7 @@ bool wxBMPHandler::SaveFile(wxImage *image, !stream.Write(&hdr.v_res, 4) || !stream.Write(&hdr.num_clrs, 4) || !stream.Write(&hdr.num_signif_clrs, 4) - ) + ) { if (verbose) wxLogError(_("BMP: Couldn't write the file header.")); @@ -151,7 +151,7 @@ bool wxBMPHandler::SaveFile(wxImage *image, buffer[3 * x + 0] = buffer[3 * x + 2]; buffer[3 * x + 2] = tmpvar; } - + if (!stream.Write(buffer, row_width)) { if (verbose) @@ -185,8 +185,8 @@ bool wxBMPHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose int rshift = 0, gshift = 0, bshift = 0; wxUint8 aByte; wxUint16 aWord; - wxInt32 dbuf[4], aDword, - rmask = 0, gmask = 0, bmask = 0; + wxInt32 dbuf[4]; + wxInt32 aDword, rmask = 0, gmask = 0, bmask = 0; wxInt8 bbuf[4]; struct _cmap { unsigned char r, g, b; @@ -201,7 +201,7 @@ bool wxBMPHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose * Read the BMP header */ - stream.Read( &bbuf, 2 ); + stream.Read( bbuf, 2 ); stream.Read( dbuf, 4 * 4 ); #if 0 // unused @@ -487,7 +487,7 @@ bool wxBMPHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose } else if (bpp == 24) { - stream.Read( &bbuf, 3 ); + stream.Read( bbuf, 3 ); linepos += 3; ptr[poffset ] = (unsigned char)bbuf[2]; ptr[poffset + 1] = (unsigned char)bbuf[1]; @@ -543,7 +543,7 @@ bool wxBMPHandler::DoCanRead( wxInputStream& stream ) { unsigned char hdr[2]; - stream.Read(&hdr, 2); + stream.Read(hdr, 2); stream.SeekI(-2, wxFromCurrent); return (hdr[0] == 'B' && hdr[1] == 'M'); } diff --git a/src/common/image.cpp b/src/common/image.cpp index c19e9da9d7..ece331c695 100644 --- a/src/common/image.cpp +++ b/src/common/image.cpp @@ -414,31 +414,31 @@ void wxImage::Paste( const wxImage &image, int x, int y ) } return; } - + if (!HasMask() && image.HasMask()) { unsigned char r = image.GetMaskRed(); unsigned char g = image.GetMaskGreen(); unsigned char b = image.GetMaskBlue(); - + width *= 3; unsigned char* source_data = image.GetData() + xx*3 + yy*3*image.GetWidth(); int source_step = image.GetWidth()*3; unsigned char* target_data = GetData() + (x+xx)*3 + (y+yy)*3*M_IMGDATA->m_width; int target_step = M_IMGDATA->m_width*3; - + for (int j = 0; j < height; j++) { for (int i = 0; i < width; i+=3) { - if ((source_data[i] != r) && - (source_data[i+1] != g) && + if ((source_data[i] != r) && + (source_data[i+1] != g) && (source_data[i+2] != b)) { memcpy( target_data+i, source_data+i, 3 ); } - } + } source_data += source_step; target_data += target_step; } @@ -1140,7 +1140,8 @@ unsigned long wxImage::CountColours( unsigned long stopafter ) { wxHashTable h; wxObject dummy; - unsigned char r, g, b, *p; + unsigned char r, g, b; + unsigned char *p; unsigned long size, nentries, key; p = GetData(); @@ -1174,7 +1175,8 @@ unsigned long wxImage::CountColours( unsigned long stopafter ) // unsigned long wxImage::ComputeHistogram( wxHashTable &h ) { - unsigned char r, g, b, *p; + unsigned char r, g, b; + unsigned char *p; unsigned long size, nentries, key; wxHNode *hnode; diff --git a/src/common/imagjpeg.cpp b/src/common/imagjpeg.cpp index 8e760ef7b1..1e8457fc9b 100644 --- a/src/common/imagjpeg.cpp +++ b/src/common/imagjpeg.cpp @@ -29,9 +29,6 @@ #include "wx/app.h" extern "C" { -#ifdef __WATCOMC__ - #define HAVE_BOOLEAN -#endif #include "jpeglib.h" } #include "wx/filefn.h" @@ -102,7 +99,7 @@ METHODDEF(void) my_skip_input_data ( j_decompress_ptr cinfo, long num_bytes ) { my_src_ptr src = (my_src_ptr) cinfo->src; - while (num_bytes > (long)src->pub.bytes_in_buffer) + while (num_bytes > (long)src->pub.bytes_in_buffer) { num_bytes -= (long) src->pub.bytes_in_buffer; src->pub.fill_input_buffer(cinfo); @@ -198,7 +195,7 @@ bool wxJPEGHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbos /* If we get here, the JPEG code has signaled an error. * We need to clean up the JPEG object, close the input file, and return. */ - if (verbose) + if (verbose) wxLogError(_("JPEG: Couldn't load - file is probably corrupted.")); jpeg_destroy_decompress(&cinfo); if (image->Ok()) image->Destroy(); @@ -306,12 +303,12 @@ bool wxJPEGHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbo if (!verbose) cinfo.err->output_message=NULL; /* Establish the setjmp return context for my_error_exit to use. */ - if (setjmp(jerr.setjmp_buffer)) + if (setjmp(jerr.setjmp_buffer)) { /* If we get here, the JPEG code has signaled an error. * We need to clean up the JPEG object, close the input file, and return. */ - if (verbose) + if (verbose) wxLogError(_("JPEG: Couldn't save image.")); jpeg_destroy_compress(&cinfo); return FALSE; @@ -357,7 +354,7 @@ bool wxJPEGHandler::DoCanRead( wxInputStream& stream ) { unsigned char hdr[2]; - stream.Read(&hdr, 2); + stream.Read(hdr, 2); stream.SeekI(-2, wxFromCurrent); return (hdr[0] == 0xFF && hdr[1] == 0xD8); } diff --git a/src/common/imagpcx.cpp b/src/common/imagpcx.cpp index d03735e4c5..846130b687 100644 --- a/src/common/imagpcx.cpp +++ b/src/common/imagpcx.cpp @@ -102,7 +102,7 @@ void RLEdecode(unsigned char *p, unsigned int size, wxInputStream& s) // if ((data & 0xC0) != 0xC0) { - *(p++) = data; + *(p++) = (unsigned char)data; size--; } else @@ -110,7 +110,7 @@ void RLEdecode(unsigned char *p, unsigned int size, wxInputStream& s) cont = data & 0x3F; data = (unsigned char)s.GetC(); for (i = 1; i <= cont; i++) - *(p++) = data; + *(p++) = (unsigned char)data; size -= cont; } } @@ -349,12 +349,12 @@ int SavePCX(wxImage *image, wxOutputStream& stream) hdr[HDR_ENCODING] = 1; hdr[HDR_NPLANES] = nplanes; hdr[HDR_BITSPERPIXEL] = 8; - hdr[HDR_BYTESPERLINE] = bytesperline % 256; - hdr[HDR_BYTESPERLINE + 1] = bytesperline / 256; - hdr[HDR_XMAX] = (width - 1) % 256; - hdr[HDR_XMAX + 1] = (width - 1) / 256; - hdr[HDR_YMAX] = (height - 1) % 256; - hdr[HDR_YMAX + 1] = (height - 1) / 256; + hdr[HDR_BYTESPERLINE] = (unsigned char)(bytesperline % 256); + hdr[HDR_BYTESPERLINE + 1] = (unsigned char)(bytesperline / 256); + hdr[HDR_XMAX] = (unsigned char)((width - 1) % 256); + hdr[HDR_XMAX + 1] = (unsigned char)((width - 1) / 256); + hdr[HDR_YMAX] = (unsigned char)((height - 1) % 256); + hdr[HDR_YMAX + 1] = (unsigned char)((height - 1) / 256); hdr[HDR_PALETTEINFO] = 1; stream.Write(hdr, 128); diff --git a/src/common/imagpng.cpp b/src/common/imagpng.cpp index f68cf59e5f..cbbc10b261 100644 --- a/src/common/imagpng.cpp +++ b/src/common/imagpng.cpp @@ -57,17 +57,19 @@ IMPLEMENT_DYNAMIC_CLASS(wxPNGHandler,wxImageHandler) #if wxUSE_LIBPNG #if defined(__VISAGECPP__) -#define LINKAGEMODE _Optlink +#define PNGLINKAGEMODE _Optlink +#elif defined(__WATCOMC__) +#define PNGLINKAGEMODE _cdecl #else -#define LINKAGEMODE +#define PNGLINKAGEMODE #endif -static void LINKAGEMODE _PNG_stream_reader( png_structp png_ptr, png_bytep data, png_size_t length ) +static void PNGLINKAGEMODE _PNG_stream_reader( png_structp png_ptr, png_bytep data, png_size_t length ) { ((wxInputStream*) png_get_io_ptr( png_ptr )) -> Read(data, length); } -static void LINKAGEMODE _PNG_stream_writer( png_structp png_ptr, png_bytep data, png_size_t length ) +static void PNGLINKAGEMODE _PNG_stream_writer( png_structp png_ptr, png_bytep data, png_size_t length ) { ((wxOutputStream*) png_get_io_ptr( png_ptr )) -> Write(data, length); } @@ -75,7 +77,7 @@ static void LINKAGEMODE _PNG_stream_writer( png_structp png_ptr, png_bytep data, // from pngerror.c // so that the libpng doesn't send anything on stderr void -LINKAGEMODE png_silent_error(png_structp png_ptr, png_const_charp WXUNUSED(message)) +PNGLINKAGEMODE png_silent_error(png_structp png_ptr, png_const_charp WXUNUSED(message)) { #ifdef USE_FAR_KEYWORD { @@ -89,7 +91,7 @@ LINKAGEMODE png_silent_error(png_structp png_ptr, png_const_charp WXUNUSED(messa } void -LINKAGEMODE png_silent_warning(png_structp WXUNUSED(png_ptr), png_const_charp WXUNUSED(message)) +PNGLINKAGEMODE png_silent_warning(png_structp WXUNUSED(png_ptr), png_const_charp WXUNUSED(message)) { } @@ -359,7 +361,7 @@ bool wxPNGHandler::DoCanRead( wxInputStream& stream ) { unsigned char hdr[4]; - stream.Read(&hdr, 4); + stream.Read(hdr, 4); stream.SeekI(-4, wxFromCurrent); return (hdr[0] == 0x89 && hdr[1] == 'P' && hdr[2] == 'N' && hdr[3] == 'G'); } diff --git a/src/common/imagxpm.cpp b/src/common/imagxpm.cpp index 7abef62368..39689e1f5f 100644 --- a/src/common/imagxpm.cpp +++ b/src/common/imagxpm.cpp @@ -94,7 +94,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxXPMHandler,wxImageHandler) #if wxUSE_STREAMS -bool wxXPMHandler::LoadFile(wxImage *image, +bool wxXPMHandler::LoadFile(wxImage *image, wxInputStream& stream, bool verbose, int WXUNUSED(index)) { @@ -108,20 +108,20 @@ bool wxXPMHandler::LoadFile(wxImage *image, } bool wxXPMHandler::SaveFile(wxImage * image, - wxOutputStream& stream, bool verbose) + wxOutputStream& stream, bool WXUNUSED(verbose)) { wxString tmp; char tmp_c; - + // 1. count colours: #define MaxCixels 92 - static const char Cixel[MaxCixels+1] = + static const char Cixel[MaxCixels+1] = " .XoO+@#$%&*=-;:>,<1234567890qwertyuipasdfghjk" "lzxcvbnmMNBVCZASDFGHJKLPIUYTREWQ!~^/()_`'][{}|"; int chars_per_pixel; int cols; int i, j, k; - + cols = image->CountColours(); chars_per_pixel = 1; for ( k = MaxCixels; cols > k; k *= MaxCixels) @@ -131,7 +131,7 @@ bool wxXPMHandler::SaveFile(wxImage * image, tmp.Printf("/* XPM */\n" "static char *xpm_data[] = {\n" "/* columns rows colors chars-per-pixel */\n" - "\"%i %i %i %i\",\n", + "\"%i %i %i %i\",\n", image->GetWidth(), image->GetHeight(), cols, chars_per_pixel); stream.Write(tmp.mb_str(), tmp.Length()); @@ -147,7 +147,7 @@ bool wxXPMHandler::SaveFile(wxImage * image, if (image->HasMask()) mask_key = (image->GetMaskRed() << 16) | (image->GetMaskGreen() << 8) | image->GetMaskBlue(); - + // 2b. generate colour table: table.BeginFind(); wxNode *node = NULL; @@ -174,7 +174,7 @@ bool wxXPMHandler::SaveFile(wxImage * image, else if (key == mask_key) tmp.Printf(wxT("\"%s c None\",\n"), sym); else - tmp.Printf(wxT("\"%s c #%s%s%s\",\n"), sym, + tmp.Printf(wxT("\"%s c #%s%s%s\",\n"), sym, wxDecToHex((unsigned char)(key >> 16)).c_str(), wxDecToHex((unsigned char)(key >> 8)).c_str(), wxDecToHex((unsigned char)(key)).c_str()); @@ -203,7 +203,7 @@ bool wxXPMHandler::SaveFile(wxImage * image, } tmp = wxT("};\n"); stream.Write(tmp.mb_str(), 3); - + delete[] symbols; delete[] symbols_data; diff --git a/src/common/memory.cpp b/src/common/memory.cpp index afac3b1f74..2f97c44bd0 100644 --- a/src/common/memory.cpp +++ b/src/common/memory.cpp @@ -711,6 +711,7 @@ bool wxDebugContext::Dump(void) #endif } +#ifdef __WXDEBUG__ struct wxDebugStatsStruct { long instanceCount; @@ -735,6 +736,7 @@ static wxDebugStatsStruct *InsertStatsStruct(wxDebugStatsStruct *head, wxDebugSt st->next = head; return st; } +#endif bool wxDebugContext::PrintStatistics(bool detailed) { @@ -832,6 +834,7 @@ bool wxDebugContext::PrintStatistics(bool detailed) return TRUE; #else + (void)detailed; return FALSE; #endif } @@ -1051,7 +1054,7 @@ void wxDebugFree(void * buf, bool WXUNUSED(isVect) ) } // Trace: send output to the current debugging stream -void wxTrace(const wxChar *fmt ...) +void wxTrace(const wxChar * ...) { #if 1 wxFAIL_MSG(wxT("wxTrace is now obsolete. Please use wxDebugXXX instead.")); @@ -1088,7 +1091,7 @@ void wxTrace(const wxChar *fmt ...) } // Trace with level -void wxTraceLevel(int level, const wxChar *fmt ...) +void wxTraceLevel(int, const wxChar * ...) { #if 1 wxFAIL_MSG(wxT("wxTrace is now obsolete. Please use wxDebugXXX instead.")); diff --git a/src/common/mimecmn.cpp b/src/common/mimecmn.cpp index a4785b974d..3ddea52b66 100644 --- a/src/common/mimecmn.cpp +++ b/src/common/mimecmn.cpp @@ -388,7 +388,6 @@ bool wxFileType::Unassociate() #elif defined(__UNIX__) return m_impl->Unassociate(this); #else - wxFAIL_MSG( _T("not implemented") ); // TODO return FALSE; #endif @@ -401,7 +400,6 @@ bool overwriteprompt) return m_impl->SetCommand(cmd, verb, overwriteprompt); #else wxFAIL_MSG(_T("not implemented")); - return FALSE; #endif } @@ -587,6 +585,9 @@ void wxMimeTypesManager::Initialize(int mcapStyle, EnsureImpl(); m_impl->Initialize(mcapStyle, sExtraDir); +#else + (void)mcapStyle; + (void)sExtraDir; #endif // Unix } diff --git a/src/common/resource.cpp b/src/common/resource.cpp index ff8d62e2c9..bef7bdb0e4 100644 --- a/src/common/resource.cpp +++ b/src/common/resource.cpp @@ -175,10 +175,10 @@ void wxResourceTable::AddResource(wxItemResource *item) name = item->GetTitle(); if (name == wxT("")) name = wxT("no name"); - + // Delete existing resource, if any. Delete(name); - + Put(name, item); } @@ -202,7 +202,7 @@ bool wxResourceTable::DeleteResource(const wxString& name) } node = Next(); } - + delete item; return TRUE; } @@ -214,7 +214,7 @@ bool wxResourceTable::ParseResourceFile( wxInputStream *is ) { wxExprDatabase db; int len = is->StreamSize() ; - + bool eof = FALSE; while ( is->TellI() + 10 < len) // it's a hack because the streams dont support EOF { @@ -226,7 +226,7 @@ bool wxResourceTable::ParseResourceFile( wxInputStream *is ) bool wxResourceTable::ParseResourceFile(const wxString& filename) { wxExprDatabase db; - + #if defined(__WXMAC__) && !defined(__UNIX__) FILE *fd = fopen(wxUnix2MacFilename(filename.fn_str()), "r"); #else @@ -251,7 +251,7 @@ bool wxResourceTable::ParseResourceData(const wxString& data) wxLogWarning(_("Ill-formed resource file syntax.")); return FALSE; } - + return wxResourceInterpretResources(*this, db); } @@ -305,12 +305,12 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c int id = childResource->GetId(); if ( id == 0 ) id = -1; - + bool dlgUnits = ((parentResource->GetResourceStyle() & wxRESOURCE_DIALOG_UNITS) != 0); - + wxControl *control = (wxControl *) NULL; wxString itemType(childResource->GetType()); - + wxPoint pos; wxSize size; if (dlgUnits) @@ -323,7 +323,7 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c pos = wxPoint(childResource->GetX(), childResource->GetY()); size = wxSize(childResource->GetWidth(), childResource->GetHeight()); } - + if (itemType == wxString(wxT("wxButton")) || itemType == wxString(wxT("wxBitmapButton"))) { if (childResource->GetValue4() != wxT("")) @@ -363,7 +363,7 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c if (!bitmap.Ok()) bitmap.LoadFile("cross_bmp", wxBITMAP_TYPE_BMP_RESOURCE); #endif - + if (bitmap.Ok()) control = new wxStaticBitmap(parent, id, bitmap, pos, size, childResource->GetStyle(), childResource->GetName()); @@ -384,7 +384,7 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c { control = new wxCheckBox(parent, id, childResource->GetTitle(), pos, size, childResource->GetStyle(), wxDefaultValidator, childResource->GetName()); - + ((wxCheckBox *)control)->SetValue((childResource->GetValue1() != 0)); } #if wxUSE_GAUGE @@ -392,7 +392,7 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c { control = new wxGauge(parent, id, (int)childResource->GetValue2(), pos, size, childResource->GetStyle(), wxDefaultValidator, childResource->GetName()); - + ((wxGauge *)control)->SetValue((int)childResource->GetValue1()); } #endif @@ -417,7 +417,7 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c */ ((wxScrollBar *)control)->SetScrollbar((int)childResource->GetValue1(),(int)childResource->GetValue2(), (int)childResource->GetValue3(),(int)(long)childResource->GetValue5(),FALSE); - + } #endif else if (itemType == wxString(wxT("wxSlider"))) @@ -451,7 +451,7 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c } control = new wxListBox(parent, id, pos, size, noStrings, strings, childResource->GetStyle(), wxDefaultValidator, childResource->GetName()); - + if (strings) delete[] strings; } @@ -475,7 +475,7 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c } control = new wxChoice(parent, id, pos, size, noStrings, strings, childResource->GetStyle(), wxDefaultValidator, childResource->GetName()); - + if (strings) delete[] strings; } @@ -500,7 +500,7 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c } control = new wxComboBox(parent, id, childResource->GetValue4(), pos, size, noStrings, strings, childResource->GetStyle(), wxDefaultValidator, childResource->GetName()); - + if (strings) delete[] strings; } @@ -526,11 +526,11 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c control = new wxRadioBox(parent, (wxWindowID) id, wxString(childResource->GetTitle()), pos, size, noStrings, strings, (int)childResource->GetValue1(), childResource->GetStyle(), wxDefaultValidator, childResource->GetName()); - + if (strings) delete[] strings; } - + if ((parentResource->GetResourceStyle() & wxRESOURCE_USE_DEFAULTS) != 0) { // Don't set font; will be inherited from parent. @@ -540,7 +540,7 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c if (control && childResource->GetFont().Ok()) { control->SetFont(childResource->GetFont()); - + #ifdef __WXMSW__ // Force the layout algorithm since the size changes the layout if (control->IsKindOf(CLASSINFO(wxRadioBox))) @@ -564,7 +564,7 @@ bool wxResourceInterpretResources(wxResourceTable& table, wxExprDatabase& db) { wxExpr *clause = (wxExpr *)node->Data(); wxString functor(clause->Functor()); - + wxItemResource *item = (wxItemResource *) NULL; if (functor == wxT("dialog")) item = wxResourceInterpretDialog(table, clause); @@ -580,7 +580,7 @@ bool wxResourceInterpretResources(wxResourceTable& table, wxExprDatabase& db) item = wxResourceInterpretBitmap(table, clause); else if (functor == wxT("icon")) item = wxResourceInterpretIcon(table, clause); - + if (item) { // Remove any existing resource of same name @@ -640,11 +640,11 @@ wxItemResource *wxResourceInterpretDialog(wxResourceTable& table, wxExpr *expr, wxString backColourHex = wxT(""); wxString labelColourHex = wxT(""); wxString buttonColourHex = wxT(""); - + long windowStyle = wxDEFAULT_DIALOG_STYLE; if (isPanel) windowStyle = 0; - + int x = 0; int y = 0; int width = -1; int height = -1; int isModal = 0; wxExpr *labelFontExpr = (wxExpr *) NULL; @@ -664,21 +664,21 @@ wxItemResource *wxResourceInterpretDialog(wxResourceTable& table, wxExpr *expr, expr->GetAttributeValue(wxT("background_colour"), backColourHex); expr->GetAttributeValue(wxT("label_colour"), labelColourHex); expr->GetAttributeValue(wxT("button_colour"), buttonColourHex); - + int useDialogUnits = 0; expr->GetAttributeValue(wxT("use_dialog_units"), useDialogUnits); if (useDialogUnits != 0) dialogItem->SetResourceStyle(dialogItem->GetResourceStyle() | wxRESOURCE_DIALOG_UNITS); - + int useDefaults = 0; expr->GetAttributeValue(wxT("use_system_defaults"), useDefaults); if (useDefaults != 0) dialogItem->SetResourceStyle(dialogItem->GetResourceStyle() | wxRESOURCE_USE_DEFAULTS); - + int id = 0; expr->GetAttributeValue(wxT("id"), id); dialogItem->SetId(id); - + if (style != wxT("")) { windowStyle = wxParseWindowStyle(style); @@ -687,7 +687,7 @@ wxItemResource *wxResourceInterpretDialog(wxResourceTable& table, wxExpr *expr, dialogItem->SetValue1(isModal); if (windowStyle & wxDIALOG_MODAL) // Uses style in wxWin 2 dialogItem->SetValue1(TRUE); - + dialogItem->SetName(name); dialogItem->SetTitle(title); dialogItem->SetSize(x, y, width, height); @@ -696,8 +696,8 @@ wxItemResource *wxResourceInterpretDialog(wxResourceTable& table, wxExpr *expr, if (style.Find(wxT("VERTICAL_LABEL")) != -1) dialogItem->SetResourceStyle(dialogItem->GetResourceStyle() | wxRESOURCE_VERTICAL_LABEL); else if (style.Find(wxT("HORIZONTAL_LABEL")) != -1) - dialogItem->SetResourceStyle(dialogItem->GetResourceStyle() | wxRESOURCE_HORIZONTAL_LABEL); - + dialogItem->SetResourceStyle(dialogItem->GetResourceStyle() | wxRESOURCE_HORIZONTAL_LABEL); + if (backColourHex != wxT("")) { int r = 0; @@ -728,14 +728,14 @@ wxItemResource *wxResourceInterpretDialog(wxResourceTable& table, wxExpr *expr, b = wxHexToDec(buttonColourHex.Mid(4, 2)); dialogItem->SetButtonColour(wxColour((unsigned char)r,(unsigned char)g,(unsigned char)b)); } - + if (fontExpr) dialogItem->SetFont(wxResourceInterpretFontSpec(fontExpr)); else if (buttonFontExpr) dialogItem->SetFont(wxResourceInterpretFontSpec(buttonFontExpr)); else if (labelFontExpr) dialogItem->SetFont(wxResourceInterpretFontSpec(labelFontExpr)); - + // Now parse all controls wxExpr *controlExpr = expr->GetFirst(); while (controlExpr) @@ -765,10 +765,10 @@ wxItemResource *wxResourceInterpretDialog(wxResourceTable& table, wxExpr *expr, wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) { wxItemResource *controlItem = new wxItemResource; - + // First, find the standard features of a control definition: // [optional integer/string id], control name, title, style, name, x, y, width, height - + wxString controlType; wxString style; wxString title; @@ -777,9 +777,9 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) long windowStyle = 0; int x = 0; int y = 0; int width = -1; int height = -1; int count = 0; - + wxExpr *expr1 = expr->Nth(0); - + if ( expr1->Type() == PrologString || expr1->Type() == PrologWord ) { if ( wxIsValidControlClass(expr1->StringValue()) ) @@ -813,12 +813,12 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) controlType = expr->Nth(1)->StringValue(); count = 2; } - + expr1 = expr->Nth(count); count ++; if ( expr1 ) title = expr1->StringValue(); - + expr1 = expr->Nth(count); count ++; if (expr1) @@ -826,32 +826,32 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) style = expr1->StringValue(); windowStyle = wxParseWindowStyle(style); } - + expr1 = expr->Nth(count); count ++; if (expr1) name = expr1->StringValue(); - + expr1 = expr->Nth(count); count ++; if (expr1) x = (int)expr1->IntegerValue(); - + expr1 = expr->Nth(count); count ++; if (expr1) y = (int)expr1->IntegerValue(); - + expr1 = expr->Nth(count); count ++; if (expr1) width = (int)expr1->IntegerValue(); - + expr1 = expr->Nth(count); count ++; if (expr1) height = (int)expr1->IntegerValue(); - + controlItem->SetStyle(windowStyle); controlItem->SetName(name); controlItem->SetTitle(title); @@ -864,7 +864,7 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) controlItem->SetResourceStyle(controlItem->GetResourceStyle() | wxRESOURCE_VERTICAL_LABEL); else if (style.Find(wxT("HORIZONTAL_LABEL")) != -1) controlItem->SetResourceStyle(controlItem->GetResourceStyle() | wxRESOURCE_HORIZONTAL_LABEL); - + if (controlType == wxT("wxButton")) { // Check for bitmap resource name (in case loading old-style resource file) @@ -872,7 +872,7 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) { wxString str(expr->Nth(count)->StringValue()); count ++; - + if (str != wxT("")) { controlItem->SetValue4(str); @@ -926,7 +926,7 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) wxString str(expr->Nth(count)->StringValue()); controlItem->SetValue4(str); count ++; - + if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList) { // controlItem->SetLabelFont(wxResourceInterpretFontSpec(expr->Nth(count))); @@ -974,13 +974,13 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) { controlItem->SetValue1(expr->Nth(count)->IntegerValue()); count ++; - + // Check for range if (expr->Nth(count) && (expr->Nth(count)->Type() == PrologInteger)) { controlItem->SetValue2(expr->Nth(count)->IntegerValue()); count ++; - + if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList) { // Skip past the obsolete label font spec if there are two consecutive specs @@ -998,25 +998,25 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) { controlItem->SetValue1(expr->Nth(count)->IntegerValue()); count ++; - + // Check for min if (expr->Nth(count) && (expr->Nth(count)->Type() == PrologInteger)) { controlItem->SetValue2(expr->Nth(count)->IntegerValue()); count ++; - + // Check for max if (expr->Nth(count) && (expr->Nth(count)->Type() == PrologInteger)) { controlItem->SetValue3(expr->Nth(count)->IntegerValue()); count ++; - + if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList) { // controlItem->SetLabelFont(wxResourceInterpretFontSpec(expr->Nth(count))); // do nothing count ++; - + if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList) controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count))); } @@ -1031,19 +1031,19 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) { controlItem->SetValue1(expr->Nth(count)->IntegerValue()); count ++; - + // PAGE LENGTH if (expr->Nth(count) && (expr->Nth(count)->Type() == PrologInteger)) { controlItem->SetValue2(expr->Nth(count)->IntegerValue()); count ++; - + // OBJECT LENGTH if (expr->Nth(count) && (expr->Nth(count)->Type() == PrologInteger)) { controlItem->SetValue3(expr->Nth(count)->IntegerValue()); count ++; - + // VIEW LENGTH if (expr->Nth(count) && (expr->Nth(count)->Type() == PrologInteger)) controlItem->SetValue5(expr->Nth(count)->IntegerValue()); @@ -1054,9 +1054,8 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) else if (controlType == wxT("wxListBox")) { wxExpr *valueList = (wxExpr *) NULL; - - valueList = expr->Nth(count); - if (valueList && (valueList->Type() == PrologList)) + + if (((valueList = expr->Nth(count)) != 0) && (valueList->Type() == PrologList)) { wxStringList stringList; wxExpr *stringExpr = valueList->GetFirst(); @@ -1073,8 +1072,7 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) /* controlItem->SetValue1(wxLB_SINGLE); */ - mult = expr->Nth(count); - if (mult && ((mult->Type() == PrologString)||(mult->Type() == PrologWord))) + if (((mult = expr->Nth(count)) != 0) && ((mult->Type() == PrologString)||(mult->Type() == PrologWord))) { /* wxString m(mult->StringValue()); @@ -1099,8 +1097,7 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) { wxExpr *valueList = (wxExpr *) NULL; // Check for default value list - valueList = expr->Nth(count); - if (valueList && (valueList->Type() == PrologList)) + if (((valueList = expr->Nth(count)) != 0) && (valueList->Type() == PrologList)) { wxStringList stringList; wxExpr *stringExpr = valueList->GetFirst(); @@ -1110,9 +1107,9 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) stringExpr = stringExpr->GetNext(); } controlItem->SetStringValues(stringList); - + count ++; - + if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList) { // Skip past the obsolete label font spec if there are two consecutive specs @@ -1130,13 +1127,12 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) { wxString str(textValue->StringValue()); controlItem->SetValue4(str); - + count ++; - + wxExpr *valueList = (wxExpr *) NULL; // Check for default value list - valueList = expr->Nth(count); - if (valueList && (valueList->Type() == PrologList)) + if (((valueList = expr->Nth(count)) != 0) && (valueList->Type() == PrologList)) { wxStringList stringList; wxExpr *stringExpr = valueList->GetFirst(); @@ -1146,9 +1142,9 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) stringExpr = stringExpr->GetNext(); } controlItem->SetStringValues(stringList); - + count ++; - + if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList) { // Skip past the obsolete label font spec if there are two consecutive specs @@ -1165,8 +1161,7 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) { wxExpr *valueList = (wxExpr *) NULL; // Check for default value list - valueList = expr->Nth(count); - if (valueList && (valueList->Type() == PrologList)) + if (((valueList = expr->Nth(count)) != 0) && (valueList->Type() == PrologList)) { wxStringList stringList; wxExpr *stringExpr = valueList->GetFirst(); @@ -1177,7 +1172,7 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) } controlItem->SetStringValues(stringList); count ++; - + // majorDim (number of rows or cols) if (expr->Nth(count) && (expr->Nth(count)->Type() == PrologInteger)) { @@ -1186,7 +1181,7 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) } else controlItem->SetValue1(0); - + if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList) { // Skip past the obsolete label font spec if there are two consecutive specs @@ -1215,12 +1210,12 @@ wxItemResource *wxResourceInterpretMenu1(wxResourceTable& table, wxExpr *expr); wxItemResource *wxResourceInterpretMenuItem(wxResourceTable& table, wxExpr *expr) { wxItemResource *item = new wxItemResource; - + wxExpr *labelExpr = expr->Nth(0); wxExpr *idExpr = expr->Nth(1); wxExpr *helpExpr = expr->Nth(2); wxExpr *checkableExpr = expr->Nth(3); - + // Further keywords/attributes to follow sometime... if (expr->Number() == 0) { @@ -1262,12 +1257,12 @@ wxItemResource *wxResourceInterpretMenuItem(wxResourceTable& table, wxExpr *expr } if (checkableExpr) item->SetValue2(checkableExpr->IntegerValue()); - + // Find the first expression that's a list, for submenu wxExpr *subMenuExpr = expr->GetFirst(); while (subMenuExpr && (subMenuExpr->Type() != PrologList)) subMenuExpr = subMenuExpr->GetNext(); - + while (subMenuExpr) { wxItemResource *child = wxResourceInterpretMenuItem(table, subMenuExpr); @@ -1305,18 +1300,18 @@ wxItemResource *wxResourceInterpretMenu(wxResourceTable& table, wxExpr *expr) expr->GetAttributeValue(wxT("menu"), &listExpr); if (!listExpr) return (wxItemResource *) NULL; - + wxItemResource *menuResource = wxResourceInterpretMenuItem(table, listExpr); - + if (!menuResource) return (wxItemResource *) NULL; - + wxString name; if (expr->GetAttributeValue(wxT("name"), name)) { menuResource->SetName(name); } - + return menuResource; } @@ -1326,11 +1321,11 @@ wxItemResource *wxResourceInterpretMenuBar(wxResourceTable& table, wxExpr *expr) expr->GetAttributeValue(wxT("menu"), &listExpr); if (!listExpr) return (wxItemResource *) NULL; - + wxItemResource *resource = new wxItemResource; resource->SetType(wxT("wxMenu")); // resource->SetType(wxTYPE_MENU); - + wxExpr *element = listExpr->GetFirst(); while (element) { @@ -1338,13 +1333,13 @@ wxItemResource *wxResourceInterpretMenuBar(wxResourceTable& table, wxExpr *expr) resource->GetChildren().Append(menuResource); element = element->GetNext(); } - + wxString name; if (expr->GetAttributeValue(wxT("name"), name)) { resource->SetName(name); } - + return resource; } @@ -1379,7 +1374,7 @@ wxItemResource *wxResourceInterpretBitmap(wxResourceTable& WXUNUSED(table), wxEx wxItemResource *bitmapSpec = new wxItemResource; // bitmapSpec->SetType(wxTYPE_BITMAP); bitmapSpec->SetType(wxT("wxBitmap")); - + // List is of form: [filename, bitmaptype, platform, colours, xresolution, yresolution] // where everything after 'filename' is optional. wxExpr *nameExpr = listExpr->Nth(0); @@ -1398,7 +1393,7 @@ wxItemResource *wxResourceInterpretBitmap(wxResourceTable& WXUNUSED(table), wxEx } else bitmapSpec->SetValue1(0); - + if (platformExpr && platformExpr->StringValue() != wxT("")) { wxString plat(platformExpr->StringValue()); @@ -1413,7 +1408,7 @@ wxItemResource *wxResourceInterpretBitmap(wxResourceTable& WXUNUSED(table), wxEx } else bitmapSpec->SetValue2(RESOURCE_PLATFORM_ANY); - + if (coloursExpr) bitmapSpec->SetValue3(coloursExpr->IntegerValue()); int xres = 0; @@ -1423,14 +1418,14 @@ wxItemResource *wxResourceInterpretBitmap(wxResourceTable& WXUNUSED(table), wxEx if (yresExpr) yres = (int)yresExpr->IntegerValue(); bitmapSpec->SetSize(0, 0, xres, yres); - + bitmapItem->GetChildren().Append(bitmapSpec); } } } bitmapExpr = bitmapExpr->GetNext(); } - + return bitmapItem; } @@ -1452,14 +1447,14 @@ wxFont wxResourceInterpretFontSpec(wxExpr *expr) { if (expr->Type() != PrologList) return wxNullFont; - + int point = 10; int family = wxSWISS; int style = wxNORMAL; int weight = wxNORMAL; int underline = 0; wxString faceName(wxT("")); - + wxExpr *pointExpr = expr->Nth(0); wxExpr *familyExpr = expr->Nth(1); wxExpr *styleExpr = expr->Nth(2); @@ -1468,7 +1463,7 @@ wxFont wxResourceInterpretFontSpec(wxExpr *expr) wxExpr *faceNameExpr = expr->Nth(5); if (pointExpr) point = (int)pointExpr->IntegerValue(); - + wxString str; if (familyExpr) { @@ -1489,7 +1484,7 @@ wxFont wxResourceInterpretFontSpec(wxExpr *expr) underline = (int)underlineExpr->IntegerValue(); if (faceNameExpr) faceName = faceNameExpr->StringValue(); - + wxFont font(point, family, style, weight, (underline != 0), faceName); return font; } @@ -1524,7 +1519,7 @@ bool wxReallocateResourceBuffer() static bool wxEatWhiteSpace(FILE *fd) { int ch = 0; - + while ((ch = getc(fd)) != EOF) { switch (ch) @@ -1543,7 +1538,7 @@ static bool wxEatWhiteSpace(FILE *fd) ungetc(prev_ch, fd); return TRUE; } - + if (ch == '*') { // Eat C comment @@ -1572,7 +1567,7 @@ static bool wxEatWhiteSpace(FILE *fd) default: ungetc(ch, fd); return TRUE; - + } } return FALSE; @@ -1585,7 +1580,7 @@ static bool wxEatWhiteSpace(wxInputStream *is) is->Ungetch(ch); return TRUE; } - + // Eat whitespace while (ch == ' ' || ch == 10 || ch == 13 || ch == 9) ch = is->GetC(); @@ -1627,7 +1622,7 @@ bool wxGetResourceToken(FILE *fd) wxReallocateResourceBuffer(); wxResourceBuffer[0] = 0; wxEatWhiteSpace(fd); - + int ch = getc(fd); if (ch == '"') { @@ -1655,7 +1650,7 @@ bool wxGetResourceToken(FILE *fd) ungetc(newCh, fd); } } - + if (wxResourceBufferCount >= wxResourceBufferSize-1) wxReallocateResourceBuffer(); wxResourceBuffer[wxResourceBufferCount] = (char)actualCh; @@ -1674,7 +1669,7 @@ bool wxGetResourceToken(FILE *fd) wxReallocateResourceBuffer(); wxResourceBuffer[wxResourceBufferCount] = (char)ch; wxResourceBufferCount ++; - + ch = getc(fd); } wxResourceBuffer[wxResourceBufferCount] = 0; @@ -1690,7 +1685,7 @@ bool wxGetResourceToken(wxInputStream *is) wxReallocateResourceBuffer(); wxResourceBuffer[0] = 0; wxEatWhiteSpace(is); - + int ch = is->GetC() ; if (ch == '"') { @@ -1720,7 +1715,7 @@ bool wxGetResourceToken(wxInputStream *is) is->Ungetch(newCh); } } - + if (wxResourceBufferCount >= wxResourceBufferSize-1) wxReallocateResourceBuffer(); wxResourceBuffer[wxResourceBufferCount] = (char)actualCh; @@ -1739,7 +1734,7 @@ bool wxGetResourceToken(wxInputStream *is) wxReallocateResourceBuffer(); wxResourceBuffer[wxResourceBufferCount] = (char)ch; wxResourceBufferCount ++; - + ch = is->GetC(); } wxResourceBuffer[wxResourceBufferCount] = 0; @@ -1759,14 +1754,14 @@ bool wxResourceReadOneResource(FILE *fd, wxExprDatabase& db, bool *eof, wxResour { if (!table) table = wxDefaultResourceTable; - + // static or #define if (!wxGetResourceToken(fd)) { *eof = TRUE; return FALSE; } - + if (strcmp(wxResourceBuffer, "#define") == 0) { wxGetResourceToken(fd); @@ -1787,7 +1782,7 @@ bool wxResourceReadOneResource(FILE *fd, wxExprDatabase& db, bool *eof, wxResour } delete[] name; delete[] value; - + return TRUE; } else if (strcmp(wxResourceBuffer, "#include") == 0) @@ -1816,7 +1811,7 @@ bool wxResourceReadOneResource(FILE *fd, wxExprDatabase& db, bool *eof, wxResour wxLogWarning(buf); return FALSE; } - + // char if (!wxGetResourceToken(fd)) { @@ -1824,13 +1819,13 @@ bool wxResourceReadOneResource(FILE *fd, wxExprDatabase& db, bool *eof, wxResour *eof = TRUE; return FALSE; } - + if (strcmp(wxResourceBuffer, "char") != 0) { wxLogWarning(_("Expected 'char' whilst parsing resource.")); return FALSE; } - + // *name if (!wxGetResourceToken(fd)) { @@ -1838,7 +1833,7 @@ bool wxResourceReadOneResource(FILE *fd, wxExprDatabase& db, bool *eof, wxResour *eof = TRUE; return FALSE; } - + if (wxResourceBuffer[0] != '*') { wxLogWarning(_("Expected '*' whilst parsing resource.")); @@ -1847,7 +1842,7 @@ bool wxResourceReadOneResource(FILE *fd, wxExprDatabase& db, bool *eof, wxResour wxChar nameBuf[100]; wxMB2WX(nameBuf, wxResourceBuffer+1, 99); nameBuf[99] = 0; - + // = if (!wxGetResourceToken(fd)) { @@ -1855,13 +1850,13 @@ bool wxResourceReadOneResource(FILE *fd, wxExprDatabase& db, bool *eof, wxResour *eof = TRUE; return FALSE; } - + if (strcmp(wxResourceBuffer, "=") != 0) { wxLogWarning(_("Expected '=' whilst parsing resource.")); return FALSE; } - + // String if (!wxGetResourceToken(fd)) { @@ -1889,14 +1884,14 @@ bool wxResourceReadOneResource(wxInputStream *fd, wxExprDatabase& db, bool *eof, { if (!table) table = wxDefaultResourceTable; - + // static or #define if (!wxGetResourceToken(fd)) { *eof = TRUE; return FALSE; } - + if (strcmp(wxResourceBuffer, "#define") == 0) { wxGetResourceToken(fd); @@ -1917,7 +1912,7 @@ bool wxResourceReadOneResource(wxInputStream *fd, wxExprDatabase& db, bool *eof, } delete[] name; delete[] value; - + return TRUE; } else if (strcmp(wxResourceBuffer, "#include") == 0) @@ -1946,7 +1941,7 @@ bool wxResourceReadOneResource(wxInputStream *fd, wxExprDatabase& db, bool *eof, wxLogWarning(buf); return FALSE; } - + // char if (!wxGetResourceToken(fd)) { @@ -1954,13 +1949,13 @@ bool wxResourceReadOneResource(wxInputStream *fd, wxExprDatabase& db, bool *eof, *eof = TRUE; return FALSE; } - + if (strcmp(wxResourceBuffer, "char") != 0) { wxLogWarning(_("Expected 'char' whilst parsing resource.")); return FALSE; } - + // *name if (!wxGetResourceToken(fd)) { @@ -1968,7 +1963,7 @@ bool wxResourceReadOneResource(wxInputStream *fd, wxExprDatabase& db, bool *eof, *eof = TRUE; return FALSE; } - + if (wxResourceBuffer[0] != '*') { wxLogWarning(_("Expected '*' whilst parsing resource.")); @@ -1976,7 +1971,7 @@ bool wxResourceReadOneResource(wxInputStream *fd, wxExprDatabase& db, bool *eof, } char nameBuf[100]; strncpy(nameBuf, wxResourceBuffer+1, 99); - + // = if (!wxGetResourceToken(fd)) { @@ -1984,13 +1979,13 @@ bool wxResourceReadOneResource(wxInputStream *fd, wxExprDatabase& db, bool *eof, *eof = TRUE; return FALSE; } - + if (strcmp(wxResourceBuffer, "=") != 0) { wxLogWarning(_("Expected '=' whilst parsing resource.")); return FALSE; } - + // String if (!wxGetResourceToken(fd)) { @@ -2027,7 +2022,7 @@ wxChar* wxResourceParseWord(wxChar*s, int *i) { if (!s) return (wxChar*) NULL; - + static wxChar buf[150]; int len = wxStrlen(s); int j = 0; @@ -2039,7 +2034,7 @@ wxChar* wxResourceParseWord(wxChar*s, int *i) ii ++; } buf[j] = 0; - + // Eat whitespace and conjunction characters while ((ii < len) && ((s[ii] == wxT(' ')) || (s[ii] == wxT('|')) || (s[ii] == wxT(',')))) @@ -2073,18 +2068,18 @@ static wxResourceBitListStruct wxResourceBitListTable[] = { wxT("wxLB_SORT"), wxLB_SORT }, { wxT("wxLB_OWNERDRAW"), wxLB_OWNERDRAW }, { wxT("wxLB_HSCROLL"), wxLB_HSCROLL }, - + /* wxComboxBox */ { wxT("wxCB_SIMPLE"), wxCB_SIMPLE }, { wxT("wxCB_DROPDOWN"), wxCB_DROPDOWN }, { wxT("wxCB_READONLY"), wxCB_READONLY }, { wxT("wxCB_SORT"), wxCB_SORT }, - + /* wxGauge */ { wxT("wxGA_PROGRESSBAR"), wxGA_PROGRESSBAR }, { wxT("wxGA_HORIZONTAL"), wxGA_HORIZONTAL }, { wxT("wxGA_VERTICAL"), wxGA_VERTICAL }, - + /* wxTextCtrl */ { wxT("wxPASSWORD"), wxPASSWORD}, { wxT("wxPROCESS_ENTER"), wxPROCESS_ENTER}, @@ -2093,14 +2088,14 @@ static wxResourceBitListStruct wxResourceBitListTable[] = { wxT("wxTE_PROCESS_ENTER"), wxTE_PROCESS_ENTER}, { wxT("wxTE_MULTILINE"), wxTE_MULTILINE}, { wxT("wxTE_NO_VSCROLL"), wxTE_NO_VSCROLL}, - + /* wxRadioBox/wxRadioButton */ { wxT("wxRB_GROUP"), wxRB_GROUP }, { wxT("wxRA_SPECIFY_COLS"), wxRA_SPECIFY_COLS }, { wxT("wxRA_SPECIFY_ROWS"), wxRA_SPECIFY_ROWS }, { wxT("wxRA_HORIZONTAL"), wxRA_HORIZONTAL }, { wxT("wxRA_VERTICAL"), wxRA_VERTICAL }, - + /* wxSlider */ { wxT("wxSL_HORIZONTAL"), wxSL_HORIZONTAL }, { wxT("wxSL_VERTICAL"), wxSL_VERTICAL }, @@ -2112,20 +2107,20 @@ static wxResourceBitListStruct wxResourceBitListTable[] = { wxT("wxSL_BOTTOM"), wxSL_BOTTOM }, { wxT("wxSL_BOTH"), wxSL_BOTH }, { wxT("wxSL_SELRANGE"), wxSL_SELRANGE }, - + /* wxScrollBar */ { wxT("wxSB_HORIZONTAL"), wxSB_HORIZONTAL }, { wxT("wxSB_VERTICAL"), wxSB_VERTICAL }, - + /* wxButton */ { wxT("wxBU_AUTODRAW"), wxBU_AUTODRAW }, { wxT("wxBU_NOAUTODRAW"), wxBU_NOAUTODRAW }, - + /* wxTreeCtrl */ { wxT("wxTR_HAS_BUTTONS"), wxTR_HAS_BUTTONS }, { wxT("wxTR_EDIT_LABELS"), wxTR_EDIT_LABELS }, { wxT("wxTR_LINES_AT_ROOT"), wxTR_LINES_AT_ROOT }, - + /* wxListCtrl */ { wxT("wxLC_ICON"), wxLC_ICON }, { wxT("wxLC_SMALL_ICON"), wxLC_SMALL_ICON }, @@ -2141,27 +2136,27 @@ static wxResourceBitListStruct wxResourceBitListTable[] = { wxT("wxLC_SINGLE_SEL"), wxLC_SINGLE_SEL }, { wxT("wxLC_SORT_ASCENDING"), wxLC_SORT_ASCENDING }, { wxT("wxLC_SORT_DESCENDING"), wxLC_SORT_DESCENDING }, - + /* wxSpinButton */ { wxT("wxSP_VERTICAL"), wxSP_VERTICAL}, { wxT("wxSP_HORIZONTAL"), wxSP_HORIZONTAL}, { wxT("wxSP_ARROW_KEYS"), wxSP_ARROW_KEYS}, { wxT("wxSP_WRAP"), wxSP_WRAP}, - + /* wxSplitterWnd */ { wxT("wxSP_NOBORDER"), wxSP_NOBORDER}, { wxT("wxSP_3D"), wxSP_3D}, { wxT("wxSP_BORDER"), wxSP_BORDER}, - + /* wxTabCtrl */ { wxT("wxTC_MULTILINE"), wxTC_MULTILINE}, { wxT("wxTC_RIGHTJUSTIFY"), wxTC_RIGHTJUSTIFY}, { wxT("wxTC_FIXEDWIDTH"), wxTC_FIXEDWIDTH}, { wxT("wxTC_OWNERDRAW"), wxTC_OWNERDRAW}, - + /* wxStatusBar95 */ { wxT("wxST_SIZEGRIP"), wxST_SIZEGRIP}, - + /* wxControl */ { wxT("wxFIXED_LENGTH"), wxFIXED_LENGTH}, { wxT("wxALIGN_LEFT"), wxALIGN_LEFT}, @@ -2169,16 +2164,16 @@ static wxResourceBitListStruct wxResourceBitListTable[] = { wxT("wxALIGN_CENTRE"), wxALIGN_CENTRE}, { wxT("wxALIGN_RIGHT"), wxALIGN_RIGHT}, { wxT("wxCOLOURED"), wxCOLOURED}, - + /* wxToolBar */ { wxT("wxTB_3DBUTTONS"), wxTB_3DBUTTONS}, { wxT("wxTB_HORIZONTAL"), wxTB_HORIZONTAL}, { wxT("wxTB_VERTICAL"), wxTB_VERTICAL}, { wxT("wxTB_FLAT"), wxTB_FLAT}, - + /* wxDialog */ { wxT("wxDIALOG_MODAL"), wxDIALOG_MODAL }, - + /* Generic */ { wxT("wxVSCROLL"), wxVSCROLL }, { wxT("wxHSCROLL"), wxHSCROLL }, @@ -2217,10 +2212,10 @@ static wxResourceBitListStruct wxResourceBitListTable[] = { wxT("wxCLIP_CHILDREN"), wxCLIP_CHILDREN}, { wxT("wxCLIP_SIBLINGS"), wxCLIP_SIBLINGS}, { wxT("wxTAB_TRAVERSAL"), 0}, // Compatibility only - + { wxT("wxTINY_CAPTION_HORIZ"), wxTINY_CAPTION_HORIZ}, { wxT("wxTINY_CAPTION_VERT"), wxTINY_CAPTION_VERT}, - + // Text font families { wxT("wxDEFAULT"), wxDEFAULT}, { wxT("wxDECORATIVE"), wxDECORATIVE}, @@ -2256,7 +2251,7 @@ static wxResourceBitListStruct wxResourceBitListTable[] = { wxT("wxCAP_ROUND"), wxCAP_ROUND}, { wxT("wxCAP_PROJECTING"), wxCAP_PROJECTING}, { wxT("wxCAP_BUTT"), wxCAP_BUTT}, - + // Logical ops { wxT("wxCLEAR"), wxCLEAR}, { wxT("wxXOR"), wxXOR}, @@ -2274,7 +2269,7 @@ static wxResourceBitListStruct wxResourceBitListTable[] = { wxT("wxNAND"), wxNAND}, { wxT("wxOR"), wxOR}, { wxT("wxSET"), wxSET}, - + { wxT("wxFLOOD_SURFACE"), wxFLOOD_SURFACE}, { wxT("wxFLOOD_BORDER"), wxFLOOD_BORDER}, { wxT("wxODDEVEN_RULE"), wxODDEVEN_RULE}, @@ -2300,7 +2295,7 @@ static wxResourceBitListStruct wxResourceBitListTable[] = { wxT("wxUSER_COLOURS"), wxUSER_COLOURS}, { wxT("wxVERTICAL_LABEL"), 0}, { wxT("wxHORIZONTAL_LABEL"), 0}, - + // Bitmap types (not strictly styles) { wxT("wxBITMAP_TYPE_XPM"), wxBITMAP_TYPE_XPM}, { wxT("wxBITMAP_TYPE_XBM"), wxBITMAP_TYPE_XBM}, @@ -2356,7 +2351,7 @@ wxBitmap wxResourceCreateBitmap(const wxString& resource, wxResourceTable *table { if (!table) table = wxDefaultResourceTable; - + wxItemResource *item = table->FindResource(resource); if (item) { @@ -2367,9 +2362,9 @@ wxBitmap wxResourceCreateBitmap(const wxString& resource, wxResourceTable *table } int thisDepth = wxDisplayDepth(); long thisNoColours = (long)pow(2.0, (double)thisDepth); - + wxItemResource *optResource = (wxItemResource *) NULL; - + // Try to find optimum bitmap for this platform/colour depth wxNode *node = item->GetChildren().First(); while (node) @@ -2383,7 +2378,7 @@ wxBitmap wxResourceCreateBitmap(const wxString& resource, wxResourceTable *table int xRes = child->GetWidth(); int yRes = child->GetHeight(); */ - + switch (platform) { case RESOURCE_PLATFORM_ANY: @@ -2450,7 +2445,7 @@ wxBitmap wxResourceCreateBitmap(const wxString& resource, wxResourceTable *table // If no matching resource, fail. if (!optResource) return wxNullBitmap; - + wxString name = optResource->GetName(); int bitmapType = (int)optResource->GetValue1(); switch (bitmapType) @@ -2511,7 +2506,7 @@ wxIcon wxResourceCreateIcon(const wxString& resource, wxResourceTable *table) { if (!table) table = wxDefaultResourceTable; - + wxItemResource *item = table->FindResource(resource); if (item) { @@ -2522,9 +2517,9 @@ wxIcon wxResourceCreateIcon(const wxString& resource, wxResourceTable *table) } int thisDepth = wxDisplayDepth(); long thisNoColours = (long)pow(2.0, (double)thisDepth); - + wxItemResource *optResource = (wxItemResource *) NULL; - + // Try to find optimum icon for this platform/colour depth wxNode *node = item->GetChildren().First(); while (node) @@ -2538,7 +2533,7 @@ wxIcon wxResourceCreateIcon(const wxString& resource, wxResourceTable *table) int xRes = child->GetWidth(); int yRes = child->GetHeight(); */ - + switch (platform) { case RESOURCE_PLATFORM_ANY: @@ -2605,7 +2600,7 @@ wxIcon wxResourceCreateIcon(const wxString& resource, wxResourceTable *table) // If no matching resource, fail. if (!optResource) return wxNullIcon; - + wxString name = optResource->GetName(); int bitmapType = (int)optResource->GetValue1(); switch (bitmapType) @@ -2694,7 +2689,7 @@ wxMenuBar *wxResourceCreateMenuBar(const wxString& resource, wxResourceTable *ta { if (!table) table = wxDefaultResourceTable; - + wxItemResource *menuResource = table->FindResource(resource); if (menuResource && (menuResource->GetType() != wxT("")) && (menuResource->GetType() == wxT("wxMenu"))) { @@ -2718,7 +2713,7 @@ wxMenu *wxResourceCreateMenu(const wxString& resource, wxResourceTable *table) { if (!table) table = wxDefaultResourceTable; - + wxItemResource *menuResource = table->FindResource(resource); if (menuResource && (menuResource->GetType() != wxT("")) && (menuResource->GetType() == wxT("wxMenu"))) // if (menuResource && (menuResource->GetType() == wxTYPE_MENU)) @@ -2731,7 +2726,7 @@ bool wxResourceParseData(const wxString& resource, wxResourceTable *table) { if (!table) table = wxDefaultResourceTable; - + return table->ParseResourceData(resource); } @@ -2739,7 +2734,7 @@ bool wxResourceParseFile(const wxString& filename, wxResourceTable *table) { if (!table) table = wxDefaultResourceTable; - + return table->ParseResourceFile(filename); } @@ -2748,7 +2743,7 @@ bool wxResourceRegisterBitmapData(const wxString& name, char bits[], int width, { if (!table) table = wxDefaultResourceTable; - + return table->RegisterResourceBitmapData(name, bits, width, height); } @@ -2756,7 +2751,7 @@ bool wxResourceRegisterBitmapData(const wxString& name, char **data, wxResourceT { if (!table) table = wxDefaultResourceTable; - + return table->RegisterResourceBitmapData(name, data); } @@ -2764,7 +2759,7 @@ void wxResourceClear(wxResourceTable *table) { if (!table) table = wxDefaultResourceTable; - + table->ClearTable(); } @@ -2776,7 +2771,7 @@ bool wxResourceAddIdentifier(const wxString& name, int value, wxResourceTable *t { if (!table) table = wxDefaultResourceTable; - + table->identifiers.Put(name, (wxObject *)(long)value); return TRUE; } @@ -2785,7 +2780,7 @@ int wxResourceGetIdentifier(const wxString& name, wxResourceTable *table) { if (!table) table = wxDefaultResourceTable; - + return (int)(long)table->identifiers.Get(name); } @@ -2797,7 +2792,7 @@ bool wxResourceParseIncludeFile(const wxString& f, wxResourceTable *table) { if (!table) table = wxDefaultResourceTable; - + FILE *fd = wxFopen(f, _T("r")); if (!fd) { @@ -2849,7 +2844,7 @@ static int ungetc_string() bool wxEatWhiteSpaceString(char *s) { int ch = 0; - + while ((ch = getc_string(s)) != EOF) { switch (ch) @@ -2868,7 +2863,7 @@ bool wxEatWhiteSpaceString(char *s) ungetc_string(); return TRUE; } - + if (ch == '*') { // Eat C comment @@ -2891,7 +2886,7 @@ bool wxEatWhiteSpaceString(char *s) default: ungetc_string(); return TRUE; - + } } return FALSE; @@ -2903,7 +2898,7 @@ bool wxGetResourceTokenString(char *s) wxReallocateResourceBuffer(); wxResourceBuffer[0] = 0; wxEatWhiteSpaceString(s); - + int ch = getc_string(s); if (ch == '"') { @@ -2931,7 +2926,7 @@ bool wxGetResourceTokenString(char *s) ungetc_string(); } } - + if (wxResourceBufferCount >= wxResourceBufferSize-1) wxReallocateResourceBuffer(); wxResourceBuffer[wxResourceBufferCount] = (char)actualCh; @@ -2950,7 +2945,7 @@ bool wxGetResourceTokenString(char *s) wxReallocateResourceBuffer(); wxResourceBuffer[wxResourceBufferCount] = (char)ch; wxResourceBufferCount ++; - + ch = getc_string(s); } wxResourceBuffer[wxResourceBufferCount] = 0; @@ -2970,14 +2965,14 @@ bool wxResourceReadOneResourceString(char *s, wxExprDatabase& db, bool *eof, wxR { if (!table) table = wxDefaultResourceTable; - + // static or #define if (!wxGetResourceTokenString(s)) { *eof = TRUE; return FALSE; } - + if (strcmp(wxResourceBuffer, "#define") == 0) { wxGetResourceTokenString(s); @@ -2998,7 +2993,7 @@ bool wxResourceReadOneResourceString(char *s, wxExprDatabase& db, bool *eof, wxR } delete[] name; delete[] value; - + return TRUE; } /* @@ -3031,7 +3026,7 @@ bool wxResourceReadOneResourceString(char *s, wxExprDatabase& db, bool *eof, wxR wxLogWarning(buf); return FALSE; } - + // char if (!wxGetResourceTokenString(s)) { @@ -3039,13 +3034,13 @@ bool wxResourceReadOneResourceString(char *s, wxExprDatabase& db, bool *eof, wxR *eof = TRUE; return FALSE; } - + if (strcmp(wxResourceBuffer, "char") != 0) { wxLogWarning(_("Expected 'char' whilst parsing resource.")); return FALSE; } - + // *name if (!wxGetResourceTokenString(s)) { @@ -3053,7 +3048,7 @@ bool wxResourceReadOneResourceString(char *s, wxExprDatabase& db, bool *eof, wxR *eof = TRUE; return FALSE; } - + if (wxResourceBuffer[0] != '*') { wxLogWarning(_("Expected '*' whilst parsing resource.")); @@ -3062,7 +3057,7 @@ bool wxResourceReadOneResourceString(char *s, wxExprDatabase& db, bool *eof, wxR wxChar nameBuf[100]; wxMB2WX(nameBuf, wxResourceBuffer+1, 99); nameBuf[99] = 0; - + // = if (!wxGetResourceTokenString(s)) { @@ -3070,13 +3065,13 @@ bool wxResourceReadOneResourceString(char *s, wxExprDatabase& db, bool *eof, wxR *eof = TRUE; return FALSE; } - + if (strcmp(wxResourceBuffer, "=") != 0) { wxLogWarning(_("Expected '=' whilst parsing resource.")); return FALSE; } - + // String if (!wxGetResourceTokenString(s)) { @@ -3104,10 +3099,10 @@ bool wxResourceParseString(char *s, wxResourceTable *table) { if (!table) table = wxDefaultResourceTable; - + if (!s) return FALSE; - + // Turn backslashes into spaces if (s) { @@ -3120,10 +3115,10 @@ bool wxResourceParseString(char *s, wxResourceTable *table) s[i+1] = ' '; } } - + wxExprDatabase db; wxResourceStringPtr = 0; - + bool eof = FALSE; while (wxResourceReadOneResourceString(s, db, &eof, table) && !eof) { @@ -3140,13 +3135,13 @@ bool wxWindowBase::LoadFromResource(wxWindow *parent, const wxString& resourceNa { if (!table) table = wxDefaultResourceTable; - + wxItemResource *resource = table->FindResource((const wxChar *)resourceName); // if (!resource || (resource->GetType() != wxTYPE_DIALOG_BOX)) if (!resource || (resource->GetType() == wxT("")) || ! ((resource->GetType() == wxT("wxDialog")) || (resource->GetType() == wxT("wxPanel")))) return FALSE; - + wxString title(resource->GetTitle()); long theWindowStyle = resource->GetStyle(); bool isModal = (resource->GetValue1() != 0) ; @@ -3155,14 +3150,14 @@ bool wxWindowBase::LoadFromResource(wxWindow *parent, const wxString& resourceNa int width = resource->GetWidth(); int height = resource->GetHeight(); wxString name = resource->GetName(); - + if (IsKindOf(CLASSINFO(wxDialog))) { wxDialog *dialogBox = (wxDialog *)this; long modalStyle = isModal ? wxDIALOG_MODAL : 0; if (!dialogBox->Create(parent, -1, title, wxPoint(x, y), wxSize(width, height), theWindowStyle|modalStyle, name)) return FALSE; - + // Only reset the client size if we know we're not going to do it again below. if ((resource->GetResourceStyle() & wxRESOURCE_DIALOG_UNITS) == 0) dialogBox->SetClientSize(width, height); @@ -3178,7 +3173,7 @@ bool wxWindowBase::LoadFromResource(wxWindow *parent, const wxString& resourceNa if (!((wxWindow *)this)->Create(parent, -1, wxPoint(x, y), wxSize(width, height), theWindowStyle, name)) return FALSE; } - + if ((resource->GetResourceStyle() & wxRESOURCE_USE_DEFAULTS) != 0) { // No need to do this since it's done in wxPanel or wxDialog constructor. @@ -3191,32 +3186,32 @@ bool wxWindowBase::LoadFromResource(wxWindow *parent, const wxString& resourceNa if (resource->GetBackgroundColour().Ok()) SetBackgroundColour(resource->GetBackgroundColour()); } - + // Should have some kind of font at this point if (!GetFont().Ok()) SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT)); if (!GetBackgroundColour().Ok()) SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE)); - + // Only when we've created the window and set the font can we set the correct size, // if based on dialog units. if ((resource->GetResourceStyle() & wxRESOURCE_DIALOG_UNITS) != 0) { wxSize sz = ConvertDialogToPixels(wxSize(width, height)); SetClientSize(sz.x, sz.y); - + wxPoint pt = ConvertDialogToPixels(wxPoint(x, y)); Move(pt.x, pt.y); } - + // Now create children wxNode *node = resource->GetChildren().First(); while (node) { wxItemResource *childResource = (wxItemResource *)node->Data(); - + (void) CreateItem(childResource, resource, table); - + node = node->Next(); } return TRUE; diff --git a/src/common/sizer.cpp b/src/common/sizer.cpp index b3736d1754..049760f8c2 100644 --- a/src/common/sizer.cpp +++ b/src/common/sizer.cpp @@ -196,7 +196,7 @@ void wxSizerItem::SetDimension( wxPoint pos, wxSize size ) size.x = rwidth; } } - + // This is what GetPosition() returns. Since we calculate // borders afterwards, GetPosition() will be the left/top // corner of the surrounding border. @@ -376,7 +376,7 @@ void wxSizer::SetSizeHints( wxWindow *window ) window->SetSizeHints( size.x, size.y ); } -wxSize wxSizer::GetMaxWindowSize( wxWindow *window ) +wxSize wxSizer::GetMaxWindowSize( wxWindow *WXUNUSED(window) ) { wxSize sizeMax = wxGetDisplaySize(); // make the max size a bit smaller than the screen, a window which takes @@ -947,7 +947,7 @@ wxSize wxBoxSizer::CalcMin() wxSizerItem *item = (wxSizerItem*) node->Data(); m_stretchable += item->GetOption(); - + wxSize size( item->CalcMin() ); if (m_orient == wxHORIZONTAL) @@ -969,7 +969,7 @@ wxSize wxBoxSizer::CalcMin() m_fixedWidth = wxMax( m_fixedWidth, size.x ); } else - { + { m_fixedWidth += size.x; m_fixedHeight = wxMax( m_fixedHeight, size.y ); } @@ -1004,7 +1004,7 @@ static void GetStaticBoxBorders(wxStaticBox *box, else #endif // __WXGTK__ *borderTop = 15; - + (void)box; *borderOther = 5; } diff --git a/src/common/timercmn.cpp b/src/common/timercmn.cpp index e90b5fd4ad..035361aaac 100644 --- a/src/common/timercmn.cpp +++ b/src/common/timercmn.cpp @@ -220,7 +220,8 @@ long wxGetLocalTime() // Get UTC time as seconds since 00:00:00, Jan 1st 1970 long wxGetUTCTime() { - struct tm tm, *ptm; + struct tm tm; + struct tm *ptm; time_t t0, t1; // This cannot be made static because mktime can overwrite it diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index 4e57c5fb9d..48e44b9946 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -1345,7 +1345,7 @@ void wxWindowBase::UpdateWindowUI() if ( event.GetSetText() ) { - wxControl *control = wxDynamicCast(this, wxControl); + wxControl *control = wxDynamicThisCast(this, wxControl); if ( control ) { wxTextCtrl *text = wxDynamicCast(control, wxTextCtrl); @@ -1357,7 +1357,7 @@ void wxWindowBase::UpdateWindowUI() } #if wxUSE_CHECKBOX - wxCheckBox *checkbox = wxDynamicCast(this, wxCheckBox); + wxCheckBox *checkbox = wxDynamicThisCast(this, wxCheckBox); if ( checkbox ) { if ( event.GetSetChecked() ) @@ -1366,7 +1366,7 @@ void wxWindowBase::UpdateWindowUI() #endif // wxUSE_CHECKBOX #if wxUSE_RADIOBTN - wxRadioButton *radiobtn = wxDynamicCast(this, wxRadioButton); + wxRadioButton *radiobtn = wxDynamicThisCast(this, wxRadioButton); if ( radiobtn ) { if ( event.GetSetChecked() ) diff --git a/src/generic/dirctrlg.cpp b/src/generic/dirctrlg.cpp index 1806b34c26..e949c2f495 100644 --- a/src/generic/dirctrlg.cpp +++ b/src/generic/dirctrlg.cpp @@ -308,6 +308,21 @@ static const int ID_NEW = 1004; //static const int ID_CHECK = 1005; #if defined(__WXMSW__) || defined(__WXPM__) +int setdrive(int drive) +{ + char newdrive[3]; + + if (drive < 1 || drive > 31) + return -1; + newdrive[0] = (char)('A' + (char)drive - (char)1); + newdrive[1] = ':'; + newdrive[2] = '\0'; + if (SetCurrentDirectory((LPSTR)newdrive)) + return 0; + else + return -1; +} + static bool wxIsDriveAvailable(const wxString dirName) { #ifdef __WIN32__ @@ -325,8 +340,8 @@ static bool wxIsDriveAvailable(const wxString dirName) #else int currentDrive = _getdrive(); int thisDrive = (int) (dirNameLower[(size_t)0] - 'a' + 1) ; - int err = _chdrive( thisDrive ) ; - _chdrive( currentDrive ); + int err = setdrive( thisDrive ) ; + setdrive( currentDrive ); if (err == -1) { @@ -1107,7 +1122,7 @@ void wxGenericDirCtrl::DoResize() } -void wxGenericDirCtrl::OnSize(wxSizeEvent &event) +void wxGenericDirCtrl::OnSize(wxSizeEvent& WXUNUSED(event)) { DoResize(); } @@ -1136,7 +1151,7 @@ void wxDirFilterListCtrl::Init() m_dirCtrl = NULL; } -void wxDirFilterListCtrl::OnSelFilter(wxCommandEvent& event) +void wxDirFilterListCtrl::OnSelFilter(wxCommandEvent& WXUNUSED(event)) { int sel = GetSelection(); @@ -1236,12 +1251,12 @@ wxGenericDirDialog::wxGenericDirDialog(wxWindow* parent, const wxString& title, Centre( wxBOTH ); } -void wxGenericDirDialog::OnCloseWindow(wxCloseEvent& event) +void wxGenericDirDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event)) { EndModal(wxID_CANCEL); } -void wxGenericDirDialog::OnOK(wxCommandEvent& event) +void wxGenericDirDialog::OnOK(wxCommandEvent& WXUNUSED(event)) { m_path = m_input->GetValue(); // Does the path exist? (User may have typed anything in m_input) diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 186c7ba70a..c47d42f9c8 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -6043,7 +6043,7 @@ void wxGrid::DrawHighlight(wxDC& dc) // This is used to redraw all grid lines e.g. when the grid line colour // has been changed // -void wxGrid::DrawAllGridLines( wxDC& dc, const wxRegion & WXUNUSED_GTK(reg) ) +void wxGrid::DrawAllGridLines( wxDC& dc, const wxRegion & WXUNUSED(reg) ) { if ( !m_gridLinesEnabled || !m_numRows || diff --git a/src/generic/splash.cpp b/src/generic/splash.cpp index 1f7932c5a6..44cc6600ca 100644 --- a/src/generic/splash.cpp +++ b/src/generic/splash.cpp @@ -77,12 +77,12 @@ wxSplashScreen::~wxSplashScreen() m_timer.Stop(); } -void wxSplashScreen::OnNotify(wxTimerEvent& event) +void wxSplashScreen::OnNotify(wxTimerEvent& WXUNUSED(event)) { Close(TRUE); } -void wxSplashScreen::OnCloseWindow(wxCloseEvent& event) +void wxSplashScreen::OnCloseWindow(wxCloseEvent& WXUNUSED(event)) { m_timer.Stop(); this->Destroy(); @@ -105,20 +105,20 @@ wxSplashScreenWindow::wxSplashScreenWindow(const wxBitmap& bitmap, wxWindow* par m_bitmap = bitmap; } -void wxSplashScreenWindow::OnPaint(wxPaintEvent& event) +void wxSplashScreenWindow::OnPaint(wxPaintEvent& WXUNUSED(event)) { wxPaintDC dc(this); if (m_bitmap.Ok()) dc.DrawBitmap(m_bitmap, 0, 0); } -static void wxDrawSplashBitmap(wxDC& dc, const wxBitmap& bitmap, int x, int y) +static void wxDrawSplashBitmap(wxDC& dc, const wxBitmap& bitmap, int WXUNUSED(x), int WXUNUSED(y)) { wxMemoryDC dcMem; #ifndef __WXGTK__ bool hiColour = (wxDisplayDepth() >= 16) ; - + if (bitmap.GetPalette() && !hiColour) { dc.SetPalette(* bitmap.GetPalette()); @@ -164,7 +164,7 @@ void wxSplashScreenWindow::OnMouseEvent(wxMouseEvent& event) GetParent()->Close(TRUE); } -void wxSplashScreenWindow::OnChar(wxKeyEvent& event) +void wxSplashScreenWindow::OnChar(wxKeyEvent& WXUNUSED(event)) { GetParent()->Close(TRUE); } diff --git a/src/generic/tipwin.cpp b/src/generic/tipwin.cpp index 570d632273..9937d35037 100644 --- a/src/generic/tipwin.cpp +++ b/src/generic/tipwin.cpp @@ -127,7 +127,7 @@ wxTipWindow::~wxTipWindow() } } -void wxTipWindow::OnMouseClick(wxMouseEvent& event) +void wxTipWindow::OnMouseClick(wxMouseEvent& WXUNUSED(event)) { Close(); } @@ -138,7 +138,7 @@ void wxTipWindow::OnActivate(wxActivateEvent& event) Close(); } -void wxTipWindow::OnKillFocus(wxFocusEvent& event) +void wxTipWindow::OnKillFocus(wxFocusEvent& WXUNUSED(event)) { // Under Windows at least, we will get this immediately // because when the view window is focussed, the @@ -231,7 +231,7 @@ void wxTipWindowView::Adjust(const wxString& text, wxCoord maxLength) 2*(TEXT_MARGIN_Y + 1) + parent->m_textLines.GetCount()*parent->m_heightLine); } -void wxTipWindowView::OnPaint(wxPaintEvent& event) +void wxTipWindowView::OnPaint(wxPaintEvent& WXUNUSED(event)) { wxTipWindow* parent = (wxTipWindow*) GetParent(); if (!parent) @@ -270,14 +270,15 @@ void wxTipWindowView::OnPaint(wxPaintEvent& event) } } -void wxTipWindowView::OnMouseClick(wxMouseEvent& event) +void wxTipWindowView::OnMouseClick(wxMouseEvent& WXUNUSED(event)) { GetParent()->Close(); } -void wxTipWindowView::OnKillFocus(wxFocusEvent& event) +void wxTipWindowView::OnKillFocus(wxFocusEvent& WXUNUSED(event)) { // Workaround the kill focus event happening just after creation in wxGTK if (wxGetLocalTime() > m_creationTime + 1) GetParent()->Close(); } + diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index 0577780a85..4669cdca44 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -298,23 +298,23 @@ void wxTreeTextCtrl::OnChar( wxKeyEvent &event ) { (*m_accept) = TRUE; (*m_res) = GetValue(); - + if (!wxPendingDelete.Member(this)) wxPendingDelete.Append(this); if ((*m_accept) && ((*m_res) != m_startValue)) m_owner->OnRenameAccept(); - + return; } if (event.m_keyCode == WXK_ESCAPE) { (*m_accept) = FALSE; (*m_res) = ""; - + if (!wxPendingDelete.Member(this)) wxPendingDelete.Append(this); - + return; } event.Skip(); @@ -331,7 +331,7 @@ void wxTreeTextCtrl::OnKeyUp( wxKeyEvent &event ) if (myPos.x + sx > parentSize.x) sx = parentSize.x - myPos.x; if (mySize.x > sx) sx = mySize.x; SetSize(sx, -1); - + event.Skip(); } @@ -632,7 +632,7 @@ void wxGenericTreeCtrl::Init() m_imageListNormal = m_imageListState = (wxImageList *) NULL; - m_ownsImageListNormal = + m_ownsImageListNormal = m_ownsImageListState = FALSE; m_dragCount = 0; @@ -2252,7 +2252,7 @@ wxTreeItemId wxGenericTreeCtrl::HitTest(const wxPoint& point, int& flags) // get the bounding rectangle of the item (or of its label only) bool wxGenericTreeCtrl::GetBoundingRect(const wxTreeItemId& item, wxRect& rect, - bool textOnly) const + bool WXUNUSED(textOnly)) const { wxCHECK_MSG( item.IsOk(), FALSE, _T("invalid item in wxGenericTreeCtrl::GetBoundingRect") ); diff --git a/src/html/helpctrl.cpp b/src/html/helpctrl.cpp index 0d36aed6e4..72c82d2773 100644 --- a/src/html/helpctrl.cpp +++ b/src/html/helpctrl.cpp @@ -83,7 +83,7 @@ bool wxHtmlHelpController::AddBook(const wxString& book, bool show_wait_msg) #if wxUSE_BUSYINFO wxBusyInfo* busy = NULL; wxString info; - if (show_wait_msg) + if (show_wait_msg) { info.Printf(_("Adding book %s"), book.c_str()); busy = new wxBusyInfo(info); @@ -93,7 +93,7 @@ bool wxHtmlHelpController::AddBook(const wxString& book, bool show_wait_msg) #if wxUSE_BUSYINFO if (show_wait_msg) delete busy; -#endif +#endif return retval; } @@ -113,7 +113,7 @@ void wxHtmlHelpController::CreateHelpWindow() return ; } - if (m_Config == NULL) + if (m_Config == NULL) { m_Config = wxConfigBase::Get(FALSE); if (m_Config != NULL) @@ -211,11 +211,8 @@ bool wxHtmlHelpController::DisplayTextPopup(const wxString& text, const wxPoint& return TRUE; } - - return FALSE; -#else - return FALSE; #endif + return FALSE; } void wxHtmlHelpController::SetFrameParameters(const wxString& title, diff --git a/src/html/helpfrm.cpp b/src/html/helpfrm.cpp index acce6dff82..dc55c65ec8 100644 --- a/src/html/helpfrm.cpp +++ b/src/html/helpfrm.cpp @@ -198,7 +198,7 @@ void wxHtmlHelpFrame::Init(wxHtmlHelpData* data) // moreover, if no contents, index or searchpage is needed, m_Splitter and // m_NavigPan will be NULL too (with m_HtmlWin directly connected to the frame) -bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id, const wxString& title, +bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id, const wxString& WXUNUSED(title), int style) { wxImageList *ContentsImageList = new wxImageList(16, 16); @@ -1000,7 +1000,7 @@ Normal face
(and underlined. Italic face. \ )); } - void OnUpdate(wxCommandEvent& event) + void OnUpdate(wxCommandEvent& WXUNUSED(event)) { UpdateTestWin(); } @@ -1321,7 +1321,8 @@ void wxHtmlHelpFrame::OnIndexFind(wxCommandEvent& event) { wxBusyCursor bcur; const wxChar *cstr = sr.c_str(); - wxChar mybuff[512], *ptr; + wxChar mybuff[512]; + wxChar *ptr; bool first = TRUE; m_IndexList->Clear(); diff --git a/src/html/htmlwin.cpp b/src/html/htmlwin.cpp index 393b47565d..5f14c0e508 100644 --- a/src/html/htmlwin.cpp +++ b/src/html/htmlwin.cpp @@ -109,7 +109,7 @@ bool wxHtmlWindow::SetPage(const wxString& source) SetBackgroundColour(wxColour(0xFF, 0xFF, 0xFF)); m_OpenedPage = m_OpenedAnchor = m_OpenedPageTitle = wxEmptyString; m_Parser->SetDC(dc); - if (m_Cell) + if (m_Cell) { delete m_Cell; m_Cell = NULL; @@ -129,7 +129,7 @@ bool wxHtmlWindow::LoadPage(const wxString& location) wxFSFile *f; bool rt_val; bool needs_refresh = FALSE; - + SetCursor(*wxHOURGLASS_CURSOR); wxYield(); Refresh(FALSE); @@ -148,15 +148,15 @@ bool wxHtmlWindow::LoadPage(const wxString& location) rt_val = ScrollToAnchor(anch); m_tmpCanDrawLocks++; } - else if (location.Find(wxT('#')) != wxNOT_FOUND && location.BeforeFirst(wxT('#')) == m_OpenedPage) + else if (location.Find(wxT('#')) != wxNOT_FOUND && location.BeforeFirst(wxT('#')) == m_OpenedPage) { wxString anch = location.AfterFirst(wxT('#')); m_tmpCanDrawLocks--; rt_val = ScrollToAnchor(anch); m_tmpCanDrawLocks++; } - else if (location.Find(wxT('#')) != wxNOT_FOUND && - (m_FS->GetPath() + location.BeforeFirst(wxT('#'))) == m_OpenedPage) + else if (location.Find(wxT('#')) != wxNOT_FOUND && + (m_FS->GetPath() + location.BeforeFirst(wxT('#'))) == m_OpenedPage) { wxString anch = location.AfterFirst(wxT('#')); m_tmpCanDrawLocks--; @@ -164,19 +164,19 @@ bool wxHtmlWindow::LoadPage(const wxString& location) m_tmpCanDrawLocks++; } - else + else { needs_refresh = TRUE; // load&display it: - if (m_RelatedStatusBar != -1) + if (m_RelatedStatusBar != -1) { m_RelatedFrame->SetStatusText(_("Connecting..."), m_RelatedStatusBar); Refresh(FALSE); } f = m_FS->OpenFile(location); - - if (f == NULL) + + if (f == NULL) { wxString err; @@ -187,12 +187,12 @@ bool wxHtmlWindow::LoadPage(const wxString& location) return FALSE; } - else + else { wxNode *node; wxString src = wxEmptyString; - if (m_RelatedStatusBar != -1) + if (m_RelatedStatusBar != -1) { wxString msg = _("Loading : ") + location; m_RelatedFrame->SetStatusText(msg, m_RelatedStatusBar); @@ -210,7 +210,7 @@ bool wxHtmlWindow::LoadPage(const wxString& location) } node = node->GetNext(); } - if (src == wxEmptyString) + if (src == wxEmptyString) { if (m_DefaultFilter == NULL) m_DefaultFilter = GetDefaultFilter(); src = m_DefaultFilter->ReadFile(*f); @@ -219,7 +219,7 @@ bool wxHtmlWindow::LoadPage(const wxString& location) m_FS->ChangePathTo(f->GetLocation()); rt_val = SetPage(src); m_OpenedPage = f->GetLocation(); - if (f->GetAnchor() != wxEmptyString) + if (f->GetAnchor() != wxEmptyString) { wxYield(); ScrollToAnchor(f->GetAnchor()); @@ -245,7 +245,7 @@ bool wxHtmlWindow::LoadPage(const wxString& location) OnSetTitle(wxFileNameFromPath(m_OpenedPage)); SetCursor(*wxSTANDARD_CURSOR); - if (needs_refresh) + if (needs_refresh) { wxYield(); m_tmpCanDrawLocks--; @@ -267,7 +267,7 @@ bool wxHtmlWindow::ScrollToAnchor(const wxString& anchor) wxLogWarning(_("HTML anchor %s does not exist."), anchor.c_str()); return FALSE; } - else + else { int y; @@ -281,7 +281,7 @@ bool wxHtmlWindow::ScrollToAnchor(const wxString& anchor) void wxHtmlWindow::OnSetTitle(const wxString& title) { - if (m_RelatedFrame) + if (m_RelatedFrame) { wxString tit; tit.Printf(m_TitleFormat, title.c_str()); @@ -300,7 +300,7 @@ void wxHtmlWindow::CreateLayout() if (!m_Cell) return; - if (m_Style & wxHW_SCROLLBAR_NEVER) + if (m_Style & wxHW_SCROLLBAR_NEVER) { SetScrollbars(wxHTML_SCROLL_STEP, 1, m_Cell->GetWidth() / wxHTML_SCROLL_STEP, 0); // always off GetClientSize(&ClientWidth, &ClientHeight); @@ -310,7 +310,7 @@ void wxHtmlWindow::CreateLayout() else { GetClientSize(&ClientWidth, &ClientHeight); m_Cell->Layout(ClientWidth); - if (ClientHeight < m_Cell->GetHeight() + GetCharHeight()) + if (ClientHeight < m_Cell->GetHeight() + GetCharHeight()) { SetScrollbars( wxHTML_SCROLL_STEP, wxHTML_SCROLL_STEP, @@ -336,7 +336,7 @@ void wxHtmlWindow::ReadCustomization(wxConfigBase *cfg, wxString path) int p_fontsizes[7]; wxString p_fff, p_ffn; - if (path != wxEmptyString) + if (path != wxEmptyString) { oldpath = cfg->GetPath(); cfg->SetPath(path); @@ -345,7 +345,7 @@ void wxHtmlWindow::ReadCustomization(wxConfigBase *cfg, wxString path) m_Borders = cfg->Read("wxHtmlWindow/Borders", m_Borders); p_fff = cfg->Read("wxHtmlWindow/FontFaceFixed", m_Parser->m_FontFaceFixed); p_ffn = cfg->Read("wxHtmlWindow/FontFaceNormal", m_Parser->m_FontFaceNormal); - for (int i = 0; i < 7; i++) + for (int i = 0; i < 7; i++) { tmp.Printf(wxT("wxHtmlWindow/FontsSize%i"), i); p_fontsizes[i] = cfg->Read(tmp, m_Parser->m_FontsSizes[i]); @@ -363,7 +363,7 @@ void wxHtmlWindow::WriteCustomization(wxConfigBase *cfg, wxString path) wxString oldpath; wxString tmp; - if (path != wxEmptyString) + if (path != wxEmptyString) { oldpath = cfg->GetPath(); cfg->SetPath(path); @@ -372,7 +372,7 @@ void wxHtmlWindow::WriteCustomization(wxConfigBase *cfg, wxString path) cfg->Write("wxHtmlWindow/Borders", (long) m_Borders); cfg->Write("wxHtmlWindow/FontFaceFixed", m_Parser->m_FontFaceFixed); cfg->Write("wxHtmlWindow/FontFaceNormal", m_Parser->m_FontFaceNormal); - for (int i = 0; i < 7; i++) + for (int i = 0; i < 7; i++) { tmp.Printf(wxT("wxHtmlWindow/FontsSize%i"), i); cfg->Write(tmp, (long) m_Parser->m_FontsSizes[i]); @@ -498,10 +498,10 @@ void wxHtmlWindow::OnDraw(wxDC& dc) int v_y, v_h; if (m_tmpCanDrawLocks > 0) return; - + dc.SetMapMode(wxMM_TEXT); #if 0 -/* VS - I don't think this is neccessary any longer +/* VS - I don't think this is neccessary any longer MSC_VER 1200 means MSVC 6.0 and it works fine */ #if defined(_MSC_VER) && (_MSC_VER == 1200) ::SetMapMode((HDC)dc.GetHDC(), MM_TEXT); @@ -510,7 +510,7 @@ void wxHtmlWindow::OnDraw(wxDC& dc) dc.SetBackgroundMode(wxTRANSPARENT); ViewStart(&x, &y); - while (upd) + while (upd) { v_y = upd.GetY(); v_h = upd.GetH(); @@ -534,7 +534,7 @@ void wxHtmlWindow::OnMouseEvent(wxMouseEvent& event) { m_tmpMouseMoved = TRUE; - if (event.ButtonDown()) + if (event.ButtonDown()) { int sx, sy; wxPoint pos; @@ -550,15 +550,15 @@ void wxHtmlWindow::OnMouseEvent(wxMouseEvent& event) -void wxHtmlWindow::OnIdle(wxIdleEvent& event) +void wxHtmlWindow::OnIdle(wxIdleEvent& WXUNUSED(event)) { - if (s_cur_hand == NULL) + if (s_cur_hand == NULL) { s_cur_hand = new wxCursor(wxCURSOR_HAND); s_cur_arrow = new wxCursor(wxCURSOR_ARROW); } - if (m_tmpMouseMoved && (m_Cell != NULL)) + if (m_tmpMouseMoved && (m_Cell != NULL)) { int sx, sy; int x, y; @@ -569,17 +569,17 @@ void wxHtmlWindow::OnIdle(wxIdleEvent& event) ScreenToClient(&x, &y); lnk = m_Cell->GetLink(sx + x, sy + y); - if (lnk != m_tmpLastLink) + if (lnk != m_tmpLastLink) { - if (lnk == NULL) + if (lnk == NULL) { SetCursor(*s_cur_arrow); if (m_RelatedStatusBar != -1) m_RelatedFrame->SetStatusText(wxEmptyString, m_RelatedStatusBar); } - else + else { SetCursor(*s_cur_hand); - if (m_RelatedStatusBar != -1) + if (m_RelatedStatusBar != -1) m_RelatedFrame->SetStatusText(lnk->GetHref(), m_RelatedStatusBar); } m_tmpLastLink = lnk; diff --git a/src/html/m_fonts.cpp b/src/html/m_fonts.cpp index b183ffaa33..67310dea59 100644 --- a/src/html/m_fonts.cpp +++ b/src/html/m_fonts.cpp @@ -43,23 +43,25 @@ TAG_HANDLER_BEGIN(FONT, "FONT") int oldsize = m_WParser->GetFontSize(); wxString oldface = m_WParser->GetFontFace(); - if (tag.HasParam(wxT("COLOR"))) + if (tag.HasParam(wxT("COLOR"))) { - unsigned long tmp = 0; + unsigned long tmp = 0; wxColour clr; - if (tag.ScanParam(wxT("COLOR"), wxT("#%lX"), &tmp) == 1) + if (tag.ScanParam(wxT("COLOR"), wxT("#%lX"), &tmp) == 1) { - clr = wxColour((tmp & 0xFF0000) >> 16 , (tmp & 0x00FF00) >> 8, (tmp & 0x0000FF)); + clr = wxColour((unsigned char)((tmp & 0xFF0000) >> 16), + (unsigned char)((tmp & 0x00FF00) >> 8), + (unsigned char)(tmp & 0x0000FF)); m_WParser->SetActualColor(clr); m_WParser->GetContainer()->InsertCell(new wxHtmlColourCell(clr)); } } - if (tag.HasParam(wxT("SIZE"))) + if (tag.HasParam(wxT("SIZE"))) { long tmp = 0; wxChar c = tag.GetParam(wxT("SIZE"))[(unsigned int) 0]; - if (tag.ScanParam(wxT("SIZE"), wxT("%li"), &tmp) == 1) + if (tag.ScanParam(wxT("SIZE"), wxT("%li"), &tmp) == 1) { if (c == '+' || c == '-') m_WParser->SetFontSize(oldsize+tmp); @@ -68,10 +70,10 @@ TAG_HANDLER_BEGIN(FONT, "FONT") m_WParser->GetContainer()->InsertCell(new wxHtmlFontCell(m_WParser->CreateCurrentFont())); } } - - if (tag.HasParam(wxT("FACE"))) + + if (tag.HasParam(wxT("FACE"))) { - if (m_Faces.GetCount() == 0) + if (m_Faces.GetCount() == 0) { wxFontEnumerator enu; enu.EnumerateFacenames(); @@ -79,10 +81,10 @@ TAG_HANDLER_BEGIN(FONT, "FONT") } wxStringTokenizer tk(tag.GetParam(wxT("FACE")), ","); int index; - - while (tk.HasMoreTokens()) + + while (tk.HasMoreTokens()) { - if ((index = m_Faces.Index(tk.GetNextToken())) != wxNOT_FOUND) + if ((index = m_Faces.Index(tk.GetNextToken())) != wxNOT_FOUND) { m_WParser->SetFontFace(m_Faces[index]); m_WParser->GetContainer()->InsertCell(new wxHtmlFontCell(m_WParser->CreateCurrentFont())); @@ -93,17 +95,17 @@ TAG_HANDLER_BEGIN(FONT, "FONT") ParseInner(tag); - if (oldface != m_WParser->GetFontFace()) + if (oldface != m_WParser->GetFontFace()) { m_WParser->SetFontFace(oldface); m_WParser->GetContainer()->InsertCell(new wxHtmlFontCell(m_WParser->CreateCurrentFont())); - } - if (oldsize != m_WParser->GetFontSize()) + } + if (oldsize != m_WParser->GetFontSize()) { m_WParser->SetFontSize(oldsize); m_WParser->GetContainer()->InsertCell(new wxHtmlFontCell(m_WParser->CreateCurrentFont())); - } - if (oldclr != m_WParser->GetActualColor()) + } + if (oldclr != m_WParser->GetActualColor()) { m_WParser->SetActualColor(oldclr); m_WParser->GetContainer()->InsertCell(new wxHtmlColourCell(oldclr)); @@ -224,7 +226,7 @@ TAG_HANDLER_BEGIN(Hx, "H1,H2,H3,H4,H5,H6") m_WParser->SetFontSize(6); else if (tag.GetName() == wxT("H3")) m_WParser->SetFontSize(5); - else if (tag.GetName() == wxT("H4")) + else if (tag.GetName() == wxT("H4")) { m_WParser->SetFontSize(5); m_WParser->SetFontItalic(TRUE); @@ -232,7 +234,7 @@ TAG_HANDLER_BEGIN(Hx, "H1,H2,H3,H4,H5,H6") } else if (tag.GetName() == wxT("H5")) m_WParser->SetFontSize(4); - else if (tag.GetName() == wxT("H6")) + else if (tag.GetName() == wxT("H6")) { m_WParser->SetFontSize(4); m_WParser->SetFontItalic(TRUE); @@ -240,7 +242,7 @@ TAG_HANDLER_BEGIN(Hx, "H1,H2,H3,H4,H5,H6") } c = m_WParser->GetContainer(); - if (c->GetFirstCell()) + if (c->GetFirstCell()) { m_WParser->CloseContainer(); m_WParser->OpenContainer(); diff --git a/src/html/m_layout.cpp b/src/html/m_layout.cpp index c026d8cabb..e3f8ec8c3f 100644 --- a/src/html/m_layout.cpp +++ b/src/html/m_layout.cpp @@ -36,7 +36,7 @@ TAG_HANDLER_BEGIN(P, "P") TAG_HANDLER_PROC(tag) { - if (m_WParser->GetContainer()->GetFirstCell() != NULL) + if (m_WParser->GetContainer()->GetFirstCell() != NULL) { m_WParser->CloseContainer(); m_WParser->OpenContainer(); @@ -56,7 +56,7 @@ TAG_HANDLER_BEGIN(BR, "BR") { int al = m_WParser->GetContainer()->GetAlignHor(); wxHtmlContainerCell *c; - + m_WParser->CloseContainer(); c = m_WParser->OpenContainer(); c->SetAlignHor(al); @@ -77,7 +77,7 @@ TAG_HANDLER_BEGIN(CENTER, "CENTER") wxHtmlContainerCell *c = m_WParser->GetContainer(); m_WParser->SetAlign(wxHTML_ALIGN_CENTER); - if (c->GetFirstCell() != NULL) + if (c->GetFirstCell() != NULL) { m_WParser->CloseContainer(); m_WParser->OpenContainer(); @@ -85,12 +85,12 @@ TAG_HANDLER_BEGIN(CENTER, "CENTER") else c->SetAlignHor(wxHTML_ALIGN_CENTER); - if (tag.HasEnding()) + if (tag.HasEnding()) { ParseInner(tag); m_WParser->SetAlign(old); - if (c->GetFirstCell() != NULL) + if (c->GetFirstCell() != NULL) { m_WParser->CloseContainer(); m_WParser->OpenContainer(); @@ -113,7 +113,7 @@ TAG_HANDLER_BEGIN(DIV, "DIV") { int old = m_WParser->GetAlign(); wxHtmlContainerCell *c = m_WParser->GetContainer(); - if (c->GetFirstCell() != NULL) + if (c->GetFirstCell() != NULL) { m_WParser->CloseContainer(); m_WParser->OpenContainer(); @@ -121,7 +121,7 @@ TAG_HANDLER_BEGIN(DIV, "DIV") c->SetAlign(tag); m_WParser->SetAlign(c->GetAlignHor()); } - else + else { c->SetAlign(tag); m_WParser->SetAlign(c->GetAlignHor()); @@ -130,7 +130,7 @@ TAG_HANDLER_BEGIN(DIV, "DIV") ParseInner(tag); m_WParser->SetAlign(old); - if (c->GetFirstCell() != NULL) + if (c->GetFirstCell() != NULL) { m_WParser->CloseContainer(); m_WParser->OpenContainer(); @@ -150,10 +150,10 @@ TAG_HANDLER_BEGIN(TITLE, "TITLE") TAG_HANDLER_PROC(tag) { - if (m_WParser->GetWindow()) + if (m_WParser->GetWindow()) { wxHtmlWindow *wfr = (wxHtmlWindow*)(m_WParser->GetWindow()); - if (wfr) + if (wfr) { wxString title = ""; wxString *src = m_WParser->GetSource(); @@ -177,30 +177,36 @@ TAG_HANDLER_BEGIN(BODY, "BODY") unsigned long tmp; wxColour clr; - if (tag.HasParam(wxT("TEXT"))) + if (tag.HasParam(wxT("TEXT"))) { - if (tag.ScanParam(wxT("TEXT"), wxT("#%lX"), &tmp) == 1) + if (tag.ScanParam(wxT("TEXT"), wxT("#%lX"), &tmp) == 1) { - clr = wxColour((tmp & 0xFF0000) >> 16 , (tmp & 0x00FF00) >> 8, (tmp & 0x0000FF)); + clr = wxColour((unsigned char)((tmp & 0xFF0000) >> 16), + (unsigned char)((tmp & 0x00FF00) >> 8), + (unsigned char)(tmp & 0x0000FF)); m_WParser->SetActualColor(clr); m_WParser->GetContainer()->InsertCell(new wxHtmlColourCell(clr)); } } - if (tag.HasParam(wxT("LINK"))) + if (tag.HasParam(wxT("LINK"))) { - if (tag.ScanParam(wxT("LINK"), wxT("#%lX"), &tmp) == 1) + if (tag.ScanParam(wxT("LINK"), wxT("#%lX"), &tmp) == 1) { - clr = wxColour((tmp & 0xFF0000) >> 16 , (tmp & 0x00FF00) >> 8, (tmp & 0x0000FF)); + clr = wxColour((unsigned char)((tmp & 0xFF0000) >> 16), + (unsigned char)((tmp & 0x00FF00) >> 8), + (unsigned char)(tmp & 0x0000FF)); m_WParser->SetLinkColor(clr); } } - if (tag.HasParam(wxT("BGCOLOR"))) + if (tag.HasParam(wxT("BGCOLOR"))) { - if (tag.ScanParam(wxT("BGCOLOR"), wxT("#%lX"), &tmp) == 1) + if (tag.ScanParam(wxT("BGCOLOR"), wxT("#%lX"), &tmp) == 1) { - clr = wxColour((tmp & 0xFF0000) >> 16 , (tmp & 0x00FF00) >> 8, (tmp & 0x0000FF)); + clr = wxColour((unsigned char)((tmp & 0xFF0000) >> 16), + (unsigned char)((tmp & 0x00FF00) >> 8), + (unsigned char)(tmp & 0x0000FF)); m_WParser->GetContainer()->InsertCell(new wxHtmlColourCell(clr, wxHTML_CLR_BACKGROUND)); if (m_WParser->GetWindow() != NULL) m_WParser->GetWindow()->SetBackgroundColour(clr); @@ -218,15 +224,15 @@ TAG_HANDLER_BEGIN(BLOCKQUOTE, "BLOCKQUOTE") TAG_HANDLER_PROC(tag) { wxHtmlContainerCell *c; - + m_WParser->CloseContainer(); c = m_WParser->OpenContainer(); - + if (c->GetAlignHor() == wxHTML_ALIGN_RIGHT) c->SetIndent(5 * m_WParser->GetCharWidth(), wxHTML_INDENT_RIGHT); else c->SetIndent(5 * m_WParser->GetCharWidth(), wxHTML_INDENT_LEFT); - + c->SetIndent(m_WParser->GetCharHeight(), wxHTML_INDENT_TOP); m_WParser->OpenContainer(); ParseInner(tag); diff --git a/src/msw/app.cpp b/src/msw/app.cpp index 36dedf8627..3424745eaf 100644 --- a/src/msw/app.cpp +++ b/src/msw/app.cpp @@ -1289,11 +1289,11 @@ bool wxYield() // normally result in message boxes popping up &c wxLog::Suspend(); -#ifdef __WXDEBUG__ +#ifdef __WXDEBUG__ if (gs_inYield) wxFAIL_MSG( wxT("wxYield called recursively" ) ); #endif - + gs_inYield = TRUE; // we don't want to process WM_QUIT from here - it should be processed in @@ -1327,7 +1327,7 @@ bool wxYieldIfNeeded() { if (gs_inYield) return FALSE; - + return wxYield(); } @@ -1340,7 +1340,8 @@ bool wxHandleFatalExceptions(bool doit) return TRUE; #else wxFAIL_MSG(_T("set wxUSE_ON_FATAL_EXCEPTION to 1 to sue this function")); - + + (void)doit; return FALSE; #endif } diff --git a/src/msw/bmpbuttn.cpp b/src/msw/bmpbuttn.cpp index e5b40ea968..0e3fd2ebe2 100644 --- a/src/msw/bmpbuttn.cpp +++ b/src/msw/bmpbuttn.cpp @@ -94,7 +94,7 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, const wxBitmap& bit wxT("BUTTON"), wxT(""), msStyle, - 0, 0, 0, 0, + 0, 0, 0, 0, GetWinHwnd(parent), (HMENU)m_windowId, wxGetInstance(), @@ -196,7 +196,7 @@ bool wxBitmapButton::MSWOnDraw(WXDRAWITEMSTRUCT *item) wxDC dst; dst.SetHDC((WXHDC) hDC, FALSE); dst.DrawBitmap(*bitmap, x1, y1, TRUE); - + // draw focus / disabled state, if auto-drawing if ( (state & ODS_DISABLED) && autoDraw ) { @@ -352,6 +352,7 @@ void wxBitmapButton::DrawButtonFocus( WXHDC dc, int left, int top, int right, in if ( sel ) OffsetRect( &rect, 1, 1 ); */ + (void)sel; DrawFocusRect( (HDC) dc, &rect ); } diff --git a/src/msw/button.cpp b/src/msw/button.cpp index d58fda1ac6..72e64675f7 100644 --- a/src/msw/button.cpp +++ b/src/msw/button.cpp @@ -255,7 +255,7 @@ void wxButton::Command(wxCommandEvent & event) // event/message handlers // ---------------------------------------------------------------------------- -bool wxButton::MSWCommand(WXUINT param, WXWORD id) +bool wxButton::MSWCommand(WXUINT param, WXWORD WXUNUSED(id)) { bool processed = FALSE; switch ( param ) diff --git a/src/msw/checkbox.cpp b/src/msw/checkbox.cpp index 3e10a30ec2..1a19d1383a 100644 --- a/src/msw/checkbox.cpp +++ b/src/msw/checkbox.cpp @@ -207,7 +207,7 @@ void wxCheckBox::Command (wxCommandEvent & event) // wxBitmapCheckBox // ---------------------------------------------------------------------------- -bool wxBitmapCheckBox::Create(wxWindow *parent, wxWindowID id, const wxBitmap *label, +bool wxBitmapCheckBox::Create(wxWindow *parent, wxWindowID id, const wxBitmap *WXUNUSED(label), const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator, @@ -262,7 +262,7 @@ bool wxBitmapCheckBox::Create(wxWindow *parent, wxWindowID id, const wxBitmap *l return TRUE; } -void wxBitmapCheckBox::SetLabel(const wxBitmap& bitmap) +void wxBitmapCheckBox::SetLabel(const wxBitmap& WXUNUSED(bitmap)) { wxFAIL_MSG(wxT("not implemented")); } diff --git a/src/msw/choice.cpp b/src/msw/choice.cpp index 87f286d943..d7d982797c 100644 --- a/src/msw/choice.cpp +++ b/src/msw/choice.cpp @@ -185,7 +185,7 @@ int wxChoice::FindString(const wxString& s) const #endif // Watcom/!Watcom } -void wxChoice::SetString(int n, const wxString& s) +void wxChoice::SetString(int WXUNUSED(n), const wxString& WXUNUSED(s)) { wxFAIL_MSG(wxT("not implemented")); @@ -251,7 +251,7 @@ wxClientData* wxChoice::DoGetItemClientObject( int n ) const // ---------------------------------------------------------------------------- void wxChoice::DoSetSize(int x, int y, - int width, int height, + int width, int WXUNUSED(height), int sizeFlags) { // Ignore height parameter because height doesn't mean 'initially @@ -338,10 +338,10 @@ bool wxChoice::MSWCommand(WXUINT param, WXWORD WXUNUSED(id)) return TRUE; } -WXHBRUSH wxChoice::OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor, - WXUINT message, - WXWPARAM wParam, - WXLPARAM lParam) +WXHBRUSH wxChoice::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor), + WXUINT WXUNUSED(message), + WXWPARAM WXUNUSED(wParam), + WXLPARAM WXUNUSED(lParam)) { #if wxUSE_CTL3D if ( m_useCtl3D ) diff --git a/src/msw/clipbrd.cpp b/src/msw/clipbrd.cpp index ea427f7e8b..baf1e064b2 100644 --- a/src/msw/clipbrd.cpp +++ b/src/msw/clipbrd.cpp @@ -219,7 +219,7 @@ bool wxSetClipboardData(wxDataFormat dataFormat, wxBitmap *bitmap = (wxBitmap *)data; HBITMAP hBitmap = (HBITMAP)bitmap->GetHBITMAP(); // NULL palette means to use the system one - HANDLE hDIB = wxBitmapToDIB(hBitmap, (HPALETTE)NULL); + HANDLE hDIB = wxBitmapToDIB(hBitmap, (HPALETTE)NULL); handle = SetClipboardData(CF_DIB, hDIB); #endif // wxUSE_IMAGE_LOADING_IN_MSW break; @@ -433,7 +433,7 @@ void *wxGetClipboardData(wxDataFormat dataFormat, long *len) wxDataFormat wxEnumClipboardFormats(wxDataFormat dataFormat) { - return ::EnumClipboardFormats(dataFormat); + return (wxDataFormat::NativeFormat)::EnumClipboardFormats(dataFormat); } int wxRegisterClipboardFormat(wxChar *formatName) @@ -583,7 +583,7 @@ bool wxClipboard::AddData( wxDataObject *data ) #if wxUSE_METAFILE case wxDF_METAFILE: { - wxMetafileDataObject* metaFileDataObject = + wxMetafileDataObject* metaFileDataObject = (wxMetafileDataObject*) data; wxMetafile metaFile = metaFileDataObject->GetMetafile(); return wxSetClipboardData(wxDF_METAFILE, &metaFile, @@ -627,7 +627,8 @@ bool wxClipboard::GetData( wxDataObject& data ) // build the list of supported formats size_t nFormats = data.GetFormatCount(wxDataObject::Set); - wxDataFormat format, *formats; + wxDataFormat format; + wxDataFormat *formats; if ( nFormats == 1 ) { // the most common case diff --git a/src/msw/colordlg.cpp b/src/msw/colordlg.cpp index 8fc614cff7..494928bb64 100644 --- a/src/msw/colordlg.cpp +++ b/src/msw/colordlg.cpp @@ -72,7 +72,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxColourDialog, wxDialog) UINT CALLBACK wxColourDialogHookProc(HWND hwnd, UINT uiMsg, - WPARAM wParam, + WPARAM WXUNUSED(wParam), LPARAM lParam) { if ( uiMsg == WM_INITDIALOG ) diff --git a/src/msw/combobox.cpp b/src/msw/combobox.cpp index 9ccee8b4d0..0d80dbcf05 100644 --- a/src/msw/combobox.cpp +++ b/src/msw/combobox.cpp @@ -141,10 +141,10 @@ LRESULT APIENTRY _EXPORT wxComboEditWndProc(HWND hWnd, return ::CallWindowProc(CASTWNDPROC gs_wndprocEdit, hWnd, message, wParam, lParam); } -WXHBRUSH wxComboBox::OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor, - WXUINT message, - WXWPARAM wParam, - WXLPARAM lParam) +WXHBRUSH wxComboBox::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor), + WXUINT WXUNUSED(message), + WXWPARAM WXUNUSED(wParam), + WXLPARAM WXUNUSED(lParam)) { #if wxUSE_CTL3D if ( m_useCtl3D ) @@ -183,7 +183,7 @@ bool wxComboBox::MSWProcessEditMsg(WXUINT msg, WXWPARAM wParam, WXLPARAM lParam) { case WM_CHAR: return HandleChar(wParam, lParam, TRUE /* isASCII */); - + case WM_KEYDOWN: return HandleKeyDown(wParam, lParam); @@ -373,7 +373,7 @@ void wxComboBox::Paste() SendMessage(hWnd, WM_PASTE, 0, 0L); } -void wxComboBox::SetEditable(bool editable) +void wxComboBox::SetEditable(bool WXUNUSED(editable)) { // Can't implement in MSW? // HWND hWnd = GetHwnd(); @@ -464,7 +464,7 @@ void wxComboBox::SetSelection(long from, long to) toChar = -1; } - if ( + if ( #ifdef __WIN32__ SendMessage(hWnd, CB_SETEDITSEL, (WPARAM)0, (LPARAM)MAKELONG(fromChar, toChar)) #else // Win16 diff --git a/src/msw/control.cpp b/src/msw/control.cpp index 1bea290c7e..fd82221246 100644 --- a/src/msw/control.cpp +++ b/src/msw/control.cpp @@ -223,10 +223,10 @@ void wxControl::OnEraseBackground(wxEraseEvent& event) ::SetMapMode(hdc, mode); } -WXHBRUSH wxControl::OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor, - WXUINT message, - WXWPARAM wParam, - WXLPARAM lParam) +WXHBRUSH wxControl::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor), + WXUINT WXUNUSED(message), + WXWPARAM WXUNUSED(wParam), + WXLPARAM WXUNUSED(lParam)) { #if wxUSE_CTL3D if ( m_useCtl3D ) diff --git a/src/msw/curico.cpp b/src/msw/curico.cpp index 4e8f97154d..34b895da03 100644 --- a/src/msw/curico.cpp +++ b/src/msw/curico.cpp @@ -88,7 +88,7 @@ HICON CursorToIcon( wxChar *szFileName, HINSTANCE hInst, int *W, int *H) HANDLE ReadIcon( wxChar *szFileName, int *W, int *H) { ICONFILEHEADER iconFileHead; // ICON file header structure ICONFILERES iconFileRes; // ICON file resource - WORD cbHead, + UINT cbHead, cbRes, cbBits; // Used for reading in file int hFile; // File handle @@ -175,7 +175,7 @@ HANDLE ReadIcon( wxChar *szFileName, int *W, int *H) //* bitmaps. So, no need to convert the AND bitmask. * //* 7) Since a DIB is stored upside down, flip the monochrome AND bits* //* by scanlines. * -//* 8) Use the XOR and AND bits and create an icon with CreateIcon. * +//* 8) Use the XOR and AND bits and create an icon with CreateIcon. * //***************************************************************************** HICON MakeIcon( HANDLE hDIB, HINSTANCE hInst) @@ -253,8 +253,8 @@ HICON MakeIcon( HANDLE hDIB, HINSTANCE hInst) szFlip[(k - 1) - j] = *(DWORD FAR *)lpANDbits; // 8) Use the XOR and AND bits and create an icon with CreateIcon. - hIcon = CreateIcon( hInst, bmpXor.bmWidth, bmpXor.bmHeight, bmpXor.bmPlanes, - bmpXor.bmBitsPixel, (const BYTE *)szFlip, (const BYTE *)lpXorDDB); + hIcon = CreateIcon( hInst, bmpXor.bmWidth, bmpXor.bmHeight, (BYTE)bmpXor.bmPlanes, + (BYTE)bmpXor.bmBitsPixel, (const BYTE *)szFlip, (const BYTE *)lpXorDDB); // Clean up before exiting. DeleteObject( hbmXor); @@ -335,7 +335,7 @@ HCURSOR IconToCursor( wxChar *szFileName, HINSTANCE hInst, int XHot, int YHot, HANDLE ReadCur( wxChar *szFileName, LPPOINT lpptHotSpot, int *W, int *H) { CURFILEHEADER curFileHead; // CURSOR file header structure CURFILERES curFileRes; // CURSOR file resource - WORD cbHead, + UINT cbHead, cbRes, cbBits; // Used for reading in file LPBITMAPINFO lpDIB; // Pointer to DIB memory @@ -644,9 +644,9 @@ WORD PaletteSize( LPSTR pv) NumColors = DIBNumColors((LPSTR )lpbi); if(lpbi->biSize == sizeof( BITMAPCOREHEADER)) // OS/2 style DIBs - return NumColors * sizeof( RGBTRIPLE); + return (WORD)(NumColors * sizeof( RGBTRIPLE)); else - return NumColors * sizeof( RGBQUAD); + return (WORD)(NumColors * sizeof( RGBQUAD)); } //***************************************************************************** @@ -672,7 +672,7 @@ WORD DIBNumColors ( LPSTR pv) // is in biClrUsed, whereas in the BITMAPCORE - style headers, it // is dependent on the bits per pixel ( = 2 raised to the power of // bits/pixel). - + if(lpbi->biSize != sizeof( BITMAPCOREHEADER)) { if(lpbi->biClrUsed != 0) @@ -843,7 +843,7 @@ HCURSOR MakeCursorFromBitmap(HINSTANCE hInst, HBITMAP hBitmap, POINT *pPoint) /* * This doesn't work: just gives us a grey square. Ideas, anyone? */ - + HICON MakeIconFromBitmap(HINSTANCE hInst, HBITMAP hBitmap) { HDC hDCColor, hDCMono; diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp index 86e1a772cf..2ffb926417 100644 --- a/src/msw/dc.cpp +++ b/src/msw/dc.cpp @@ -1171,7 +1171,7 @@ void wxDC::SetRop(WXHDC dc) SetROP2(GetHdc(), rop); } -bool wxDC::StartDoc(const wxString& message) +bool wxDC::StartDoc(const wxString& WXUNUSED(message)) { // We might be previewing, so return TRUE to let it continue. return TRUE; diff --git a/src/msw/dcprint.cpp b/src/msw/dcprint.cpp index 6ed8cdc9b1..c77f88f080 100644 --- a/src/msw/dcprint.cpp +++ b/src/msw/dcprint.cpp @@ -472,7 +472,7 @@ bool wxPrinterDC::DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, wxDC *source, wxCoord xsrc, wxCoord ysrc, - int rop, bool useMask) + int WXUNUSED(rop), bool useMask) { bool success = TRUE; @@ -496,7 +496,7 @@ bool wxPrinterDC::DoBlit(wxCoord xdest, wxCoord ydest, HBRUSH brush = ::CreateSolidBrush(::GetPixel(dc_src, x, y)); rect.left = xdest + x; rect.right = rect.left + 1; - rect.top = ydest + y; + rect.top = ydest + y; rect.bottom = rect.top + 1; ::FillRect(GetHdc(), &rect, brush); ::DeleteObject(brush); diff --git a/src/msw/dialog.cpp b/src/msw/dialog.cpp index f38a3e9c06..4b4259a099 100644 --- a/src/msw/dialog.cpp +++ b/src/msw/dialog.cpp @@ -476,7 +476,7 @@ void wxDialog::EndModal(int retCode) // ---------------------------------------------------------------------------- // Standard buttons -void wxDialog::OnOK(wxCommandEvent& event) +void wxDialog::OnOK(wxCommandEvent& WXUNUSED(event)) { if ( Validate() && TransferDataFromWindow() ) { @@ -484,7 +484,7 @@ void wxDialog::OnOK(wxCommandEvent& event) } } -void wxDialog::OnApply(wxCommandEvent& event) +void wxDialog::OnApply(wxCommandEvent& WXUNUSED(event)) { if ( Validate() ) TransferDataFromWindow(); @@ -492,12 +492,12 @@ void wxDialog::OnApply(wxCommandEvent& event) // TODO probably need to disable the Apply button until things change again } -void wxDialog::OnCancel(wxCommandEvent& event) +void wxDialog::OnCancel(wxCommandEvent& WXUNUSED(event)) { EndModal(wxID_CANCEL); } -void wxDialog::OnCloseWindow(wxCloseEvent& event) +void wxDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event)) { // We'll send a Cancel message by default, which may close the dialog. // Check for looping if the Cancel event handler calls Close(). @@ -538,7 +538,7 @@ bool wxDialog::Destroy() return TRUE; } -void wxDialog::OnSysColourChanged(wxSysColourChangedEvent& event) +void wxDialog::OnSysColourChanged(wxSysColourChangedEvent& WXUNUSED(event)) { #if wxUSE_CTL3D Ctl3dColorChange(); diff --git a/src/msw/dib.cpp b/src/msw/dib.cpp index 40531079da..5a9017faf0 100644 --- a/src/msw/dib.cpp +++ b/src/msw/dib.cpp @@ -159,9 +159,9 @@ WORD wxPaletteSize(VOID FAR * pv) NumColors = DibNumColors(lpbi); if (lpbi->biSize == sizeof(BITMAPCOREHEADER)) - return NumColors * sizeof(RGBTRIPLE); + return (WORD)(NumColors * sizeof(RGBTRIPLE)); else - return NumColors * sizeof(RGBQUAD); + return (WORD)(NumColors * sizeof(RGBQUAD)); } /**************************************************************************** @@ -528,7 +528,7 @@ BOOL wxReadDIB(LPTSTR lpFileName, HBITMAP *bitmap, HPALETTE *palette) } /* offset to the bits from start of DIB header */ - offBits = (WORD)lpbi->biSize + nNumColors * sizeof(RGBQUAD); + offBits = (WORD)(lpbi->biSize + nNumColors * sizeof(RGBQUAD)); if (bf.bfOffBits != 0L) { diff --git a/src/msw/dibutils.cpp b/src/msw/dibutils.cpp index 8837d90751..6ee22bf304 100644 --- a/src/msw/dibutils.cpp +++ b/src/msw/dibutils.cpp @@ -321,8 +321,8 @@ PDIB wxDibReadBitmapInfo(HFILE fh) bi.biSize = sizeof(BITMAPINFOHEADER); bi.biWidth = (DWORD)bc.bcWidth; bi.biHeight = (DWORD)bc.bcHeight; - bi.biPlanes = (UINT)bc.bcPlanes; - bi.biBitCount = (UINT)bc.bcBitCount; + bi.biPlanes = (WORD)bc.bcPlanes; + bi.biBitCount = (WORD)bc.bcBitCount; bi.biCompression = BI_RGB; bi.biSizeImage = 0; bi.biXPelsPerMeter = 0; @@ -549,7 +549,7 @@ static void xlatClut4(BYTE FAR *pb, DWORD dwSize, BYTE FAR *xlat) #define RLE_EOF 1 #define RLE_JMP 2 -static void xlatRle8(BYTE FAR *pb, DWORD dwSize, BYTE FAR *xlat) +static void xlatRle8(BYTE FAR *pb, DWORD WXUNUSED(dwSize), BYTE FAR *xlat) { BYTE cnt; BYTE b; @@ -595,7 +595,7 @@ static void xlatRle8(BYTE FAR *pb, DWORD dwSize, BYTE FAR *xlat) } } -static void xlatRle4(BYTE FAR *pb, DWORD dwSize, BYTE FAR *xlat) +static void xlatRle4(BYTE FAR *WXUNUSED(pb), DWORD WXUNUSED(dwSize), BYTE FAR *WXUNUSED(xlat)) { } @@ -708,7 +708,7 @@ HPALETTE wxMakePalette(const BITMAPINFO FAR* Info, UINT flags) HPALETTE hPalette; const RGBQUAD FAR* rgb = Info->bmiColors; - WORD nColors = Info->bmiHeader.biClrUsed; + WORD nColors = (WORD)Info->bmiHeader.biClrUsed; if (nColors) { LOGPALETTE* logPal = (LOGPALETTE*) new BYTE[sizeof(LOGPALETTE) + (nColors-1)*sizeof(PALETTEENTRY)]; diff --git a/src/msw/enhmeta.cpp b/src/msw/enhmeta.cpp index f7ab6178fa..ac757f7bd5 100644 --- a/src/msw/enhmeta.cpp +++ b/src/msw/enhmeta.cpp @@ -183,8 +183,8 @@ wxEnhMetaFileDC::wxEnhMetaFileDC(const wxString& filename, const wxString& description) { ScreenHDC hdcRef; - - RECT rect, *pRect; + RECT rect; + RECT *pRect; if ( width && height ) { rect.top = diff --git a/src/msw/filedlg.cpp b/src/msw/filedlg.cpp index 805374a8e9..73a9a8128d 100644 --- a/src/msw/filedlg.cpp +++ b/src/msw/filedlg.cpp @@ -193,7 +193,7 @@ wxString wxFileSelectorEx(const wxChar *title, wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message, const wxString& defaultDir, const wxString& defaultFileName, const wxString& wildCard, - long style, const wxPoint& pos) + long style, const wxPoint& WXUNUSED(pos)) { m_message = message; m_dialogStyle = style; diff --git a/src/msw/font.cpp b/src/msw/font.cpp index 39f7d08a7e..cd97c822e5 100644 --- a/src/msw/font.cpp +++ b/src/msw/font.cpp @@ -290,42 +290,42 @@ bool wxNativeFontInfo::FromString(const wxString& s) token = tokenizer.GetNextToken(); if ( !token.ToLong(&l) ) return FALSE; - lf.lfItalic = l; + lf.lfItalic = (BYTE)l; token = tokenizer.GetNextToken(); if ( !token.ToLong(&l) ) return FALSE; - lf.lfUnderline = l; + lf.lfUnderline = (BYTE)l; token = tokenizer.GetNextToken(); if ( !token.ToLong(&l) ) return FALSE; - lf.lfStrikeOut = l; + lf.lfStrikeOut = (BYTE)l; token = tokenizer.GetNextToken(); if ( !token.ToLong(&l) ) return FALSE; - lf.lfCharSet = l; + lf.lfCharSet = (BYTE)l; token = tokenizer.GetNextToken(); if ( !token.ToLong(&l) ) return FALSE; - lf.lfOutPrecision = l; + lf.lfOutPrecision = (BYTE)l; token = tokenizer.GetNextToken(); if ( !token.ToLong(&l) ) return FALSE; - lf.lfClipPrecision = l; + lf.lfClipPrecision = (BYTE)l; token = tokenizer.GetNextToken(); if ( !token.ToLong(&l) ) return FALSE; - lf.lfQuality = l; + lf.lfQuality = (BYTE)l; token = tokenizer.GetNextToken(); if ( !token.ToLong(&l) ) return FALSE; - lf.lfPitchAndFamily = l; + lf.lfPitchAndFamily = (BYTE)l; token = tokenizer.GetNextToken(); if(!token) @@ -450,7 +450,7 @@ bool wxFont::RealizeResource() return TRUE; } -bool wxFont::FreeResource(bool force) +bool wxFont::FreeResource(bool WXUNUSED(force)) { if ( GetResourceHandle() ) { diff --git a/src/msw/gauge95.cpp b/src/msw/gauge95.cpp index c1c2ac99af..8b4bfbeb90 100644 --- a/src/msw/gauge95.cpp +++ b/src/msw/gauge95.cpp @@ -137,11 +137,11 @@ bool wxGauge95::Create(wxWindow *parent, wxWindowID id, return TRUE; } -void wxGauge95::SetShadowWidth(int w) +void wxGauge95::SetShadowWidth(int WXUNUSED(w)) { } -void wxGauge95::SetBezelFace(int w) +void wxGauge95::SetBezelFace(int WXUNUSED(w)) { } diff --git a/src/msw/gdiimage.cpp b/src/msw/gdiimage.cpp index 63673882cc..276858546f 100644 --- a/src/msw/gdiimage.cpp +++ b/src/msw/gdiimage.cpp @@ -391,7 +391,7 @@ bool wxBMPFileHandler::SaveFile(wxBitmap *bitmap, bool wxICOFileHandler::LoadIcon(wxIcon *icon, const wxString& name, - long flags, + long WXUNUSED(flags), int desiredWidth, int desiredHeight) { #if wxUSE_RESOURCE_LOADING_IN_MSW @@ -475,7 +475,7 @@ bool wxICOFileHandler::LoadIcon(wxIcon *icon, bool wxICOResourceHandler::LoadIcon(wxIcon *icon, const wxString& name, - long flags, + long WXUNUSED(flags), int desiredWidth, int desiredHeight) { HICON hicon; diff --git a/src/msw/gsocket.c b/src/msw/gsocket.c index 60d2c3f417..a6e021bc68 100644 --- a/src/msw/gsocket.c +++ b/src/msw/gsocket.c @@ -28,6 +28,7 @@ #ifndef __GSOCKET_STANDALONE__ +# include "wx/defs.h" # include "wx/setup.h" #endif @@ -82,10 +83,10 @@ GSocket *GSocket_new(void) socket->m_cbacks[i] = NULL; } socket->m_detected = 0; - socket->m_local = NULL; - socket->m_peer = NULL; + socket->m_local = NULL; + socket->m_peer = NULL; socket->m_error = GSOCK_NOERROR; - socket->m_server = FALSE; + socket->m_server = FALSE; socket->m_stream = TRUE; socket->m_non_blocking = FALSE; socket->m_timeout.tv_sec = 10 * 60; /* 10 minutes */ @@ -272,11 +273,11 @@ GAddress *GSocket_GetPeer(GSocket *socket) * Sets up this socket as a server. The local address must have been * set with GSocket_SetLocal() before GSocket_SetServer() is called. * Returns GSOCK_NOERROR on success, one of the following otherwise: - * + * * Error codes: * GSOCK_INVSOCK - the socket is in use. * GSOCK_INVADDR - the local address has not been set. - * GSOCK_IOERR - low-level error. + * GSOCK_IOERR - low-level error. */ GSocketError GSocket_SetServer(GSocket *sck) { @@ -344,7 +345,7 @@ GSocketError GSocket_SetServer(GSocket *sck) * GSOCK_TIMEDOUT - timeout, no incoming connections. * GSOCK_WOULDBLOCK - the call would block and the socket is nonblocking. * GSOCK_MEMERR - couldn't allocate memory. - * GSOCK_IOERR - low-level error. + * GSOCK_IOERR - low-level error. */ GSocket *GSocket_WaitConnection(GSocket *sck) { @@ -447,7 +448,7 @@ GSocket *GSocket_WaitConnection(GSocket *sck) * GSOCK_TIMEDOUT - timeout, the connection failed. * GSOCK_WOULDBLOCK - connection in progress (nonblocking sockets only) * GSOCK_MEMERR - couldn't allocate memory. - * GSOCK_IOERR - low-level error. + * GSOCK_IOERR - low-level error. */ GSocketError GSocket_Connect(GSocket *sck, GSocketStream stream) { @@ -552,7 +553,7 @@ GSocketError GSocket_Connect(GSocket *sck, GSocketStream stream) * Error codes: * GSOCK_INVSOCK - the socket is in use. * GSOCK_INVADDR - the local address has not been set. - * GSOCK_IOERR - low-level error. + * GSOCK_IOERR - low-level error. */ GSocketError GSocket_SetNonOriented(GSocket *sck) { @@ -754,7 +755,7 @@ GSocketEventFlags GSocket_Select(GSocket *socket, GSocketEventFlags flags) return result; -#else +#else assert(socket != NULL); return flags & socket->m_detected; @@ -806,7 +807,7 @@ GSocketError GSocket_GetError(GSocket *socket) * operation, there is still data available, the callback function will * be called again. * GSOCK_OUTPUT: - * The socket is available for writing. That is, the next write call + * The socket is available for writing. That is, the next write call * won't block. This event is generated only once, when the connection is * first established, and then only if a call failed with GSOCK_WOULDBLOCK, * when the output buffer empties again. This means that the app should @@ -1373,7 +1374,7 @@ GSocketError GAddress_UNIX_GetPath(GAddress *address, char *path, size_t sbuf) #else /* !wxUSE_SOCKETS */ -/* +/* * Translation unit shouldn't be empty, so include this typedef to make the * compiler (VC++ 6.0, for example) happy */ diff --git a/src/msw/gsockmsw.c b/src/msw/gsockmsw.c index 65668b8c49..849752e7d6 100644 --- a/src/msw/gsockmsw.c +++ b/src/msw/gsockmsw.c @@ -20,6 +20,7 @@ #endif #ifndef __GSOCKET_STANDALONE__ +#include "wx/defs.h" #include "wx/setup.h" #endif @@ -278,7 +279,7 @@ void _GSocket_Disable_Events(GSocket *socket) #else /* !wxUSE_SOCKETS */ -/* +/* * Translation unit shouldn't be empty, so include this typedef to make the * compiler (VC++ 6.0, for example) happy */ diff --git a/src/msw/listbox.cpp b/src/msw/listbox.cpp index a2175877e7..408344a7b9 100644 --- a/src/msw/listbox.cpp +++ b/src/msw/listbox.cpp @@ -100,7 +100,7 @@ wxListBoxItem::wxListBoxItem(const wxString& str) : wxOwnerDrawn(str, FALSE) SetMarginWidth(0); } -wxOwnerDrawn *wxListBox::CreateItem(size_t n) +wxOwnerDrawn *wxListBox::CreateItem(size_t WXUNUSED(n)) { return new wxListBoxItem(); } diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index 2d363b6ac3..f0b62631d5 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -302,7 +302,7 @@ wxListCtrl::~wxListCtrl() delete m_textCtrl; m_textCtrl = NULL; } - + if (m_ownsImageListNormal) delete m_imageListNormal; if (m_ownsImageListSmall) delete m_imageListSmall; if (m_ownsImageListState) delete m_imageListState; @@ -730,7 +730,7 @@ bool wxListCtrl::SetItemState(long item, long state, long stateMask) } // Sets the item image -bool wxListCtrl::SetItemImage(long item, int image, int selImage) +bool wxListCtrl::SetItemImage(long item, int image, int WXUNUSED(selImage)) { wxListItem info; @@ -1058,7 +1058,7 @@ wxTextCtrl* wxListCtrl::EditLabel(long item, wxClassInfo* textControlClass) } // End label editing, optionally cancelling the edit -bool wxListCtrl::EndEditLabel(bool cancel) +bool wxListCtrl::EndEditLabel(bool WXUNUSED(cancel)) { wxFAIL; @@ -1844,7 +1844,7 @@ void wxListItem::ClearAttributes() m_attr = NULL; } -static void wxConvertFromMSWListItem(const wxListCtrl *ctrl, wxListItem& info, LV_ITEM& lvItem, HWND getFullInfo) +static void wxConvertFromMSWListItem(const wxListCtrl *WXUNUSED(ctrl), wxListItem& info, LV_ITEM& lvItem, HWND getFullInfo) { info.m_data = lvItem.lParam; info.m_mask = 0; diff --git a/src/msw/main.cpp b/src/msw/main.cpp index 237eb9eee3..1ee977b104 100644 --- a/src/msw/main.cpp +++ b/src/msw/main.cpp @@ -114,8 +114,11 @@ BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved) wxEntryCleanup(); break; } +#else + (void)hModule; + (void)fdwReason; #endif // !WXMAKINGDLL - + (void)lpReserved; return TRUE; } diff --git a/src/msw/mimetype.cpp b/src/msw/mimetype.cpp index a73c5150e0..d69a196151 100644 --- a/src/msw/mimetype.cpp +++ b/src/msw/mimetype.cpp @@ -594,7 +594,7 @@ wxFileType *wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& ftInfo) // now make other extensions have the same filetype - + for (iExtCount=1; iExtCount < ftInfo.GetExtensionsCount(); iExtCount++ ) { ext = ftInfo.GetExtensions()[iExtCount]; @@ -636,8 +636,8 @@ wxFileType *wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& ftInfo) // SetCommand(), SetDefaultIcon() &c will use it later) wxRegKey keyFT(wxRegKey::HKCR, filetype); ok = keyFT.Create(); - - wxFileType *ft = NULL; + + wxFileType *ft = NULL; ft = CreateFileType(filetype, extWithDot); if (ft) @@ -654,7 +654,7 @@ wxFileType *wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& ftInfo) bool wxFileTypeImpl::SetCommand(const wxString& cmd, const wxString& verb, - bool overwriteprompt) + bool WXUNUSED(overwriteprompt)) { wxCHECK_MSG( !m_ext.IsEmpty() && !verb.IsEmpty(), FALSE, _T("SetCommand() needs an extension and a verb") ); diff --git a/src/msw/ole/dataobj.cpp b/src/msw/ole/dataobj.cpp index b2521b7143..9af22753cf 100644 --- a/src/msw/ole/dataobj.cpp +++ b/src/msw/ole/dataobj.cpp @@ -73,13 +73,7 @@ class wxIEnumFORMATETC : public IEnumFORMATETC { public: wxIEnumFORMATETC(const wxDataFormat* formats, ULONG nCount); - - // to suppress the gcc warning about "class has virtual functions but non - // virtual dtor" -#ifdef __GNUG__ - virtual -#endif - ~wxIEnumFORMATETC() { delete [] m_formats; } + virtual ~wxIEnumFORMATETC() { delete [] m_formats; } DECLARE_IUNKNOWN_METHODS; @@ -103,13 +97,7 @@ class wxIDataObject : public IDataObject { public: wxIDataObject(wxDataObject *pDataObject); - - // to suppress the gcc warning about "class has virtual functions but non - // virtual dtor" -#ifdef __GNUG__ - virtual -#endif - ~wxIDataObject(); + virtual ~wxIDataObject(); // normally, wxDataObject controls our lifetime (i.e. we're deleted when it // is), but in some cases, the situation is inversed, that is we delete it @@ -145,7 +133,7 @@ private: void wxDataFormat::SetId(const wxChar *format) { - m_format = ::RegisterClipboardFormat(format); + m_format = (wxDataFormat::NativeFormat)::RegisterClipboardFormat(format); if ( !m_format ) { wxLogError(_("Couldn't register clipboard format '%s'."), format); @@ -196,7 +184,7 @@ wxIEnumFORMATETC::wxIEnumFORMATETC(const wxDataFormat *formats, ULONG nCount) STDMETHODIMP wxIEnumFORMATETC::Next(ULONG celt, FORMATETC *rgelt, - ULONG *pceltFetched) + ULONG *WXUNUSED(pceltFetched)) { wxLogTrace(wxTRACE_OleCalls, wxT("wxIEnumFORMATETC::Next")); @@ -611,7 +599,7 @@ STDMETHODIMP wxIDataObject::QueryGetData(FORMATETC *pformatetc) return S_OK; } -STDMETHODIMP wxIDataObject::GetCanonicalFormatEtc(FORMATETC *pFormatetcIn, +STDMETHODIMP wxIDataObject::GetCanonicalFormatEtc(FORMATETC *WXUNUSED(pFormatetcIn), FORMATETC *pFormatetcOut) { wxLogTrace(wxTRACE_OleCalls, wxT("wxIDataObject::GetCanonicalFormatEtc")); @@ -632,7 +620,8 @@ STDMETHODIMP wxIDataObject::EnumFormatEtc(DWORD dwDir, : wxDataObject::Set; size_t nFormatCount = m_pDataObject->GetFormatCount(dir); - wxDataFormat format, *formats; + wxDataFormat format; + wxDataFormat *formats; formats = nFormatCount == 1 ? &format : new wxDataFormat[nFormatCount]; m_pDataObject->GetAllFormats(formats, dir); @@ -651,20 +640,20 @@ STDMETHODIMP wxIDataObject::EnumFormatEtc(DWORD dwDir, // advise sink functions (not implemented) // ---------------------------------------------------------------------------- -STDMETHODIMP wxIDataObject::DAdvise(FORMATETC *pformatetc, - DWORD advf, - IAdviseSink *pAdvSink, - DWORD *pdwConnection) +STDMETHODIMP wxIDataObject::DAdvise(FORMATETC *WXUNUSED(pformatetc), + DWORD WXUNUSED(advf), + IAdviseSink *WXUNUSED(pAdvSink), + DWORD *WXUNUSED(pdwConnection)) { return OLE_E_ADVISENOTSUPPORTED; } -STDMETHODIMP wxIDataObject::DUnadvise(DWORD dwConnection) +STDMETHODIMP wxIDataObject::DUnadvise(DWORD WXUNUSED(dwConnection)) { return OLE_E_ADVISENOTSUPPORTED; } -STDMETHODIMP wxIDataObject::EnumDAdvise(IEnumSTATDATA **ppenumAdvise) +STDMETHODIMP wxIDataObject::EnumDAdvise(IEnumSTATDATA **WXUNUSED(ppenumAdvise)) { return OLE_E_ADVISENOTSUPPORTED; } @@ -752,7 +741,7 @@ bool wxBitmapDataObject::GetDataHere(void *buf) const return wxConvertBitmapToDIB((LPBITMAPINFO)buf, GetBitmap()) != 0; } -bool wxBitmapDataObject::SetData(size_t len, const void *buf) +bool wxBitmapDataObject::SetData(size_t WXUNUSED(len), const void *buf) { wxBitmap bitmap(wxConvertDIBToBitmap((const LPBITMAPINFO)buf)); @@ -1099,7 +1088,7 @@ size_t wxConvertBitmapToDIB(LPBITMAPINFO pbi, const wxBitmap& bitmap) // calculate the number of bits per pixel and the number of items in // bmiColors array (whose meaning depends on the bitmap format) WORD biBits = bm.bmPlanes * bm.bmBitsPixel; - WORD biColors = wxGetNumOfBitmapColors(biBits); + WORD biColors = (WORD)wxGetNumOfBitmapColors(biBits); BITMAPINFO bi2; diff --git a/src/msw/ole/droptgt.cpp b/src/msw/ole/droptgt.cpp index 158b8bd3da..99db777028 100644 --- a/src/msw/ole/droptgt.cpp +++ b/src/msw/ole/droptgt.cpp @@ -61,11 +61,7 @@ class wxIDropTarget : public IDropTarget { public: wxIDropTarget(wxDropTarget *p); - // suppress gcc warning -#ifdef __GNUG__ - virtual -#endif - ~wxIDropTarget(); + virtual ~wxIDropTarget(); // accessors for wxDropTarget void SetHwnd(HWND hwnd) { m_hwnd = hwnd; } @@ -425,7 +421,8 @@ wxDataFormat wxDropTarget::GetSupportedFormat(IDataObject *pIDataSource) const // get the list of supported formats size_t nFormats = m_dataObject->GetFormatCount(wxDataObject::Set); - wxDataFormat format, *formats; + wxDataFormat format; + wxDataFormat *formats; formats = nFormats == 1 ? &format : new wxDataFormat[nFormats]; m_dataObject->GetAllFormats(formats, wxDataObject::Set); diff --git a/src/msw/ownerdrw.cpp b/src/msw/ownerdrw.cpp index dc65344eef..27c8d4f860 100644 --- a/src/msw/ownerdrw.cpp +++ b/src/msw/ownerdrw.cpp @@ -2,7 +2,7 @@ // Name: msw/ownerdrw.cpp // Purpose: implementation of wxOwnerDrawn class // Author: Vadim Zeitlin -// Modified by: +// Modified by: // Created: 13.11.97 // RCS-ID: $Id$ // Copyright: (c) 1998 Vadim Zeitlin @@ -44,8 +44,8 @@ // ctor // ---- -wxOwnerDrawn::wxOwnerDrawn(const wxString& str, - bool bCheckable, bool bMenuItem) +wxOwnerDrawn::wxOwnerDrawn(const wxString& str, + bool bCheckable, bool WXUNUSED(bMenuItem)) : m_strName(str) { m_bCheckable = bCheckable; @@ -87,7 +87,7 @@ bool wxOwnerDrawn::OnMeasureItem(size_t *pwidth, size_t *pheight) // Ray Gilbert's changes - Corrects the problem of a BMP // being placed next to text in a menu item, and the BMP does - // not match the size expected by the system. This will + // not match the size expected by the system. This will // resize the space so the BMP will fit. Without this, BMPs // must be no larger or smaller than 16x16. if (m_bmpChecked.Ok()) @@ -97,18 +97,18 @@ bool wxOwnerDrawn::OnMeasureItem(size_t *pwidth, size_t *pheight) wxSystemSettings::GetSystemMetric(wxSYS_EDGE_Y); if (*pheight < adjustedHeight) *pheight = adjustedHeight; - + // Does BMP encroach on default check menu position? size_t adjustedWidth = m_bmpChecked.GetWidth() + (wxSystemSettings::GetSystemMetric(wxSYS_EDGE_X) * 2); if (ms_nDefaultMarginWidth < adjustedWidth) *pwidth += adjustedWidth - ms_nDefaultMarginWidth; - + // Do we need to widen margin to fit BMP? if ((size_t)GetMarginWidth() < adjustedWidth) SetMarginWidth(adjustedWidth); } - + m_nHeight = *pheight; // remember height for use in OnDrawItem return TRUE; @@ -149,7 +149,7 @@ bool wxOwnerDrawn::OnDrawItem(wxDC& dc, const wxRect& rc, wxODAction act, wxODSt colBack = m_colBack.Ok() ? ToRGB(m_colBack) : GetSysColor(COLOR_WINDOW); colText = m_colText.Ok() ? ToRGB(m_colText) : GetSysColor(COLOR_WINDOWTEXT); } - + #ifdef O_DRAW_NATIVE_API #define hdc (HDC)dc.GetHDC() COLORREF colOldText = ::SetTextColor(hdc, colText), @@ -162,10 +162,10 @@ bool wxOwnerDrawn::OnDrawItem(wxDC& dc, const wxRect& rc, wxODAction act, wxODSt // select the font and draw the text // --------------------------------- - // determine where to draw and leave space for a check-mark. + // determine where to draw and leave space for a check-mark. int x = rc.x + GetMarginWidth(); - // using native API because it reckognizes '&' + // using native API because it reckognizes '&' #ifdef O_DRAW_NATIVE_API int nPrevMode = SetBkMode(hdc, TRANSPARENT); HBRUSH hbr = CreateSolidBrush(colBack), @@ -187,8 +187,8 @@ bool wxOwnerDrawn::OnDrawItem(wxDC& dc, const wxRect& rc, wxODAction act, wxODSt } HFONT hPrevFont = (HFONT) ::SelectObject(hdc, hfont); - DrawState(hdc, NULL, NULL, - (LPARAM)(const wxChar *)m_strName, m_strName.Length(), + DrawState(hdc, NULL, NULL, + (LPARAM)(const wxChar *)m_strName, m_strName.Length(), x, rc.y, rc.GetWidth(), rc.GetHeight(), DST_PREFIXTEXT | ( st & wxODDisabled ? DSS_DISABLED : 0) ); @@ -206,7 +206,7 @@ bool wxOwnerDrawn::OnDrawItem(wxDC& dc, const wxRect& rc, wxODAction act, wxODSt if ( st & wxODChecked ) { // using native APIs for performance and simplicity #ifdef O_DRAW_NATIVE_API - // what goes on: DrawFrameControl creates a b/w mask, + // what goes on: DrawFrameControl creates a b/w mask, // then we copy it to screen to have right colors // first create a monochrome bitmap in a memory DC @@ -224,7 +224,7 @@ bool wxOwnerDrawn::OnDrawItem(wxDC& dc, const wxRect& rc, wxODAction act, wxODSt } // finally copy it to screen DC and clean up - BitBlt(hdc, rc.x, rc.y, GetMarginWidth(), m_nHeight, + BitBlt(hdc, rc.x, rc.y, GetMarginWidth(), m_nHeight, hdcMem, 0, 0, SRCCOPY); DeleteDC(hdcMem); @@ -254,15 +254,15 @@ bool wxOwnerDrawn::OnDrawItem(wxDC& dc, const wxRect& rc, wxODAction act, wxODSt // heightDiff = -2; //MT: blit with mask enabled. - dc.Blit(rc.x + (GetMarginWidth() - nBmpWidth) / 2, - rc.y + heightDiff / 2, - nBmpWidth, nBmpHeight, + dc.Blit(rc.x + (GetMarginWidth() - nBmpWidth) / 2, + rc.y + heightDiff / 2, + nBmpWidth, nBmpHeight, &dcMem, 0, 0, wxCOPY, TRUE); if ( st & wxODSelected ) { #ifdef O_DRAW_NATIVE_API - RECT rectBmp = { rc.GetLeft(), rc.GetTop(), - rc.GetLeft() + GetMarginWidth(), + RECT rectBmp = { rc.GetLeft(), rc.GetTop(), + rc.GetLeft() + GetMarginWidth(), rc.GetTop() + m_nHeight }; SetBkColor(hdc, colBack); DrawEdge(hdc, &rectBmp, EDGE_RAISED, BF_SOFT | BF_RECT); diff --git a/src/msw/palette.cpp b/src/msw/palette.cpp index 891815bf74..724140c3aa 100644 --- a/src/msw/palette.cpp +++ b/src/msw/palette.cpp @@ -62,7 +62,7 @@ wxPalette::~wxPalette(void) // FreeResource(TRUE); } -bool wxPalette::FreeResource(bool force) +bool wxPalette::FreeResource(bool WXUNUSED(force)) { if ( M_PALETTEDATA && M_PALETTEDATA->m_hPalette) { @@ -78,7 +78,7 @@ bool wxPalette::Create(int n, const unsigned char *red, const unsigned char *gre #ifdef __WXWINE__ return (FALSE); - + #else m_refData = new wxPaletteRefData; @@ -102,7 +102,7 @@ bool wxPalette::Create(int n, const unsigned char *red, const unsigned char *gre M_PALETTEDATA->m_hPalette = (WXHPALETTE) CreatePalette((LPLOGPALETTE)npPal); LocalFree((HANDLE)npPal); return TRUE; - + #endif } diff --git a/src/msw/pen.cpp b/src/msw/pen.cpp index 9b3d3e4f98..b764f03bea 100644 --- a/src/msw/pen.cpp +++ b/src/msw/pen.cpp @@ -295,7 +295,7 @@ WXHANDLE wxPen::GetResourceHandle() return (WXHANDLE)M_PENDATA->m_hPen; } -bool wxPen::FreeResource(bool force) +bool wxPen::FreeResource(bool WXUNUSED(force)) { if (M_PENDATA && (M_PENDATA->m_hPen != 0)) { diff --git a/src/msw/printwin.cpp b/src/msw/printwin.cpp index 49cf5218ff..b159af65f9 100644 --- a/src/msw/printwin.cpp +++ b/src/msw/printwin.cpp @@ -87,9 +87,9 @@ wxWindowsPrinter::wxWindowsPrinter(wxPrintDialogData *data) wxWindowsPrinter::~wxWindowsPrinter() { - // avoids mingw warning about statement with no effect (FreeProcInstance - // doesn't do anything under Win32) -#ifndef __GNUWIN32__ + // avoids warning about statement with no effect (FreeProcInstance + // doesn't do anything under Win32) +#if !defined(WIN32) && !defined(_WIN32) && !defined(__WIN32__) && !defined(__NT__) && !defined(__GNUWIN32__) FreeProcInstance((FARPROC) m_lpAbortProc); #endif } @@ -311,7 +311,7 @@ wxDC* wxWindowsPrinter::PrintDialog(wxWindow *parent) { dc = dialog.GetPrintDC(); m_printDialogData = dialog.GetPrintDialogData(); - if (dc == NULL) + if (dc == NULL) sm_lastError = wxPRINTER_ERROR; else sm_lastError = wxPRINTER_NO_ERROR; diff --git a/src/msw/radiobox.cpp b/src/msw/radiobox.cpp index 54cd5c5a97..ca437cd5d9 100644 --- a/src/msw/radiobox.cpp +++ b/src/msw/radiobox.cpp @@ -329,7 +329,7 @@ void wxRadioBox::SetLabel(int item, const wxString& label) SetWindowText((HWND)m_radioButtons[item], label.c_str()); } -void wxRadioBox::SetLabel(int item, wxBitmap *bitmap) +void wxRadioBox::SetLabel(int WXUNUSED(item), wxBitmap *WXUNUSED(bitmap)) { /* m_radioWidth[item] = bitmap->GetWidth() + FB_MARGIN; @@ -836,10 +836,10 @@ long wxRadioBox::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) return wxControl::MSWWindowProc(nMsg, wParam, lParam); } -WXHBRUSH wxRadioBox::OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor, - WXUINT message, - WXWPARAM wParam, - WXLPARAM lParam) +WXHBRUSH wxRadioBox::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor), + WXUINT WXUNUSED(message), + WXWPARAM WXUNUSED(wParam), + WXLPARAM WXUNUSED(lParam)) { #if wxUSE_CTL3D if ( m_useCtl3D ) diff --git a/src/msw/radiobut.cpp b/src/msw/radiobut.cpp index 261af8c3d3..c75402ceaf 100644 --- a/src/msw/radiobut.cpp +++ b/src/msw/radiobut.cpp @@ -33,7 +33,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxRadioButton, wxControl) // IMPLEMENT_DYNAMIC_CLASS(wxBitmapRadioButton, wxRadioButton) -bool wxRadioButton::MSWCommand(WXUINT param, WXWORD id) +bool wxRadioButton::MSWCommand(WXUINT param, WXWORD WXUNUSED(id)) { if (param == BN_CLICKED) { @@ -172,10 +172,10 @@ void wxRadioButton::Command (wxCommandEvent & event) ProcessCommand (event); } -WXHBRUSH wxRadioButton::OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor, - WXUINT message, - WXWPARAM wParam, - WXLPARAM lParam) +WXHBRUSH wxRadioButton::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor), + WXUINT WXUNUSED(message), + WXWPARAM WXUNUSED(wParam), + WXLPARAM WXUNUSED(lParam)) { #if wxUSE_CTL3D if ( m_useCtl3D ) diff --git a/src/msw/regconf.cpp b/src/msw/regconf.cpp index 01f2468803..4b9844cfbf 100644 --- a/src/msw/regconf.cpp +++ b/src/msw/regconf.cpp @@ -464,7 +464,7 @@ bool wxRegConfig::GetNextEntry(wxString& str, long& lIndex) const return bOk; } -size_t wxRegConfig::GetNumberOfEntries(bool bRecursive) const +size_t wxRegConfig::GetNumberOfEntries(bool WXUNUSED(bRecursive)) const { size_t nEntries = 0; @@ -481,7 +481,7 @@ size_t wxRegConfig::GetNumberOfEntries(bool bRecursive) const return nEntries; } -size_t wxRegConfig::GetNumberOfGroups(bool bRecursive) const +size_t wxRegConfig::GetNumberOfGroups(bool WXUNUSED(bRecursive)) const { size_t nGroups = 0; @@ -741,7 +741,7 @@ bool wxRegConfig::RenameGroup(const wxString& oldName, const wxString& newName) // ---------------------------------------------------------------------------- // deleting // ---------------------------------------------------------------------------- -bool wxRegConfig::DeleteEntry(const wxString& value, bool bGroupIfEmptyAlso) +bool wxRegConfig::DeleteEntry(const wxString& value, bool WXUNUSED(bGroupIfEmptyAlso)) { wxConfigPathChanger path(this, value); diff --git a/src/msw/scrolbar.cpp b/src/msw/scrolbar.cpp index 007c98067f..607c116a1e 100644 --- a/src/msw/scrolbar.cpp +++ b/src/msw/scrolbar.cpp @@ -51,7 +51,7 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id, #if wxUSE_VALIDATORS SetValidator(validator); #endif // wxUSE_VALIDATORS - + SetBackgroundColour(parent->GetBackgroundColour()) ; SetForegroundColour(parent->GetForegroundColour()) ; m_windowStyle = style; @@ -262,8 +262,8 @@ In version 4.0 or later, the maximum value that a scroll bar can report If the scroll bar has a page size greater than one, the maximum scrolling position is less than the maximum range value. You can use the following formula to calculate the maximum scrolling position: - -MaxScrollPos = MaxRangeValue - (PageSize - 1) + +MaxScrollPos = MaxRangeValue - (PageSize - 1) */ #if WXWIN_COMPATIBILITY @@ -326,8 +326,8 @@ void wxScrollBar::GetValues(int *viewStart, int *viewLength, int *objectLength, } #endif -WXHBRUSH wxScrollBar::OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor, - WXUINT message, WXWPARAM wParam, WXLPARAM lParam) +WXHBRUSH wxScrollBar::OnCtlColor(WXHDC WXUNUSED(pDC), WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor), + WXUINT WXUNUSED(message), WXWPARAM WXUNUSED(wParam), WXLPARAM WXUNUSED(lParam)) { return 0; } diff --git a/src/msw/spinbutt.cpp b/src/msw/spinbutt.cpp index 03428c16ee..67331d98f5 100644 --- a/src/msw/spinbutt.cpp +++ b/src/msw/spinbutt.cpp @@ -192,7 +192,7 @@ void wxSpinButton::SetRange(int minVal, int maxVal) (LPARAM) MAKELONG((short)maxVal, (short)minVal)); } -bool wxSpinButton::MSWOnScroll(int orientation, WXWORD wParam, +bool wxSpinButton::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam, WXWORD pos, WXHWND control) { wxCHECK_MSG( control, FALSE, wxT("scrolling what?") ) @@ -210,7 +210,7 @@ bool wxSpinButton::MSWOnScroll(int orientation, WXWORD wParam, return GetEventHandler()->ProcessEvent(event); } -bool wxSpinButton::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) +bool wxSpinButton::MSWOnNotify(int WXUNUSED(idCtrl), WXLPARAM lParam, WXLPARAM *result) { #ifndef __GNUWIN32__ #if defined(__BORLANDC__) || defined(__WATCOMC__) @@ -240,7 +240,7 @@ bool wxSpinButton::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) #endif } -bool wxSpinButton::MSWCommand(WXUINT cmd, WXWORD id) +bool wxSpinButton::MSWCommand(WXUINT WXUNUSED(cmd), WXWORD WXUNUSED(id)) { // No command messages return FALSE; diff --git a/src/msw/statbr95.cpp b/src/msw/statbr95.cpp index 4843ea05a6..121d042ee3 100644 --- a/src/msw/statbr95.cpp +++ b/src/msw/statbr95.cpp @@ -197,7 +197,7 @@ void wxStatusBar95::SetFieldsCount(int nFields, const int *widths) SetFieldsWidth(); } -void wxStatusBar95::SetStatusWidths(int n, const int widths[]) +void wxStatusBar95::SetStatusWidths(int WXUNUSED(n), const int widths[]) { wxASSERT_MSG( n == m_nFields, _T("field number mismatch") ); diff --git a/src/msw/tbar95.cpp b/src/msw/tbar95.cpp index b5fd2edad7..dfaccbbdc9 100644 --- a/src/msw/tbar95.cpp +++ b/src/msw/tbar95.cpp @@ -717,7 +717,7 @@ bool wxToolBar::Realize() // message handlers // ---------------------------------------------------------------------------- -bool wxToolBar::MSWCommand(WXUINT cmd, WXWORD id) +bool wxToolBar::MSWCommand(WXUINT WXUNUSED(cmd), WXWORD id) { wxToolBarToolBase *tool = FindById((int)id); if ( !tool ) @@ -747,7 +747,7 @@ bool wxToolBar::MSWCommand(WXUINT cmd, WXWORD id) bool wxToolBar::MSWOnNotify(int WXUNUSED(idCtrl), WXLPARAM lParam, - WXLPARAM *result) + WXLPARAM *WXUNUSED(result)) { // First check if this applies to us NMHDR *hdr = (NMHDR *)lParam; @@ -912,7 +912,7 @@ void wxToolBar::DoToggleTool(wxToolBarToolBase *tool, bool toggle) (WPARAM)tool->GetId(), (LPARAM)MAKELONG(toggle, 0)); } -void wxToolBar::DoSetToggle(wxToolBarToolBase *tool, bool toggle) +void wxToolBar::DoSetToggle(wxToolBarToolBase *WXUNUSED(tool), bool WXUNUSED(toggle)) { // VZ: AFAIK, the button has to be created either with TBSTYLE_CHECK or // without, so we really need to delete the button and recreate it here @@ -1155,3 +1155,4 @@ m_hBitmap = (WXHBITMAP) newBitmap; #endif // wxUSE_TOOLBAR && Win95 + diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 86ec3d7af8..49e3c4ed43 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -827,7 +827,7 @@ wxString wxTextCtrl::GetLineText(long lineNo) const wxString str; wxChar *buf = str.GetWriteBuf(len); - *(WORD *)buf = len; + *(WORD *)buf = (WORD)len; len = (size_t)::SendMessage(GetHwnd(), EM_GETLINE, lineNo, (LPARAM)buf); buf[len] = 0; @@ -967,10 +967,10 @@ bool wxTextCtrl::MSWCommand(WXUINT param, WXWORD WXUNUSED(id)) return TRUE; } -WXHBRUSH wxTextCtrl::OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor, - WXUINT message, - WXWPARAM wParam, - WXLPARAM lParam) +WXHBRUSH wxTextCtrl::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor), + WXUINT WXUNUSED(message), + WXWPARAM WXUNUSED(wParam), + WXLPARAM WXUNUSED(lParam)) { #if wxUSE_CTL3D if ( m_useCtl3D ) diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index 2489c62e3b..7f4fc40a5c 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -369,7 +369,7 @@ public: DoTraverse(root, recursively); } - virtual bool OnVisit(const wxTreeItemId& item) + virtual bool OnVisit(const wxTreeItemId& WXUNUSED(item)) { m_count++; @@ -650,7 +650,7 @@ wxTreeCtrl::~wxTreeCtrl() // delete user data to prevent memory leaks DeleteAllItems(); - + if (m_ownsImageListNormal) delete m_imageListNormal; if (m_ownsImageListState) delete m_imageListState; } @@ -1643,7 +1643,7 @@ wxTextCtrl* wxTreeCtrl::EditLabel(const wxTreeItemId& item, } // End label editing, optionally cancelling the edit -void wxTreeCtrl::EndEditLabel(const wxTreeItemId& item, bool discardChanges) +void wxTreeCtrl::EndEditLabel(const wxTreeItemId& WXUNUSED(item), bool discardChanges) { TreeView_EndEditLabelNow(GetHwnd(), discardChanges); @@ -2344,7 +2344,7 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) case TVN_GETDISPINFO: // NB: so far the user can't set the image himself anyhow, so do it // anyway - but this may change later - if ( /* !processed && */ 1 ) +// if ( /* !processed && */ 1 ) { wxTreeItemId item = event.m_item; TV_DISPINFO *info = (TV_DISPINFO *)lParam; @@ -2368,7 +2368,7 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) : wxTreeItemIcon_Selected ); } - } + } break; //default: diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index 47693a30a3..e32d27860f 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -423,7 +423,7 @@ const wxChar* wxGetHomeDir(wxString *pstr) return strDir.c_str(); } -wxChar *wxGetUserHome(const wxString& user) +wxChar *wxGetUserHome(const wxString& WXUNUSED(user)) { // VZ: the old code here never worked for user != "" anyhow! Moreover, it // returned sometimes a malloc()'d pointer, sometimes a pointer to a @@ -502,7 +502,7 @@ bool wxSetEnv(const wxString& var, const wxChar *value) // process management // ---------------------------------------------------------------------------- -int wxKill(long pid, int sig) +int wxKill(long WXUNUSED(pid), int WXUNUSED(sig)) { // TODO use SendMessage(WM_QUIT) and TerminateProcess() if needed @@ -1105,9 +1105,9 @@ wxString WXDLLEXPORT wxGetWindowClass(WXHWND hWnd) WXWORD WXDLLEXPORT wxGetWindowId(WXHWND hWnd) { #ifndef __WIN32__ - return GetWindowWord((HWND)hWnd, GWW_ID); + return (WXWORD)GetWindowWord((HWND)hWnd, GWW_ID); #else // Win32 - return GetWindowLong((HWND)hWnd, GWL_ID); + return (WXWORD)GetWindowLong((HWND)hWnd, GWL_ID); #endif // Win16/32 } diff --git a/src/msw/utilsexc.cpp b/src/msw/utilsexc.cpp index 26f8ca415f..7bfdc8234a 100644 --- a/src/msw/utilsexc.cpp +++ b/src/msw/utilsexc.cpp @@ -421,9 +421,9 @@ long wxExecute(const wxString& cmd, bool sync, wxProcess *handler) #if wxUSE_STREAMS // the first elements are reading ends, the second are the writing ones HANDLE hpipeStdin[2], - hpipeStdinWrite = INVALID_HANDLE_VALUE, hpipeStdout[2], hpipeStderr[2]; + HANDLE hpipeStdinWrite = INVALID_HANDLE_VALUE; // open the pipes to which child process IO will be redirected if needed if ( handler && handler->IsRedirected() ) diff --git a/src/msw/window.cpp b/src/msw/window.cpp index b40d7da5b2..3864f654d4 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -167,7 +167,7 @@ END_EVENT_TABLE() // Find an item given the MS Windows id wxWindow *wxWindow::FindItem(long id) const { - wxControl *item = wxDynamicCast(this, wxControl); + wxControl *item = wxDynamicThisCast(this, wxControl); if ( item ) { // i it we or one of our "internal" children? @@ -976,7 +976,7 @@ void wxWindow::SetupColours() SetBackgroundColour(GetParent()->GetBackgroundColour()); } -void wxWindow::OnIdle(wxIdleEvent& event) +void wxWindow::OnIdle(wxIdleEvent& WXUNUSED(event)) { // Check if we need to send a LEAVE event if ( m_mouseInWindow ) @@ -1002,7 +1002,7 @@ void wxWindow::OnIdle(wxIdleEvent& event) state |= MK_MBUTTON; if ( GetKeyState( VK_RBUTTON ) ) state |= MK_RBUTTON; - + wxMouseEvent event(wxEVT_LEAVE_WINDOW); InitMouseEvent(event, pt.x, pt.y, state); @@ -1014,7 +1014,7 @@ void wxWindow::OnIdle(wxIdleEvent& event) } // Set this window to be the child of 'parent'. -bool wxWindow::Reparent(wxWindow *parent) +bool wxWindow::Reparent(wxWindowBase *parent) { if ( !wxWindowBase::Reparent(parent) ) return FALSE; @@ -1580,7 +1580,7 @@ bool wxWindow::MSWProcessMessage(WXMSG* pMsg) } else { - wxPanel *panel = wxDynamicCast(this, wxPanel); + wxPanel *panel = wxDynamicThisCast(this, wxPanel); wxButton *btn = NULL; if ( panel ) { @@ -2228,7 +2228,7 @@ long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam) // Dialog window proc LONG APIENTRY _EXPORT -wxDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +wxDlgProc(HWND WXUNUSED(hWnd), UINT message, WPARAM WXUNUSED(wParam), LPARAM WXUNUSED(lParam)) { if ( message == WM_INITDIALOG ) { @@ -2333,7 +2333,7 @@ void wxWindow::MSWDetachWindowMenu() bool wxWindow::MSWCreate(int id, wxWindow *parent, const wxChar *wclass, - wxWindow *wx_win, + wxWindow *WXUNUSED(wx_win), const wxChar *title, int x, int y, @@ -2619,7 +2619,7 @@ bool wxWindow::HandleEndSession(bool endSession, long logOff) // window creation/destruction // --------------------------------------------------------------------------- -bool wxWindow::HandleCreate(WXLPCREATESTRUCT cs, bool *mayCreate) +bool wxWindow::HandleCreate(WXLPCREATESTRUCT WXUNUSED(cs), bool *mayCreate) { // TODO: should generate this event from WM_NCCREATE wxWindowCreateEvent event(this); @@ -2729,7 +2729,7 @@ bool wxWindow::HandleKillFocus(WXHWND WXUNUSED(hwnd)) // miscellaneous // --------------------------------------------------------------------------- -bool wxWindow::HandleShow(bool show, int status) +bool wxWindow::HandleShow(bool show, int WXUNUSED(status)) { wxShowEvent event(GetId(), show); event.m_eventObject = this; @@ -2780,7 +2780,7 @@ bool wxWindow::HandleDropFiles(WXWPARAM wParam) return rc; } -bool wxWindow::HandleSetCursor(WXHWND hWnd, +bool wxWindow::HandleSetCursor(WXHWND WXUNUSED(hWnd), short nHitTest, int WXUNUSED(mouseMsg)) { @@ -2969,12 +2969,12 @@ bool wxWindow::HandleCtlColor(WXHBRUSH *brush, } // Define for each class of dialog and control -WXHBRUSH wxWindow::OnCtlColor(WXHDC hDC, - WXHWND hWnd, - WXUINT nCtlColor, - WXUINT message, - WXWPARAM wParam, - WXLPARAM lParam) +WXHBRUSH wxWindow::OnCtlColor(WXHDC WXUNUSED(hDC), + WXHWND WXUNUSED(hWnd), + WXUINT WXUNUSED(nCtlColor), + WXUINT WXUNUSED(message), + WXWPARAM WXUNUSED(wParam), + WXLPARAM WXUNUSED(lParam)) { return (WXHBRUSH)0; } @@ -3250,7 +3250,7 @@ bool wxWindow::HandleCommand(WXWORD id, WXWORD cmd, WXHWND control) return FALSE; } -bool wxWindow::HandleSysCommand(WXWPARAM wParam, WXLPARAM lParam) +bool wxWindow::HandleSysCommand(WXWPARAM wParam, WXLPARAM WXUNUSED(lParam)) { // 4 bits are reserved switch ( wParam & 0xFFFFFFF0 ) @@ -3383,7 +3383,7 @@ wxKeyEvent wxWindow::CreateKeyEvent(wxEventType evType, // isASCII is TRUE only when we're called from WM_CHAR handler and not from // WM_KEYDOWN one -bool wxWindow::HandleChar(WXWORD wParam, WXLPARAM lParam, bool isASCII) +bool wxWindow::HandleChar(WXWPARAM wParam, WXLPARAM lParam, bool isASCII) { bool ctrlDown = FALSE; @@ -3436,7 +3436,7 @@ bool wxWindow::HandleChar(WXWORD wParam, WXLPARAM lParam, bool isASCII) return FALSE; } -bool wxWindow::HandleKeyDown(WXWORD wParam, WXLPARAM lParam) +bool wxWindow::HandleKeyDown(WXWPARAM wParam, WXLPARAM lParam) { int id = wxCharCodeMSWToWX(wParam); @@ -3458,7 +3458,7 @@ bool wxWindow::HandleKeyDown(WXWORD wParam, WXLPARAM lParam) return FALSE; } -bool wxWindow::HandleKeyUp(WXWORD wParam, WXLPARAM lParam) +bool wxWindow::HandleKeyUp(WXWPARAM wParam, WXLPARAM lParam) { int id = wxCharCodeMSWToWX(wParam); @@ -3916,9 +3916,9 @@ void wxSetKeyboardHook(bool doIt) else { UnhookWindowsHookEx(wxTheKeyboardHook); - // avoids mingw warning about statement with no effect (FreeProcInstance - // doesn't do anything under Win32) -#ifndef __GNUC__ + // avoids warning about statement with no effect (FreeProcInstance + // doesn't do anything under Win32) +#if !defined(WIN32) && !defined(_WIN32) && !defined(__WIN32__) && !defined(__NT__) && !defined(__GNUWIN32__) FreeProcInstance(wxTheKeyboardHookProc); #endif } @@ -4439,7 +4439,7 @@ static TEXTMETRIC wxGetTextMetrics(const wxWindow *win) // Find the wxWindow at the current mouse position, returning the mouse // position. -wxWindow* wxFindWindowAtPointer(wxPoint& pt) +wxWindow* wxFindWindowAtPointer(wxPoint& WXUNUSED(pt)) { return wxFindWindowAtPoint(wxGetMousePosition()); } diff --git a/src/msw/xpmhand.cpp b/src/msw/xpmhand.cpp index 7b0a898a59..25b2066249 100644 --- a/src/msw/xpmhand.cpp +++ b/src/msw/xpmhand.cpp @@ -88,8 +88,9 @@ IMPLEMENT_DYNAMIC_CLASS(wxXPMFileHandler, wxBitmapHandler) bool wxXPMFileHandler::LoadFile(wxBitmap *bitmap, const wxString& name, - long flags, - int desiredWidth, int desiredHeight) + long WXUNUSED(flags), + int WXUNUSED(desiredWidth), + int WXUNUSED(desiredHeight)) { #if wxUSE_XPM_IN_MSW XImage *ximage = NULL; @@ -131,8 +132,8 @@ bool wxXPMFileHandler::LoadFile(wxBitmap *bitmap, bool wxXPMFileHandler::SaveFile(wxBitmap *bitmap, const wxString& name, - int type, - const wxPalette *palette) + int WXUNUSED(type), + const wxPalette *WXUNUSED(palette)) { #if wxUSE_XPM_IN_MSW XImage ximage; @@ -184,10 +185,10 @@ IMPLEMENT_DYNAMIC_CLASS(wxXPMDataHandler, wxBitmapHandler) bool wxXPMDataHandler::Create(wxBitmap *bitmap, void *data, - long flags, - int width, - int height, - int depth) + long WXUNUSED(flags), + int WXUNUSED(width), + int WXUNUSED(height), + int WXUNUSED(depth)) { #if wxUSE_XPM_IN_MSW XImage *ximage = NULL; diff --git a/src/xpm/create.c b/src/xpm/create.c index 85537529f3..a667eb8f75 100644 --- a/src/xpm/create.c +++ b/src/xpm/create.c @@ -221,20 +221,15 @@ typedef struct { long closeness; } CloseColor; -#ifdef __OS2__ -/* Visual Age cannot deal with old, non-ansi, code */ +#ifndef FOR_MSW static int closeness_cmp(Const void* a, Const void* b) -#else -static int -closeness_cmp(a, b) - Const void *a, *b; -#endif { CloseColor *x = (CloseColor *) a, *y = (CloseColor *) b; /* cast to int as qsort requires */ return (int) (x->closeness - y->closeness); } +#endif /* default AllocColor function: diff --git a/src/xpm/data.c b/src/xpm/data.c index 9ad8648d6a..c79069bee9 100644 --- a/src/xpm/data.c +++ b/src/xpm/data.c @@ -33,12 +33,6 @@ \*****************************************************************************/ #ifndef CXPMPROG -/* Official version number */ -static char *RCS_Version = "$XpmVersion: 3.4k $"; - -/* Internal version number */ -static char *RCS_Id = "$Id$"; - #include "XpmI.h" #endif #include -- 2.45.2