From 637b7e4f3a0fd1c6bdfc21d28e37bcf760e3b364 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 21 Mar 2006 14:16:34 +0000 Subject: [PATCH] added semicolons after wxCHECK()s (part of patch 1450705) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38248 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 2 ++ src/cocoa/bitmap.mm | 4 ++-- src/common/datetime.cpp | 9 ++------- src/gtk/bitmap.cpp | 8 ++++---- src/gtk/dnd.cpp | 2 +- src/gtk1/bitmap.cpp | 6 +++--- src/gtk1/dnd.cpp | 2 +- src/gtk1/font.cpp | 2 +- src/mac/carbon/bitmap.cpp | 6 +++--- src/mac/carbon/cursor.cpp | 4 ++-- src/mac/classic/bitmap.cpp | 8 ++++---- src/mac/classic/cursor.cpp | 4 ++-- src/mgl/bitmap.cpp | 8 ++++---- src/msw/bitmap.cpp | 4 ++-- src/msw/spinbutt.cpp | 2 +- src/msw/treectrl.cpp | 4 ++-- src/os2/bitmap.cpp | 4 ++-- src/os2/spinbutt.cpp | 2 +- src/x11/bitmap.cpp | 8 ++++---- 19 files changed, 43 insertions(+), 46 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 1fe885015c..0c8b01160d 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -10,6 +10,8 @@ INCOMPATIBLE CHANGES SINCE 2.6.x even compile) - For all wxInputStreams, Eof() becomes true after an attempt has been made to read _past_ the end of file. +- wxCHECK family of macros now must be followed by a semicolon + Deprecated methods since 2.6.x and their replacements ----------------------------------------------------- diff --git a/src/cocoa/bitmap.mm b/src/cocoa/bitmap.mm index 2e18c0ae2b..dd08e3387a 100644 --- a/src/cocoa/bitmap.mm +++ b/src/cocoa/bitmap.mm @@ -415,11 +415,11 @@ bool wxBitmap::CreateFromXpm(const char **xpm) #if wxUSE_IMAGE && wxUSE_XPM UnRef(); - wxCHECK_MSG( xpm, false, wxT("invalid XPM data") ) + wxCHECK_MSG( xpm, false, wxT("invalid XPM data") ); wxXPMDecoder decoder; wxImage img = decoder.ReadData(xpm); - wxCHECK_MSG( img.Ok(), false, wxT("invalid XPM data") ) + wxCHECK_MSG( img.Ok(), false, wxT("invalid XPM data") ); *this = wxBitmap(img); return true; diff --git a/src/common/datetime.cpp b/src/common/datetime.cpp index 917e40d3a0..ef51bf684b 100644 --- a/src/common/datetime.cpp +++ b/src/common/datetime.cpp @@ -204,13 +204,8 @@ struct tm *wxGmtime_r(const time_t* ticks, struct tm* temp) // ---------------------------------------------------------------------------- // debugging helper: just a convenient replacement of wxCHECK() -#define wxDATETIME_CHECK(expr, msg) \ - if ( !(expr) ) \ - { \ - wxFAIL_MSG(msg); \ - *this = wxInvalidDateTime; \ - return *this; \ - } +#define wxDATETIME_CHECK(expr, msg) \ + wxCHECK2_MSG(expr, *this = wxInvalidDateTime; return *this, msg) // ---------------------------------------------------------------------------- // private classes diff --git a/src/gtk/bitmap.cpp b/src/gtk/bitmap.cpp index cb358da34a..48300626d3 100644 --- a/src/gtk/bitmap.cpp +++ b/src/gtk/bitmap.cpp @@ -298,7 +298,7 @@ bool wxBitmap::Create( int width, int height, int depth ) depth = visual->depth; wxCHECK_MSG( (depth == visual->depth) || (depth == 1) || (depth == 32), false, - wxT("invalid bitmap depth") ) + wxT("invalid bitmap depth") ); m_refData = new wxBitmapRefData(); M_BMPDATA->m_mask = (wxMask *) NULL; @@ -328,7 +328,7 @@ bool wxBitmap::CreateFromXpm( const char **bits ) { UnRef(); - wxCHECK_MSG( bits != NULL, false, wxT("invalid bitmap data") ) + wxCHECK_MSG( bits != NULL, false, wxT("invalid bitmap data") ); GdkVisual *visual = wxTheApp->GetGdkVisual(); @@ -557,8 +557,8 @@ bool wxBitmap::CreateFromImage(const wxImage& image, int depth) { UnRef(); - wxCHECK_MSG( image.Ok(), false, wxT("invalid image") ) - wxCHECK_MSG( depth == -1 || depth == 1, false, wxT("invalid bitmap depth") ) + wxCHECK_MSG( image.Ok(), false, wxT("invalid image") ); + wxCHECK_MSG( depth == -1 || depth == 1, false, wxT("invalid bitmap depth") ); if (image.GetWidth() <= 0 || image.GetHeight() <= 0) return false; diff --git a/src/gtk/dnd.cpp b/src/gtk/dnd.cpp index 884ad11f27..794505a248 100644 --- a/src/gtk/dnd.cpp +++ b/src/gtk/dnd.cpp @@ -345,7 +345,7 @@ static gboolean target_drag_drop( GtkWidget *widget, GdkAtom format = drop_target->GetMatchingPair(); // this does happen somehow, see bug 555111 - wxCHECK_MSG( format, FALSE, _T("no matching GdkAtom for format?") ) + wxCHECK_MSG( format, FALSE, _T("no matching GdkAtom for format?") ); /* GdkDragAction action = GDK_ACTION_MOVE; diff --git a/src/gtk1/bitmap.cpp b/src/gtk1/bitmap.cpp index 8237eaa338..f2b41e9444 100644 --- a/src/gtk1/bitmap.cpp +++ b/src/gtk1/bitmap.cpp @@ -315,7 +315,7 @@ bool wxBitmap::CreateFromXpm( const char **bits ) { UnRef(); - wxCHECK_MSG( bits != NULL, false, wxT("invalid bitmap data") ) + wxCHECK_MSG( bits != NULL, false, wxT("invalid bitmap data") ); GdkVisual *visual = wxTheApp->GetGdkVisual(); @@ -527,8 +527,8 @@ bool wxBitmap::CreateFromImage(const wxImage& image, int depth) { UnRef(); - wxCHECK_MSG( image.Ok(), false, wxT("invalid image") ) - wxCHECK_MSG( depth == -1 || depth == 1, false, wxT("invalid bitmap depth") ) + wxCHECK_MSG( image.Ok(), false, wxT("invalid image") ); + wxCHECK_MSG( depth == -1 || depth == 1, false, wxT("invalid bitmap depth") ); if (image.GetWidth() <= 0 || image.GetHeight() <= 0) return false; diff --git a/src/gtk1/dnd.cpp b/src/gtk1/dnd.cpp index 3c4ce2dc54..46a175b093 100644 --- a/src/gtk1/dnd.cpp +++ b/src/gtk1/dnd.cpp @@ -359,7 +359,7 @@ static gboolean target_drag_drop( GtkWidget *widget, GdkAtom format = drop_target->GetMatchingPair(); // this does happen somehow, see bug 555111 - wxCHECK_MSG( format, FALSE, _T("no matching GdkAtom for format?") ) + wxCHECK_MSG( format, FALSE, _T("no matching GdkAtom for format?") ); /* GdkDragAction action = GDK_ACTION_MOVE; diff --git a/src/gtk1/font.cpp b/src/gtk1/font.cpp index 4d3e493fdd..def79ff7fa 100644 --- a/src/gtk1/font.cpp +++ b/src/gtk1/font.cpp @@ -757,7 +757,7 @@ GdkFont *wxFont::GetInternalFont( float scale ) const { GdkFont *font = (GdkFont *) NULL; - wxCHECK_MSG( Ok(), font, wxT("invalid font") ) + wxCHECK_MSG( Ok(), font, wxT("invalid font") ); long int_scale = long(scale * 100.0 + 0.5); // key for fontlist int point_scale = (int)((M_FONTDATA->m_pointSize * 10 * int_scale) / 100); diff --git a/src/mac/carbon/bitmap.cpp b/src/mac/carbon/bitmap.cpp index 05cc1a72e7..89f0d0e127 100644 --- a/src/mac/carbon/bitmap.cpp +++ b/src/mac/carbon/bitmap.cpp @@ -876,11 +876,11 @@ void wxBitmap::EndRawAccess() bool wxBitmap::CreateFromXpm(const char **bits) { #if wxUSE_IMAGE - wxCHECK_MSG( bits != NULL, false, wxT("invalid bitmap data") ) + wxCHECK_MSG( bits != NULL, false, wxT("invalid bitmap data") ); wxXPMDecoder decoder; wxImage img = decoder.ReadData(bits); - wxCHECK_MSG( img.Ok(), false, wxT("invalid bitmap data") ) + wxCHECK_MSG( img.Ok(), false, wxT("invalid bitmap data") ); *this = wxBitmap(img); @@ -1027,7 +1027,7 @@ bool wxBitmap::Create(void *data, wxBitmapType type, int width, int height, int wxBitmap::wxBitmap(const wxImage& image, int depth) { - wxCHECK_RET( image.Ok(), wxT("invalid image") ) + wxCHECK_RET( image.Ok(), wxT("invalid image") ); // width and height of the device-dependent bitmap int width = image.GetWidth(); diff --git a/src/mac/carbon/cursor.cpp b/src/mac/carbon/cursor.cpp index ef3b9216e3..caa824901d 100644 --- a/src/mac/carbon/cursor.cpp +++ b/src/mac/carbon/cursor.cpp @@ -262,10 +262,10 @@ wxCursor::wxCursor(char **bits) bool wxCursor::CreateFromXpm(const char **bits) { #if wxUSE_IMAGE - wxCHECK_MSG( bits != NULL, false, wxT("invalid cursor data") ) + wxCHECK_MSG( bits != NULL, false, wxT("invalid cursor data") ); wxXPMDecoder decoder; wxImage img = decoder.ReadData(bits); - wxCHECK_MSG( img.Ok(), false, wxT("invalid cursor data") ) + wxCHECK_MSG( img.Ok(), false, wxT("invalid cursor data") ); CreateFromImage( img ) ; return true; #else diff --git a/src/mac/classic/bitmap.cpp b/src/mac/classic/bitmap.cpp index 65ea36c831..e51b3ca7b6 100644 --- a/src/mac/classic/bitmap.cpp +++ b/src/mac/classic/bitmap.cpp @@ -508,10 +508,10 @@ wxBitmap::wxBitmap(const wxString& filename, wxBitmapType type) bool wxBitmap::CreateFromXpm(const char **bits) { - wxCHECK_MSG( bits != NULL, FALSE, wxT("invalid bitmap data") ) + wxCHECK_MSG( bits != NULL, FALSE, wxT("invalid bitmap data") ); wxXPMDecoder decoder; wxImage img = decoder.ReadData(bits); - wxCHECK_MSG( img.Ok(), FALSE, wxT("invalid bitmap data") ) + wxCHECK_MSG( img.Ok(), FALSE, wxT("invalid bitmap data") ); *this = wxBitmap(img); return TRUE; } @@ -718,8 +718,8 @@ bool wxBitmap::Create(void *data, wxBitmapType type, int width, int height, int wxBitmap::wxBitmap(const wxImage& image, int depth) { - wxCHECK_RET( image.Ok(), wxT("invalid image") ) - wxCHECK_RET( depth == -1, wxT("invalid bitmap depth") ) + wxCHECK_RET( image.Ok(), wxT("invalid image") ); + wxCHECK_RET( depth == -1, wxT("invalid bitmap depth") ); m_refData = new wxBitmapRefData(); diff --git a/src/mac/classic/cursor.cpp b/src/mac/classic/cursor.cpp index 71682cf5da..3f7e44d3b7 100644 --- a/src/mac/classic/cursor.cpp +++ b/src/mac/classic/cursor.cpp @@ -94,10 +94,10 @@ wxCursor::wxCursor(char **bits) bool wxCursor::CreateFromXpm(const char **bits) { - wxCHECK_MSG( bits != NULL, FALSE, wxT("invalid cursor data") ) + wxCHECK_MSG( bits != NULL, FALSE, wxT("invalid cursor data") ); wxXPMDecoder decoder; wxImage img = decoder.ReadData(bits); - wxCHECK_MSG( img.Ok(), FALSE, wxT("invalid cursor data") ) + wxCHECK_MSG( img.Ok(), FALSE, wxT("invalid cursor data") ); CreateFromImage( img ) ; return TRUE; } diff --git a/src/mgl/bitmap.cpp b/src/mgl/bitmap.cpp index 3fdab5fe9c..8c5bcd2a80 100644 --- a/src/mgl/bitmap.cpp +++ b/src/mgl/bitmap.cpp @@ -205,7 +205,7 @@ bool wxBitmap::Create(int width, int height, int depth) { UnRef(); - wxCHECK_MSG( (width > 0) && (height > 0), false, wxT("invalid bitmap size") ) + wxCHECK_MSG( (width > 0) && (height > 0), false, wxT("invalid bitmap size") ); pixel_format_t pf_dummy; pixel_format_t *pf; @@ -267,11 +267,11 @@ bool wxBitmap::Create(int width, int height, int depth) bool wxBitmap::CreateFromXpm(const char **bits) { - wxCHECK_MSG( bits != NULL, false, wxT("invalid bitmap data") ) + wxCHECK_MSG( bits != NULL, false, wxT("invalid bitmap data") ); wxXPMDecoder decoder; wxImage img = decoder.ReadData(bits); - wxCHECK_MSG( img.Ok(), false, wxT("invalid bitmap data") ) + wxCHECK_MSG( img.Ok(), false, wxT("invalid bitmap data") ); *this = wxBitmap(img); @@ -282,7 +282,7 @@ wxBitmap::wxBitmap(const wxImage& image, int depth) { long width, height; - wxCHECK_RET( image.Ok(), wxT("invalid image") ) + wxCHECK_RET( image.Ok(), wxT("invalid image") ); width = image.GetWidth(); height = image.GetHeight(); diff --git a/src/msw/bitmap.cpp b/src/msw/bitmap.cpp index 7646220beb..d1e489c883 100644 --- a/src/msw/bitmap.cpp +++ b/src/msw/bitmap.cpp @@ -476,11 +476,11 @@ wxBitmap::wxBitmap(const char bits[], int width, int height, int depth) bool wxBitmap::CreateFromXpm(const char **data) { #if wxUSE_IMAGE && wxUSE_XPM && wxUSE_WXDIB - wxCHECK_MSG( data != NULL, false, wxT("invalid bitmap data") ) + wxCHECK_MSG( data != NULL, false, wxT("invalid bitmap data") ); wxXPMDecoder decoder; wxImage img = decoder.ReadData(data); - wxCHECK_MSG( img.Ok(), false, wxT("invalid bitmap data") ) + wxCHECK_MSG( img.Ok(), false, wxT("invalid bitmap data") ); *this = wxBitmap(img); return true; diff --git a/src/msw/spinbutt.cpp b/src/msw/spinbutt.cpp index a41c23f59c..69e20420fd 100644 --- a/src/msw/spinbutt.cpp +++ b/src/msw/spinbutt.cpp @@ -277,7 +277,7 @@ void wxSpinButton::SetRange(int minVal, int maxVal) bool wxSpinButton::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam, WXWORD pos, WXHWND control) { - wxCHECK_MSG( control, false, wxT("scrolling what?") ) + wxCHECK_MSG( control, false, wxT("scrolling what?") ); if ( wParam != SB_THUMBPOSITION ) { diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index 1a0cf91a88..82816207fd 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -1808,7 +1808,7 @@ void wxTreeCtrl::DoExpand(const wxTreeItemId& item, int flag) // A hidden root can be neither expanded nor collapsed. wxCHECK_RET( !(m_windowStyle & wxTR_HIDE_ROOT) || (HITEM(item) != TVI_ROOT), - wxT("Can't expand/collapse hidden root node!") ) + wxT("Can't expand/collapse hidden root node!") ); // TreeView_Expand doesn't send TVN_ITEMEXPAND(ING) messages, so we must // emulate them. This behaviour has changed slightly with comctl32.dll @@ -2743,7 +2743,7 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) WXWPARAM wParam = info->wVKey; - int keyCode = wxCharCodeMSWToWX(info->wVKey); + int keyCode = wxCharCodeMSWToWX(wParam); if ( !keyCode ) { // wxCharCodeMSWToWX() returns 0 to indicate that this is a diff --git a/src/os2/bitmap.cpp b/src/os2/bitmap.cpp index 9139803c49..59451cffd2 100644 --- a/src/os2/bitmap.cpp +++ b/src/os2/bitmap.cpp @@ -389,12 +389,12 @@ bool wxBitmap::CreateFromXpm( #if wxUSE_IMAGE && wxUSE_XPM Init(); - wxCHECK_MSG(ppData != NULL, false, wxT("invalid bitmap data")) + wxCHECK_MSG(ppData != NULL, false, wxT("invalid bitmap data")); wxXPMDecoder vDecoder; wxImage vImg = vDecoder.ReadData(ppData); - wxCHECK_MSG(vImg.Ok(), false, wxT("invalid bitmap data")) + wxCHECK_MSG(vImg.Ok(), false, wxT("invalid bitmap data")); *this = wxBitmap(vImg); return true; diff --git a/src/os2/spinbutt.cpp b/src/os2/spinbutt.cpp index 11315a6e1d..0c25a24f01 100644 --- a/src/os2/spinbutt.cpp +++ b/src/os2/spinbutt.cpp @@ -192,7 +192,7 @@ bool wxSpinButton::OS2OnScroll( int WXUNUSED(nOrientation), WXWORD wPos, WXHWND hControl ) { - wxCHECK_MSG(hControl, false, wxT("scrolling what?") ) + wxCHECK_MSG(hControl, false, wxT("scrolling what?") ); wxSpinEvent vEvent( wxEVT_SCROLL_THUMBTRACK, m_windowId ); int nVal = (int)wPos; // cast is important for negative values! diff --git a/src/x11/bitmap.cpp b/src/x11/bitmap.cpp index ec2c314c4e..bf22d84b9d 100644 --- a/src/x11/bitmap.cpp +++ b/src/x11/bitmap.cpp @@ -312,7 +312,7 @@ bool wxBitmap::Create( int width, int height, int depth ) { UnRef(); - wxCHECK_MSG( (width > 0) && (height > 0), false, wxT("invalid bitmap size") ) + wxCHECK_MSG( (width > 0) && (height > 0), false, wxT("invalid bitmap size") ); m_refData = new wxBitmapRefData(); @@ -534,8 +534,8 @@ bool wxBitmap::CreateFromImage( const wxImage& image, int depth ) UnRef(); - wxCHECK_MSG( image.Ok(), false, wxT("invalid image") ) - wxCHECK_MSG( depth == -1, false, wxT("invalid bitmap depth") ) + wxCHECK_MSG( image.Ok(), false, wxT("invalid image") ); + wxCHECK_MSG( depth == -1, false, wxT("invalid bitmap depth") ); m_refData = new wxBitmapRefData(); @@ -1445,7 +1445,7 @@ bool wxXPMDataHandler::Create(wxBitmap *bitmap, void *bits, int WXUNUSED(width), int WXUNUSED(height), int WXUNUSED(depth)) { #if wxHAVE_LIB_XPM - wxCHECK_MSG( bits != NULL, false, wxT("invalid bitmap data") ) + wxCHECK_MSG( bits != NULL, false, wxT("invalid bitmap data") ); if (!bitmap->GetRefData()) bitmap->SetRefData( new wxBitmapRefData() ); -- 2.45.2