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
This commit is contained in:
Kendall Bennett
2001-05-02 19:48:15 +00:00
parent b1d1dc510d
commit 33ac7e6f01
93 changed files with 739 additions and 720 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -55,7 +55,7 @@ public:
}
bool Create(wxWindow *parent, wxWindowID id,
long style = 0,
long style,
const wxString& name = wxPanelNameStr);
// Create status line

View File

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

View File

@@ -1,7 +1,7 @@
/* -------------------------------------------------------------------------
* Project: GSocket (Generic Socket)
* Name: gsocket.h
* Author: Guilhem Lavaux
* Author: Guilhem Lavaux
* Guillermo Rodriguez Garcia <guille@iies.es> (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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -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());
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -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');
}

View File

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

View File

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

View File

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

View File

@@ -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');
}

View File

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

View File

@@ -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."));

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -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();
}

View File

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

View File

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

View File

@@ -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<br>(and <u>underlined</u>. <i>Italic face.</i> \
));
}
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();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -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"));
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -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();
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -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 <zeitlin@dptmaths.ens-cachan.fr>
@@ -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);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -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());
}

View File

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

View File

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

View File

@@ -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 <ctype.h>