From 43b2d5e7c3b3e3d6b245e279dde73d96e0075911 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 20 Jul 2009 16:47:54 +0000 Subject: [PATCH] Put braces around all calls to wxLogFunctions() inside an if statement. This suppresses all the remaining g++ -Wparentheses warnings and uses consistent style everywhere. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61475 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/msw/private.h | 14 +++++ samples/animate/anitest.cpp | 2 + samples/combo/combo.cpp | 4 ++ samples/controls/controls.cpp | 14 ++++- samples/dataview/dataview.cpp | 10 ++-- samples/dialup/nettest.cpp | 4 ++ samples/exec/exec.cpp | 6 +++ samples/htlbox/htlbox.cpp | 2 + samples/image/canvas.cpp | 78 +++++++++++++++++++++++++++ samples/internat/internat.cpp | 6 +++ samples/ipc/baseclient.cpp | 2 + samples/ipc/baseserver.cpp | 2 + samples/ipc/client.cpp | 2 + samples/listctrl/listtest.cpp | 2 + samples/printing/printing.cpp | 4 ++ samples/propgrid/propgrid_minimal.cpp | 4 ++ samples/sockets/baseclient.cpp | 2 + samples/sockets/client.cpp | 2 + samples/sockets/server.cpp | 8 +++ samples/taborder/taborder.cpp | 4 ++ samples/text/text.cpp | 16 ++++++ samples/treectrl/treetest.cpp | 12 +++++ samples/widgets/bmpcombobox.cpp | 4 ++ samples/widgets/combobox.cpp | 4 ++ samples/widgets/listbox.cpp | 4 ++ samples/widgets/odcombobox.cpp | 4 ++ samples/widgets/static.cpp | 4 ++ samples/widgets/widgets.cpp | 16 ++++++ samples/xrc/myframe.cpp | 8 +++ src/common/config.cpp | 4 ++ src/common/file.cpp | 13 +++-- src/common/filename.cpp | 4 ++ src/common/imagbmp.cpp | 2 + src/common/zipstrm.cpp | 6 +++ src/gtk1/threadno.cpp | 2 + src/gtk1/threadsgi.cpp | 2 + src/html/helpwnd.cpp | 4 ++ src/mgl/window.cpp | 2 + src/msdos/utilsdos.cpp | 6 +++ src/msw/clipbrd.cpp | 2 + src/msw/colordlg.cpp | 2 + src/msw/dc.cpp | 4 ++ src/msw/dcprint.cpp | 2 + src/msw/dialup.cpp | 4 ++ src/msw/enhmeta.cpp | 2 + src/msw/glcanvas.cpp | 2 + src/msw/iniconf.cpp | 6 +++ src/msw/listbox.cpp | 2 + src/msw/mdi.cpp | 2 + src/msw/menu.cpp | 8 +++ src/msw/spinctrl.cpp | 2 + src/msw/statusbar.cpp | 22 +++++--- src/msw/toolbar.cpp | 4 ++ src/msw/utilsexc.cpp | 2 + src/msw/volume.cpp | 2 + src/msw/window.cpp | 8 +++ src/os2/clipbrd.cpp | 2 + src/os2/iniconf.cpp | 6 +++ src/os2/menu.cpp | 2 + src/os2/thread.cpp | 2 + src/os2/tooltip.cpp | 2 + src/os2/window.cpp | 2 + src/osx/carbon/mdi.cpp | 4 ++ src/osx/carbon/mimetmac.cpp | 6 +++ src/osx/carbon/sound.cpp | 2 + src/osx/core/hid.cpp | 4 ++ src/propgrid/property.cpp | 4 ++ src/propgrid/propgrid.cpp | 4 ++ src/richtext/richtextxml.cpp | 4 ++ src/univ/menu.cpp | 2 + src/x11/app.cpp | 2 + src/x11/window.cpp | 2 + tests/archive/archivetest.cpp | 2 + tests/streams/largefile.cpp | 12 +++-- tests/streams/zlibstream.cpp | 6 +++ utils/execmon/execmon.cpp | 2 + utils/helpview/src/remhelp.cpp | 46 ++++++++++------ utils/ifacecheck/src/ifacecheck.cpp | 12 +++++ utils/ifacecheck/src/xmlparser.cpp | 20 +++++++ 79 files changed, 476 insertions(+), 39 deletions(-) diff --git a/include/wx/msw/private.h b/include/wx/msw/private.h index f33d38372f..b3efe36030 100644 --- a/include/wx/msw/private.h +++ b/include/wx/msw/private.h @@ -368,7 +368,9 @@ inline RECT wxGetWindowRect(HWND hwnd) RECT rect; if ( !::GetWindowRect(hwnd, &rect) ) + { wxLogLastError(_T("GetWindowRect")); + } return rect; } @@ -378,7 +380,9 @@ inline RECT wxGetClientRect(HWND hwnd) RECT rect; if ( !::GetClientRect(hwnd, &rect) ) + { wxLogLastError(_T("GetClientRect")); + } return rect; } @@ -570,7 +574,9 @@ public: : m_hdc(hdc) { if ( !::SelectClipRgn(hdc, hrgn) ) + { wxLogLastError(_T("SelectClipRgn")); + } } ~HDCClipper() @@ -599,7 +605,9 @@ private: { m_modeOld = ::SetMapMode(hdc, mm); if ( !m_modeOld ) + { wxLogLastError(_T("SelectClipRgn")); + } } ~HDCMapModeChanger() @@ -634,7 +642,9 @@ public: { m_hGlobal = ::GlobalAlloc(flags, size); if ( !m_hGlobal ) + { wxLogLastError(_T("GlobalAlloc")); + } } GlobalPtr(size_t size, unsigned flags = GMEM_MOVEABLE) @@ -645,7 +655,9 @@ public: ~GlobalPtr() { if ( m_hGlobal && ::GlobalFree(m_hGlobal) ) + { wxLogLastError(_T("GlobalFree")); + } } // implicit conversion @@ -681,7 +693,9 @@ public: // global scope operator with it (and neither with GlobalUnlock()) m_ptr = GlobalLock(hGlobal); if ( !m_ptr ) + { wxLogLastError(_T("GlobalLock")); + } } // initialize the object, HGLOBAL must not be NULL diff --git a/samples/animate/anitest.cpp b/samples/animate/anitest.cpp index f775d03f67..52748aa693 100644 --- a/samples/animate/anitest.cpp +++ b/samples/animate/anitest.cpp @@ -182,7 +182,9 @@ MyFrame::~MyFrame() void MyFrame::OnPlay(wxCommandEvent& WXUNUSED(event)) { if (!m_animationCtrl->Play()) + { wxLogError(wxT("Invalid animation")); + } } void MyFrame::OnStop(wxCommandEvent& WXUNUSED(event)) diff --git a/samples/combo/combo.cpp b/samples/combo/combo.cpp index fd5abd249d..62ed8af72e 100644 --- a/samples/combo/combo.cpp +++ b/samples/combo/combo.cpp @@ -1042,9 +1042,13 @@ void MyFrame::OnComboBoxUpdate( wxCommandEvent& event ) return; if ( event.GetEventType() == wxEVT_COMMAND_COMBOBOX_SELECTED ) + { wxLogDebug(wxT("EVT_COMBOBOX(id=%i,selection=%i)"),event.GetId(),event.GetSelection()); + } else if ( event.GetEventType() == wxEVT_COMMAND_TEXT_UPDATED ) + { wxLogDebug(wxT("EVT_TEXT(id=%i,string=\"%s\")"),event.GetId(),event.GetString().c_str()); + } } void MyFrame::OnShowComparison( wxCommandEvent& WXUNUSED(event) ) diff --git a/samples/controls/controls.cpp b/samples/controls/controls.cpp index 565e6cca8d..1a2f51ba43 100644 --- a/samples/controls/controls.cpp +++ b/samples/controls/controls.cpp @@ -1426,7 +1426,7 @@ void MyPanel::OnCombo( wxCommandEvent &event ) { if (!m_combo) return; - + wxLogMessage(_T("EVT_COMBOBOX: item %d/%d (event/control), string \"%s\"/\"%s\""), (int)event.GetInt(), m_combo->GetSelection(), @@ -1437,16 +1437,20 @@ void MyPanel::OnCombo( wxCommandEvent &event ) void MyPanel::OnComboTextChanged(wxCommandEvent& event) { if (m_combo) + { wxLogMessage(wxT("EVT_TEXT for the combobox: \"%s\" (event) or \"%s\" (control)."), event.GetString().c_str(), m_combo->GetValue().c_str()); + } } void MyPanel::OnComboTextEnter(wxCommandEvent& WXUNUSED(event)) { if (m_combo) + { wxLogMessage(_T("Enter pressed in the combobox: value is '%s'."), m_combo->GetValue().c_str()); + } } void MyPanel::OnComboButtons( wxCommandEvent &event ) @@ -2033,9 +2037,13 @@ void MyComboBox::OnChar(wxKeyEvent& event) wxLogMessage(_T("MyComboBox::OnChar")); if ( event.GetKeyCode() == 'w' ) + { wxLogMessage(_T("MyComboBox: 'w' will be ignored.")); + } else + { event.Skip(); + } } void MyComboBox::OnKeyDown(wxKeyEvent& event) @@ -2043,9 +2051,13 @@ void MyComboBox::OnKeyDown(wxKeyEvent& event) wxLogMessage(_T("MyComboBox::OnKeyDown")); if ( event.GetKeyCode() == 'w' ) + { wxLogMessage(_T("MyComboBox: 'w' will be ignored.")); + } else + { event.Skip(); + } } void MyComboBox::OnKeyUp(wxKeyEvent& event) diff --git a/samples/dataview/dataview.cpp b/samples/dataview/dataview.cpp index 77d5875e55..9b80b93b69 100644 --- a/samples/dataview/dataview.cpp +++ b/samples/dataview/dataview.cpp @@ -435,7 +435,7 @@ MyFrame::MyFrame(wxFrame *frame, const wxString &title, int x, int y, int w, int mainSizer->Add( m_notebook, 1, wxGROW ); mainSizer->Add( m_log, 0, wxGROW ); - + SetSizerAndFit(mainSizer); } @@ -819,7 +819,9 @@ void MyFrame::OnActivated( wxDataViewEvent &event ) wxLogMessage( "wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED, Item: %s", title ); if (m_ctrl[0]->IsExpanded( event.GetItem() )) + { wxLogMessage( "Item: %s is expanded", title ); + } } void MyFrame::OnSelectionChanged( wxDataViewEvent &event ) @@ -850,15 +852,15 @@ void MyFrame::OnStartEditing( wxDataViewEvent &event ) if (artist == "Ludwig van Beethoven") { event.Veto(); - + if (!m_log) return; - + wxLogMessage( "wxEVT_COMMAND_DATAVIEW_ITEM_START_EDITING vetoed. Artist: %s", artist ); } else wxLogMessage( "wxEVT_COMMAND_DATAVIEW_ITEM_START_EDITING not vetoed. Artist: %s", artist ); - + } void MyFrame::OnEditingStarted( wxDataViewEvent &event ) diff --git a/samples/dialup/nettest.cpp b/samples/dialup/nettest.cpp index 1221ea4705..1b57f27557 100644 --- a/samples/dialup/nettest.cpp +++ b/samples/dialup/nettest.cpp @@ -305,9 +305,13 @@ void MyFrame::OnDial(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnCheck(wxCommandEvent& WXUNUSED(event)) { if(wxGetApp().GetDialer()->IsOnline()) + { wxLogMessage(wxT("Network is online.")); + } else + { wxLogMessage(wxT("Network is offline.")); + } } void MyFrame::OnEnumISPs(wxCommandEvent& WXUNUSED(event)) diff --git a/samples/exec/exec.cpp b/samples/exec/exec.cpp index a1e6531af8..a979d505ab 100644 --- a/samples/exec/exec.cpp +++ b/samples/exec/exec.cpp @@ -627,9 +627,13 @@ void MyFrame::OnKill(wxCommandEvent& WXUNUSED(event)) if ( sig == 0 ) { if ( wxProcess::Exists(pid) ) + { wxLogStatus(_T("Process %ld is running."), pid); + } else + { wxLogStatus(_T("No process with pid = %ld."), pid); + } } else // not SIGNONE { @@ -965,7 +969,9 @@ void MyFrame::OnOpenURL(wxCommandEvent& WXUNUSED(event)) s_url = filename; if ( !wxLaunchDefaultBrowser(s_url) ) + { wxLogError(_T("Failed to open URL \"%s\""), s_url.c_str()); + } } // ---------------------------------------------------------------------------- diff --git a/samples/htlbox/htlbox.cpp b/samples/htlbox/htlbox.cpp index 41817204c7..a24887bb79 100644 --- a/samples/htlbox/htlbox.cpp +++ b/samples/htlbox/htlbox.cpp @@ -541,7 +541,9 @@ void MyFrame::OnLboxSelect(wxCommandEvent& event) } if ( !s.empty() ) + { wxLogMessage(_T("Selected items: %s"), s.c_str()); + } } #if wxUSE_STATUSBAR diff --git a/samples/image/canvas.cpp b/samples/image/canvas.cpp index 91ef136a02..69168b346c 100644 --- a/samples/image/canvas.cpp +++ b/samples/image/canvas.cpp @@ -82,7 +82,9 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id, #if wxUSE_LIBPNG if ( !image.SaveFile( dir + _T("test.png"), wxBITMAP_TYPE_PNG )) + { wxLogError(wxT("Can't save file")); + } image.Destroy(); @@ -92,14 +94,22 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id, image.Destroy(); if ( !image.LoadFile( dir + _T("horse.png")) ) + { wxLogError(wxT("Can't load PNG image")); + } else + { my_horse_png = wxBitmap( image ); + } if ( !image.LoadFile( dir + _T("toucan.png")) ) + { wxLogError(wxT("Can't load PNG image")); + } else + { my_toucan = wxBitmap(image); + } my_toucan_flipped_horiz = wxBitmap(image.Mirror(true)); my_toucan_flipped_vert = wxBitmap(image.Mirror(false)); @@ -116,7 +126,9 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id, image.Destroy(); if ( !image.LoadFile( dir + _T("horse.jpg")) ) + { wxLogError(wxT("Can't load JPG image")); + } else { my_horse_jpeg = wxBitmap( image ); @@ -129,87 +141,129 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id, } if ( !image.LoadFile( dir + _T("cmyk.jpg")) ) + { wxLogError(_T("Can't load CMYK JPG image")); + } else + { my_cmyk_jpeg = wxBitmap(image); + } #endif // wxUSE_LIBJPEG #if wxUSE_GIF image.Destroy(); if ( !image.LoadFile( dir + _T("horse.gif" )) ) + { wxLogError(wxT("Can't load GIF image")); + } else + { my_horse_gif = wxBitmap( image ); + } #endif #if wxUSE_PCX image.Destroy(); if ( !image.LoadFile( dir + _T("horse.pcx"), wxBITMAP_TYPE_PCX ) ) + { wxLogError(wxT("Can't load PCX image")); + } else + { my_horse_pcx = wxBitmap( image ); + } #endif image.Destroy(); if ( !image.LoadFile( dir + _T("horse.bmp"), wxBITMAP_TYPE_BMP ) ) + { wxLogError(wxT("Can't load BMP image")); + } else + { my_horse_bmp = wxBitmap( image ); + } #if wxUSE_XPM image.Destroy(); if ( !image.LoadFile( dir + _T("horse.xpm"), wxBITMAP_TYPE_XPM ) ) + { wxLogError(wxT("Can't load XPM image")); + } else + { my_horse_xpm = wxBitmap( image ); + } if ( !image.SaveFile( dir + _T("test.xpm"), wxBITMAP_TYPE_XPM )) + { wxLogError(wxT("Can't save file")); + } #endif #if wxUSE_PNM image.Destroy(); if ( !image.LoadFile( dir + _T("horse.pnm"), wxBITMAP_TYPE_PNM ) ) + { wxLogError(wxT("Can't load PNM image")); + } else + { my_horse_pnm = wxBitmap( image ); + } image.Destroy(); if ( !image.LoadFile( dir + _T("horse_ag.pnm"), wxBITMAP_TYPE_PNM ) ) + { wxLogError(wxT("Can't load PNM image")); + } else + { my_horse_asciigrey_pnm = wxBitmap( image ); + } image.Destroy(); if ( !image.LoadFile( dir + _T("horse_rg.pnm"), wxBITMAP_TYPE_PNM ) ) + { wxLogError(wxT("Can't load PNM image")); + } else + { my_horse_rawgrey_pnm = wxBitmap( image ); + } #endif #if wxUSE_LIBTIFF image.Destroy(); if ( !image.LoadFile( dir + _T("horse.tif"), wxBITMAP_TYPE_TIF ) ) + { wxLogError(wxT("Can't load TIFF image")); + } else + { my_horse_tiff = wxBitmap( image ); + } #endif #if wxUSE_LIBTIFF image.Destroy(); if ( !image.LoadFile( dir + _T("horse.tga"), wxBITMAP_TYPE_TGA ) ) + { wxLogError(wxT("Can't load TGA image")); + } else + { my_horse_tga = wxBitmap( image ); + } #endif CreateAntiAliasedBitmap(); @@ -225,28 +279,42 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id, image.Destroy(); if ( !image.LoadFile( dir + _T("horse.ico"), wxBITMAP_TYPE_ICO, 0 ) ) + { wxLogError(wxT("Can't load first ICO image")); + } else + { my_horse_ico32 = wxBitmap( image ); + } image.Destroy(); if ( !image.LoadFile( dir + _T("horse.ico"), wxBITMAP_TYPE_ICO, 1 ) ) + { wxLogError(wxT("Can't load second ICO image")); + } else + { my_horse_ico16 = wxBitmap( image ); + } image.Destroy(); if ( !image.LoadFile( dir + _T("horse.ico") ) ) + { wxLogError(wxT("Can't load best ICO image")); + } else + { my_horse_ico = wxBitmap( image ); + } image.Destroy(); if ( !image.LoadFile( dir + _T("horse.cur"), wxBITMAP_TYPE_CUR ) ) + { wxLogError(wxT("Can't load best ICO image")); + } else { my_horse_cur = wxBitmap( image ); @@ -256,9 +324,13 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id, m_ani_images = wxImage::GetImageCount ( dir + _T("horse3.ani"), wxBITMAP_TYPE_ANI ); if (m_ani_images==0) + { wxLogError(wxT("No ANI-format images found")); + } else + { my_horse_ani = new wxBitmap [m_ani_images]; + } int i; for (i=0; i < m_ani_images; i++) @@ -286,14 +358,20 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id, size_t dataSize = (size_t)len; void *data = malloc(dataSize); if ( file.Read(data, dataSize) != len ) + { wxLogError(_T("Reading bitmap file failed")); + } else { wxMemoryInputStream mis(data, dataSize); if ( !image.LoadFile(mis) ) + { wxLogError(wxT("Can't load BMP image from stream")); + } else + { my_horse_bmp2 = wxBitmap( image ); + } } free(data); diff --git a/samples/internat/internat.cpp b/samples/internat/internat.cpp index cc00ea8e03..421ef38ee3 100644 --- a/samples/internat/internat.cpp +++ b/samples/internat/internat.cpp @@ -245,8 +245,10 @@ bool MyApp::OnInit() // Initialize the catalogs we'll be using const wxLanguageInfo* pInfo = wxLocale::GetLanguageInfo(m_lang); if (!m_locale.AddCatalog("internat")) + { wxLogError(_("Couldn't find/load the 'internat' catalog for locale '%s'."), pInfo ? pInfo->GetLocaleName() : _("unknown")); + } // Now try to add wxstd.mo so that loading "NOTEXIST.ING" file will produce // a localized error message: @@ -427,9 +429,13 @@ void MyFrame::OnTestLocaleAvail(wxCommandEvent& WXUNUSED(event)) } if ( wxLocale::IsAvailable(info->Language) ) + { wxLogMessage(_("Locale \"%s\" is available."), s_locale.c_str()); + } else + { wxLogWarning(_("Locale \"%s\" is not available."), s_locale.c_str()); + } } void MyFrame::OnOpen(wxCommandEvent& WXUNUSED(event)) diff --git a/samples/ipc/baseclient.cpp b/samples/ipc/baseclient.cpp index f10e49b43a..e19e8e274f 100644 --- a/samples/ipc/baseclient.cpp +++ b/samples/ipc/baseclient.cpp @@ -319,7 +319,9 @@ bool MyConnection::DoExecute(const void *data, size_t size, wxIPCFormat format) Log("Execute", wxEmptyString, wxEmptyString, data, size, format); bool retval = wxConnection::DoExecute(data, size, format); if (!retval) + { wxLogMessage("Execute failed!"); + } return retval; } diff --git a/samples/ipc/baseserver.cpp b/samples/ipc/baseserver.cpp index 4d8025fedb..6549fdfa42 100644 --- a/samples/ipc/baseserver.cpp +++ b/samples/ipc/baseserver.cpp @@ -376,7 +376,9 @@ bool BenchConnection::OnPoke(const wxString& topic, if ( m_advise ) { if ( !Advise(item, m_item) ) + { wxLogMessage("Failed to advise client about the change."); + } } return true; diff --git a/samples/ipc/client.cpp b/samples/ipc/client.cpp index b13587b74a..326e359365 100644 --- a/samples/ipc/client.cpp +++ b/samples/ipc/client.cpp @@ -434,7 +434,9 @@ bool MyConnection::DoExecute(const void *data, size_t size, wxIPCFormat format) Log(_T("Execute"), wxEmptyString, wxEmptyString, data, size, format); bool retval = wxConnection::DoExecute(data, size, format); if (!retval) + { wxLogMessage(_T("Execute failed!")); + } return retval; } diff --git a/samples/listctrl/listtest.cpp b/samples/listctrl/listtest.cpp index bbf8ea7207..96ee8fcd24 100644 --- a/samples/listctrl/listtest.cpp +++ b/samples/listctrl/listtest.cpp @@ -731,7 +731,9 @@ void MyFrame::OnSetColOrder(wxCommandEvent& WXUNUSED(event)) order[1] = 0; order[2] = 1; if ( m_listCtrl->SetColumnsOrder(order) ) + { wxLogMessage("Column order set to %s", DumpIntArray(order)); + } } void MyFrame::OnGetColOrder(wxCommandEvent& WXUNUSED(event)) diff --git a/samples/printing/printing.cpp b/samples/printing/printing.cpp index 801bb72ab0..fd48a07d30 100644 --- a/samples/printing/printing.cpp +++ b/samples/printing/printing.cpp @@ -355,9 +355,13 @@ void MyFrame::OnPrint(wxCommandEvent& WXUNUSED(event)) if (!printer.Print(this, &printout, true /*prompt*/)) { if (wxPrinter::GetLastError() == wxPRINTER_ERROR) + { wxLogError(_T("There was a problem printing. Perhaps your current printer is not set correctly?")); + } else + { wxLogMessage(_T("You canceled printing")); + } } else { diff --git a/samples/propgrid/propgrid_minimal.cpp b/samples/propgrid/propgrid_minimal.cpp index b7d8f8714f..e8c77b1393 100644 --- a/samples/propgrid/propgrid_minimal.cpp +++ b/samples/propgrid/propgrid_minimal.cpp @@ -59,10 +59,14 @@ void MyFrame::OnPropertyGridChange(wxPropertyGridEvent &event) wxPGProperty* p = event.GetProperty(); if ( p ) + { wxLogVerbose("OnPropertyGridChange(%s, value=%s)", p->GetName().c_str(), p->GetValueAsString().c_str()); + } else + { wxLogVerbose("OnPropertyGridChange(NULL)"); + } } void MyFrame::OnPropertyGridChanging(wxPropertyGridEvent &event) diff --git a/samples/sockets/baseclient.cpp b/samples/sockets/baseclient.cpp index f763eec800..1736b3b969 100644 --- a/samples/sockets/baseclient.cpp +++ b/samples/sockets/baseclient.cpp @@ -614,7 +614,9 @@ EventWorker::OnSocketEvent(wxSocketEvent& pEvent) { //wxLogMessage(wxT("EventWorker: got connection")); wxLogMessage(wxT("%s: starting writing message (2 bytes for signature and %d bytes of data to write)"),CreateIdent(m_localaddr).c_str(),m_outsize-2); if (!m_clientSocket->GetLocal(m_localaddr)) + { wxLogError(_("Cannot get peer data for socket %p"),m_clientSocket); + } m_currentType = WorkerEvent::SENDING; wxLogDebug(wxT("%s: CONNECTING"),CreateIdent(m_localaddr).c_str()); SendEvent(false); diff --git a/samples/sockets/client.cpp b/samples/sockets/client.cpp index fe33b6bd89..c435c1e9cc 100644 --- a/samples/sockets/client.cpp +++ b/samples/sockets/client.cpp @@ -618,7 +618,9 @@ void MyFrame::OnTestURL(wxCommandEvent& WXUNUSED(event)) // Get the data wxStringOutputStream sout; if ( data->Read(sout).GetLastError() != wxSTREAM_EOF ) + { wxLogError("Error reading the input stream."); + } wxLogMessage("Text retrieved from URL \"%s\" follows:\n%s", urlname, sout.GetString()); diff --git a/samples/sockets/server.cpp b/samples/sockets/server.cpp index 12ca047bf3..a85ef5deac 100644 --- a/samples/sockets/server.cpp +++ b/samples/sockets/server.cpp @@ -220,10 +220,14 @@ MyFrame::MyFrame() : wxFrame((wxFrame *)NULL, wxID_ANY, IPaddress addrReal; if ( !m_server->GetLocal(addrReal) ) + { wxLogMessage("ERROR: couldn't get the address we bound to"); + } else + { wxLogMessage("Server listening at %s:%u", addrReal.IPAddress(), addrReal.Service()); + } // Setup the event handler and subscribe to connection events m_server->SetEventHandler(*this, SERVER_ID); @@ -387,10 +391,14 @@ void MyFrame::OnServerEvent(wxSocketEvent& event) { IPaddress addr; if ( !sock->GetPeer(addr) ) + { wxLogMessage("New connection from unknown client accepted."); + } else + { wxLogMessage("New client connection from %s:%u accepted", addr.IPAddress(), addr.Service()); + } } else { diff --git a/samples/taborder/taborder.cpp b/samples/taborder/taborder.cpp index 72e99a0fce..3e070a9c22 100644 --- a/samples/taborder/taborder.cpp +++ b/samples/taborder/taborder.cpp @@ -100,9 +100,13 @@ private: void DoNavigate(int flags) { if ( m_panel->NavigateIn(flags) ) + { wxLogStatus(this, _T("Navigation event processed")); + } else + { wxLogStatus(this, _T("Navigation event ignored")); + } } wxPanel *m_panel; diff --git a/samples/text/text.cpp b/samples/text/text.cpp index 48a1106ce0..462317e9c3 100644 --- a/samples/text/text.cpp +++ b/samples/text/text.cpp @@ -223,25 +223,33 @@ public: void OnScrollLineDown(wxCommandEvent& WXUNUSED(event)) { if ( !m_panel->m_textrich->LineDown() ) + { wxLogMessage(_T("Already at the bottom")); + } } void OnScrollLineUp(wxCommandEvent& WXUNUSED(event)) { if ( !m_panel->m_textrich->LineUp() ) + { wxLogMessage(_T("Already at the top")); + } } void OnScrollPageDown(wxCommandEvent& WXUNUSED(event)) { if ( !m_panel->m_textrich->PageDown() ) + { wxLogMessage(_T("Already at the bottom")); + } } void OnScrollPageUp(wxCommandEvent& WXUNUSED(event)) { if ( !m_panel->m_textrich->PageUp() ) + { wxLogMessage(_T("Already at the top")); + } } void OnGetLine(wxCommandEvent& WXUNUSED(event)) @@ -788,7 +796,9 @@ void MyTextCtrl::OnMouseEvent(wxMouseEvent& ev) void MyTextCtrl::OnSetFocus(wxFocusEvent& event) { if ( ms_logFocus ) + { wxLogMessage( wxT("%p got focus."), this); + } event.Skip(); } @@ -796,7 +806,9 @@ void MyTextCtrl::OnSetFocus(wxFocusEvent& event) void MyTextCtrl::OnKillFocus(wxFocusEvent& event) { if ( ms_logFocus ) + { wxLogMessage( wxT("%p lost focus"), this); + } event.Skip(); } @@ -1491,9 +1503,13 @@ void MyFrame::OnFileSave(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnFileLoad(wxCommandEvent& WXUNUSED(event)) { if ( m_panel->m_textrich->LoadFile(_T("dummy.txt")) ) + { wxLogStatus(this, _T("Successfully loaded file")); + } else + { wxLogStatus(this, _T("Couldn't load the file")); + } } void MyFrame::OnRichTextTest(wxCommandEvent& WXUNUSED(event)) diff --git a/samples/treectrl/treetest.cpp b/samples/treectrl/treetest.cpp index edc685a307..facaf2ce88 100644 --- a/samples/treectrl/treetest.cpp +++ b/samples/treectrl/treetest.cpp @@ -802,10 +802,14 @@ void MyFrame::DoShowFirstOrLast(TreeFunc0_t pfn, const wxString& label) const wxTreeItemId item = (m_treeCtrl->*pfn)(); if ( !item.IsOk() ) + { wxLogMessage("There is no %s item", label); + } else + { wxLogMessage("The %s item is \"%s\"", label, m_treeCtrl->GetItemText(item)); + } } void MyFrame::DoShowRelativeItem(TreeFunc1_t pfn, const wxString& label) @@ -825,10 +829,14 @@ void MyFrame::DoShowRelativeItem(TreeFunc1_t pfn, const wxString& label) wxTreeItemId new_item = (m_treeCtrl->*pfn)(item); if ( !new_item.IsOk() ) + { wxLogMessage("There is no %s item", label); + } else + { wxLogMessage("The %s item is \"%s\"", label, m_treeCtrl->GetItemText(new_item)); + } } void MyFrame::OnScrollTo(wxCommandEvent& WXUNUSED(event)) @@ -1588,12 +1596,16 @@ void MyTreeCtrl::OnRMouseDClick(wxMouseEvent& event) { wxTreeItemId id = HitTest(event.GetPosition()); if ( !id ) + { wxLogMessage(wxT("No item under mouse")); + } else { MyTreeItemData *item = (MyTreeItemData *)GetItemData(id); if ( item ) + { wxLogMessage(wxT("Item '%s' under mouse"), item->GetDesc()); + } } event.Skip(); diff --git a/samples/widgets/bmpcombobox.cpp b/samples/widgets/bmpcombobox.cpp index af54170ef0..6e6f4fd71e 100644 --- a/samples/widgets/bmpcombobox.cpp +++ b/samples/widgets/bmpcombobox.cpp @@ -803,9 +803,13 @@ void BitmapComboBoxWidgetsPage::OnComboText(wxCommandEvent& event) _T("event and combobox values should be the same") ); if (event.GetEventType() == wxEVT_COMMAND_TEXT_ENTER) + { wxLogMessage(_T("BitmapCombobox enter pressed (now '%s')"), s.c_str()); + } else + { wxLogMessage(_T("BitmapCombobox text changed (now '%s')"), s.c_str()); + } } void BitmapComboBoxWidgetsPage::OnComboBox(wxCommandEvent& event) diff --git a/samples/widgets/combobox.cpp b/samples/widgets/combobox.cpp index ecaea3e419..275292fde2 100644 --- a/samples/widgets/combobox.cpp +++ b/samples/widgets/combobox.cpp @@ -618,9 +618,13 @@ void ComboboxWidgetsPage::OnComboText(wxCommandEvent& event) _T("event and combobox values should be the same") ); if (event.GetEventType() == wxEVT_COMMAND_TEXT_ENTER) + { wxLogMessage(_T("Combobox enter pressed (now '%s')"), s.c_str()); + } else + { wxLogMessage(_T("Combobox text changed (now '%s')"), s.c_str()); + } } void ComboboxWidgetsPage::OnComboBox(wxCommandEvent& event) diff --git a/samples/widgets/listbox.cpp b/samples/widgets/listbox.cpp index 0d41d68b0f..f02c97491e 100644 --- a/samples/widgets/listbox.cpp +++ b/samples/widgets/listbox.cpp @@ -593,9 +593,13 @@ void ListboxWidgetsPage::OnListbox(wxCommandEvent& event) m_textDelete->SetValue(wxString::Format(_T("%ld"), sel)); if (event.IsSelection()) + { wxLogMessage(_T("Listbox item %ld selected"), sel); + } else + { wxLogMessage(_T("Listbox item %ld deselected"), sel); + } } void ListboxWidgetsPage::OnListboxDClick(wxCommandEvent& event) diff --git a/samples/widgets/odcombobox.cpp b/samples/widgets/odcombobox.cpp index 34d90347a7..ae8cd2b9eb 100644 --- a/samples/widgets/odcombobox.cpp +++ b/samples/widgets/odcombobox.cpp @@ -761,9 +761,13 @@ void ODComboboxWidgetsPage::OnComboText(wxCommandEvent& event) _T("event and combobox values should be the same") ); if (event.GetEventType() == wxEVT_COMMAND_TEXT_ENTER) + { wxLogMessage(_T("OwnerDrawnCombobox enter pressed (now '%s')"), s.c_str()); + } else + { wxLogMessage(_T("OwnerDrawnCombobox text changed (now '%s')"), s.c_str()); + } } void ODComboboxWidgetsPage::OnComboBox(wxCommandEvent& event) diff --git a/samples/widgets/static.cpp b/samples/widgets/static.cpp index 463d40c227..ba433d749b 100644 --- a/samples/widgets/static.cpp +++ b/samples/widgets/static.cpp @@ -541,8 +541,12 @@ void StaticWidgetsPage::OnButtonLabelWithMarkupText(wxCommandEvent& WXUNUSED(eve void StaticWidgetsPage::OnMouseEvent(wxMouseEvent& event) { if ( event.GetEventObject() == m_statText ) + { wxLogMessage("Clicked on static text"); + } else + { wxLogMessage("Clicked on static box"); + } } diff --git a/samples/widgets/widgets.cpp b/samples/widgets/widgets.cpp index e14e7337e8..0551340bdd 100644 --- a/samples/widgets/widgets.cpp +++ b/samples/widgets/widgets.cpp @@ -904,9 +904,13 @@ void WidgetsFrame::OnDisableAutoComplete(wxCommandEvent& WXUNUSED(event)) wxCHECK_RET( entry, "menu item should be disabled" ); if ( entry->AutoComplete(wxArrayString()) ) + { wxLogMessage("Disabled auto completion."); + } else + { wxLogMessage("AutoComplete() failed."); + } } void WidgetsFrame::OnAutoCompleteFixed(wxCommandEvent& WXUNUSED(event)) @@ -926,9 +930,13 @@ void WidgetsFrame::OnAutoCompleteFixed(wxCommandEvent& WXUNUSED(event)) completion_choices.push_back("this string is for test"); if ( entry->AutoComplete(completion_choices) ) + { wxLogMessage("Enabled auto completion of a set of fixed strings."); + } else + { wxLogMessage("AutoComplete() failed."); + } } void WidgetsFrame::OnAutoCompleteFilenames(wxCommandEvent& WXUNUSED(event)) @@ -937,9 +945,13 @@ void WidgetsFrame::OnAutoCompleteFilenames(wxCommandEvent& WXUNUSED(event)) wxCHECK_RET( entry, "menu item should be disabled" ); if ( entry->AutoCompleteFileNames() ) + { wxLogMessage("Enable auto completion of file names."); + } else + { wxLogMessage("AutoCompleteFileNames() failed."); + } } void WidgetsFrame::OnSetHint(wxCommandEvent& WXUNUSED(event)) @@ -956,9 +968,13 @@ void WidgetsFrame::OnSetHint(wxCommandEvent& WXUNUSED(event)) s_hint = hint; if ( entry->SetHint(hint) ) + { wxLogMessage("Set hint to \"%s\".", hint); + } else + { wxLogMessage("Text hints not supported."); + } } #endif // wxUSE_MENUS diff --git a/samples/xrc/myframe.cpp b/samples/xrc/myframe.cpp index 175d883bae..f27d1d0470 100644 --- a/samples/xrc/myframe.cpp +++ b/samples/xrc/myframe.cpp @@ -136,18 +136,26 @@ MyFrame::MyFrame(wxWindow* parent) void MyFrame::OnUnloadResourceMenuCommand(wxCommandEvent& WXUNUSED(event)) { if ( wxXmlResource::Get()->Unload(wxT("rc/basicdlg.xrc")) ) + { wxLogMessage(_T("Basic dialog resource has now been unloaded, you ") _T("won't be able to use it before loading it again")); + } else + { wxLogWarning(_T("Failed to unload basic dialog resource")); + } } void MyFrame::OnReloadResourceMenuCommand(wxCommandEvent& WXUNUSED(event)) { if ( wxXmlResource::Get()->Load(wxT("rc/basicdlg.xrc")) ) + { wxLogStatus(_T("Basic dialog resource has been loaded.")); + } else + { wxLogError(_T("Failed to load basic dialog resource")); + } } void MyFrame::OnExitToolOrMenuCommand(wxCommandEvent& WXUNUSED(event)) diff --git a/src/common/config.cpp b/src/common/config.cpp index c139a2c832..8b1fdf83f0 100644 --- a/src/common/config.cpp +++ b/src/common/config.cpp @@ -479,9 +479,13 @@ void wxSplitPath(wxArrayString& aParts, const wxString& path) else if ( strCurrent == wxT("..") ) { // go up one level if ( aParts.size() == 0 ) + { wxLogWarning(_("'%s' has extra '..', ignored."), path); + } else + { aParts.erase(aParts.end() - 1); + } strCurrent.Empty(); } diff --git a/src/common/file.cpp b/src/common/file.cpp index d4514c5693..1a34a9991a 100644 --- a/src/common/file.cpp +++ b/src/common/file.cpp @@ -450,14 +450,17 @@ bool wxFile::Eof() const iRc = wxEof(m_fd); #endif // Windows/Unix - if ( iRc == 1) - {} - else if ( iRc == 0 ) + if ( iRc == 0 ) return false; - else if ( iRc == wxInvalidOffset ) + + if ( iRc == wxInvalidOffset ) + { wxLogSysError(_("can't determine if the end of file is reached on descriptor %d"), m_fd); - else + } + else if ( iRc != 1 ) + { wxFAIL_MSG(_T("invalid eof() return value.")); + } return true; } diff --git a/src/common/filename.cpp b/src/common/filename.cpp index ecd14faf6f..0d3e6229f2 100644 --- a/src/common/filename.cpp +++ b/src/common/filename.cpp @@ -180,11 +180,15 @@ public: if ( m_hFile == INVALID_HANDLE_VALUE ) { if ( mode == Read ) + { wxLogSysError(_("Failed to open '%s' for reading"), filename.c_str()); + } else + { wxLogSysError(_("Failed to open '%s' for writing"), filename.c_str()); + } } } diff --git a/src/common/imagbmp.cpp b/src/common/imagbmp.cpp index 93288ddab1..cc963bc7d2 100644 --- a/src/common/imagbmp.cpp +++ b/src/common/imagbmp.cpp @@ -1222,7 +1222,9 @@ bool wxICOHandler::SaveFile(wxImage *image, if ( !cStream.Ok() ) { if ( verbose ) + { wxLogError(_("ICO: Error writing the image file!")); + } return false; } #endif // 0 diff --git a/src/common/zipstrm.cpp b/src/common/zipstrm.cpp index 17f698fb60..ff886b0770 100644 --- a/src/common/zipstrm.cpp +++ b/src/common/zipstrm.cpp @@ -1874,13 +1874,19 @@ size_t wxZipInputStream::OnSysRead(void *buffer, size_t size) m_lasterror = wxSTREAM_READ_ERROR; if (m_entry.GetSize() != TellI()) + { wxLogError(_("reading zip stream (entry %s): bad length"), m_entry.GetName().c_str()); + } else if (m_crcAccumulator != m_entry.GetCrc()) + { wxLogError(_("reading zip stream (entry %s): bad crc"), m_entry.GetName().c_str()); + } else + { m_lasterror = wxSTREAM_EOF; + } } } diff --git a/src/gtk1/threadno.cpp b/src/gtk1/threadno.cpp index a4bcf8a517..572f91df81 100644 --- a/src/gtk1/threadno.cpp +++ b/src/gtk1/threadno.cpp @@ -28,7 +28,9 @@ wxMutex::wxMutex() wxMutex::~wxMutex() { if (m_locked) + { wxLogDebug( "wxMutex warning: destroying a locked mutex (%d locks)", m_locked ); + } } wxMutexError wxMutex::Lock() diff --git a/src/gtk1/threadsgi.cpp b/src/gtk1/threadsgi.cpp index 8f49d94a32..6ba3e7255c 100644 --- a/src/gtk1/threadsgi.cpp +++ b/src/gtk1/threadsgi.cpp @@ -66,7 +66,9 @@ wxMutex::wxMutex() wxMutex::~wxMutex() { if (m_locked > 0) + { wxLogDebug( "wxMutex warning: freeing a locked mutex (%d locks)\n", m_locked ); + } delete p_internal; } diff --git a/src/html/helpwnd.cpp b/src/html/helpwnd.cpp index b4aafe1a76..2c225df7c0 100644 --- a/src/html/helpwnd.cpp +++ b/src/html/helpwnd.cpp @@ -1529,9 +1529,13 @@ void wxHtmlHelpWindow::OnToolbar(wxCommandEvent& event) if (m_Printer == NULL) m_Printer = new wxHtmlEasyPrinting(_("Help Printing"), this); if (!m_HtmlWin->GetOpenedPage()) + { wxLogWarning(_("Cannot print empty page.")); + } else + { m_Printer->PrintFile(m_HtmlWin->GetOpenedPage()); + } } break; #endif diff --git a/src/mgl/window.cpp b/src/mgl/window.cpp index f9a1505ff3..3bac7640e0 100644 --- a/src/mgl/window.cpp +++ b/src/mgl/window.cpp @@ -543,7 +543,9 @@ void wxWindowMGL::Init() if ( !g_winMng ) { if ( !wxTheApp->SetDisplayMode(wxGetDefaultDisplayMode()) ) + { wxLogFatalError(_("Cannot initialize display.")); + } } // mgl specific: diff --git a/src/msdos/utilsdos.cpp b/src/msdos/utilsdos.cpp index d5c8a1a0fe..0752049157 100644 --- a/src/msdos/utilsdos.cpp +++ b/src/msdos/utilsdos.cpp @@ -307,7 +307,9 @@ bool wxShell(const wxString& command /*=wxEmptyString*/) int result = system(command); if (result == -1) + { wxLogSysError(_("can't execute '%s'"), command.c_str()); + } return result == 0; } @@ -407,7 +409,9 @@ bool wxRedirectableFd::Reopen(const wxString& name, int flags) } if (!result) + { wxLogSysError(_("error opening '%s'"), name.c_str()); + } return result; } @@ -466,7 +470,9 @@ long wxExecute(wxChar **argv, int flags, wxProcess *process) int result = spawnvp(mode, argv[0], argv); if (result == -1) + { wxLogSysError(_("can't execute '%s'"), argv[0]); + } #if wxUSE_STREAMS if (redirect) diff --git a/src/msw/clipbrd.cpp b/src/msw/clipbrd.cpp index b9df0c2767..fa65cd2a21 100644 --- a/src/msw/clipbrd.cpp +++ b/src/msw/clipbrd.cpp @@ -90,7 +90,9 @@ bool wxOpenClipboard() gs_wxClipboardIsOpen = ::OpenClipboard((HWND)win->GetHWND()) != 0; if ( !gs_wxClipboardIsOpen ) + { wxLogSysError(_("Failed to open the clipboard.")); + } return gs_wxClipboardIsOpen; } diff --git a/src/msw/colordlg.cpp b/src/msw/colordlg.cpp index f369f4762b..0b8d20706f 100644 --- a/src/msw/colordlg.cpp +++ b/src/msw/colordlg.cpp @@ -152,7 +152,9 @@ int wxColourDialog::ShowModal() // occurred const DWORD err = CommDlgExtendedError(); if ( err ) + { wxLogError(_("Colour selection dialog failed with error %0lx."), err); + } return wxID_CANCEL; } diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp index 320d587437..223715ccb9 100644 --- a/src/msw/dc.cpp +++ b/src/msw/dc.cpp @@ -183,13 +183,17 @@ public: { m_modeOld = ::SetStretchBltMode(m_hdc, COLORONCOLOR); if ( !m_modeOld ) + { wxLogLastError(_T("SetStretchBltMode")); + } } ~StretchBltModeChanger() { if ( !::SetStretchBltMode(m_hdc, m_modeOld) ) + { wxLogLastError(_T("SetStretchBltMode")); + } } private: diff --git a/src/msw/dcprint.cpp b/src/msw/dcprint.cpp index dfa9d3e656..c41e222d7b 100644 --- a/src/msw/dcprint.cpp +++ b/src/msw/dcprint.cpp @@ -340,7 +340,9 @@ WXHDC WXDLLEXPORT wxGetPrinterDC(const wxPrintData& printDataConst) static_cast(lockDevMode.Get()) ); if ( !hDC ) + { wxLogLastError(_T("CreateDC(printer)")); + } return (WXHDC) hDC; #endif // PostScript/Windows printing diff --git a/src/msw/dialup.cpp b/src/msw/dialup.cpp index da0e96c243..ddc42b8e2d 100644 --- a/src/msw/dialup.cpp +++ b/src/msw/dialup.cpp @@ -883,11 +883,15 @@ bool wxDialUpManagerMSW::Dial(const wxString& nameOfISP, { // can't pass a wxWCharBuffer through ( ... ) if ( async ) + { wxLogError(_("Failed to initiate dialup connection: %s"), GetErrorString(dwRet).c_str()); + } else + { wxLogError(_("Failed to establish dialup connection: %s"), GetErrorString(dwRet).c_str()); + } // we should still call RasHangUp() if we got a non 0 connection if ( ms_hRasConnection ) diff --git a/src/msw/enhmeta.cpp b/src/msw/enhmeta.cpp index fd2e73ac75..e73efeb15d 100644 --- a/src/msw/enhmeta.cpp +++ b/src/msw/enhmeta.cpp @@ -94,8 +94,10 @@ void wxEnhMetaFile::Init() { m_hMF = (WXHANDLE)::GetEnhMetaFile(m_filename.fn_str()); if ( !m_hMF ) + { wxLogSysError(_("Failed to load metafile from file \"%s\"."), m_filename.c_str()); + } } } diff --git a/src/msw/glcanvas.cpp b/src/msw/glcanvas.cpp index c8a84f6cf6..8c9273b8a4 100644 --- a/src/msw/glcanvas.cpp +++ b/src/msw/glcanvas.cpp @@ -117,7 +117,9 @@ wxGLContext::wxGLContext(wxGLCanvas *win, const wxGLContext* other) if ( other ) { if ( !wglShareLists(other->m_glContext, m_glContext) ) + { wxLogLastError(_T("wglShareLists")); + } } } diff --git a/src/msw/iniconf.cpp b/src/msw/iniconf.cpp index b56e88db4a..87dd3b1053 100644 --- a/src/msw/iniconf.cpp +++ b/src/msw/iniconf.cpp @@ -350,7 +350,9 @@ bool wxIniConfig::DoWriteString(const wxString& szKey, const wxString& szValue) m_strLocalFilename.wx_str()) != 0; if ( !bOk ) + { wxLogLastError(wxT("WritePrivateProfileString")); + } return bOk; } @@ -405,7 +407,9 @@ bool wxIniConfig::DeleteEntry(const wxString& szKey, bool bGroupIfEmptyAlso) NULL, m_strLocalFilename.wx_str()) != 0; if ( !bOk ) + { wxLogLastError(wxT("WritePrivateProfileString")); + } return bOk; } @@ -420,7 +424,9 @@ bool wxIniConfig::DeleteGroup(const wxString& szKey) NULL, m_strLocalFilename.wx_str()) != 0; if ( !bOk ) + { wxLogLastError(wxT("WritePrivateProfileString")); + } return bOk; } diff --git a/src/msw/listbox.cpp b/src/msw/listbox.cpp index a06a7af872..03a5c497ca 100644 --- a/src/msw/listbox.cpp +++ b/src/msw/listbox.cpp @@ -362,7 +362,9 @@ void wxListBox::DoSetItemClientData(unsigned int n, void *clientData) wxT("invalid index in wxListBox::SetClientData") ); if ( ListBox_SetItemData(GetHwnd(), n, clientData) == LB_ERR ) + { wxLogDebug(wxT("LB_SETITEMDATA failed")); + } } // Return number of selections and an array of selected integers diff --git a/src/msw/mdi.cpp b/src/msw/mdi.cpp index 8c860d0744..9c28b56f13 100644 --- a/src/msw/mdi.cpp +++ b/src/msw/mdi.cpp @@ -1434,7 +1434,9 @@ void MDISetMenu(wxWindow *win, HMENU hmenuFrame, HMENU hmenuWindow) { DWORD err = ::GetLastError(); if ( err ) + { wxLogApiError(_T("SendMessage(WM_MDISETMENU)"), err); + } } } diff --git a/src/msw/menu.cpp b/src/msw/menu.cpp index 33d7dbd6e2..8bbe72a03b 100644 --- a/src/msw/menu.cpp +++ b/src/msw/menu.cpp @@ -118,7 +118,9 @@ UINT GetMenuState(HMENU hMenu, UINT id, UINT flags) info.fMask = MIIM_STATE; // MF_BYCOMMAND is zero so test MF_BYPOSITION if ( !::GetMenuItemInfo(hMenu, id, flags & MF_BYPOSITION ? TRUE : FALSE , & info) ) + { wxLogLastError(wxT("GetMenuItemInfo")); + } return info.fState; } #endif // __WXWINCE__ @@ -569,7 +571,9 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos) mi.fMask = MIM_STYLE; mi.dwStyle = MNS_CHECKORBMP; if ( !(*pfnSetMenuInfo)(GetHmenu(), &mi) ) + { wxLogLastError(_T("SetMenuInfo(MNS_NOCHECK)")); + } } // tell the item that it's not really owner-drawn but only @@ -1446,9 +1450,13 @@ bool wxMenuBar::AddAdornments(long style) if (style & wxCLOSE_BOX) { if (!CommandBar_AddAdornments((HWND) m_commandBar, 0, 0)) + { wxLogLastError(wxT("CommandBar_AddAdornments")); + } else + { return true; + } } return false; } diff --git a/src/msw/spinctrl.cpp b/src/msw/spinctrl.cpp index d7a13374d0..4ca50327cc 100644 --- a/src/msw/spinctrl.cpp +++ b/src/msw/spinctrl.cpp @@ -580,7 +580,9 @@ bool wxSpinCtrl::Reparent(wxWindowBase *newParent) // destroy the old spin button UnsubclassWin(); if ( !::DestroyWindow(GetHwnd()) ) + { wxLogLastError(wxT("DestroyWindow")); + } // create and initialize the new one if ( !wxSpinButton::Create(GetParent(), GetId(), diff --git a/src/msw/statusbar.cpp b/src/msw/statusbar.cpp index c8921219cb..cf1d0e7bf1 100644 --- a/src/msw/statusbar.cpp +++ b/src/msw/statusbar.cpp @@ -183,7 +183,7 @@ void wxStatusBar::SetFieldsCount(int nFields, const int *widths) wxStatusBarBase::SetFieldsCount(nFields, widths); SetFieldsWidth(); - + // keep in synch also our m_tooltips array // reset all current tooltips @@ -236,7 +236,9 @@ void wxStatusBar::SetFieldsWidth() } if ( !StatusBar_SetParts(GetHwnd(), m_panes.GetCount(), pWidths) ) + { wxLogLastError("StatusBar_SetParts"); + } delete [] pWidths; @@ -309,22 +311,24 @@ void wxStatusBar::UpdateFieldText(int nField) } else { - text = wxControl::Ellipsize(text, + text = wxControl::Ellipsize(text, *m_pDC, ellmode, maxWidth, wxELLIPSIZE_EXPAND_TAB); - - // update the ellipsization status for this pane; this is used later to - // decide whether a tooltip should be shown or not for this pane + + // update the ellipsization status for this pane; this is used later to + // decide whether a tooltip should be shown or not for this pane // (if we have wxSTB_SHOW_TIPS) SetEllipsizedFlag(nField, text != GetStatusText(nField)); } - // Set the status text in the native control passing both field number and style. + // Set the status text in the native control passing both field number and style. // NOTE: MSDN library doesn't mention that nField and style have to be 'ORed' if ( !StatusBar_SetText(GetHwnd(), nField | style, text.wx_str()) ) + { wxLogLastError("StatusBar_SetText"); + } if (HasFlag(wxSTB_SHOW_TIPS)) { @@ -388,7 +392,9 @@ bool wxStatusBar::GetFieldRect(int i, wxRect& rect) const RECT r; if ( !::SendMessage(GetHwnd(), SB_GETRECT, i, (LPARAM)&r) ) + { wxLogLastError("SendMessage(SB_GETRECT)"); + } #if wxUSE_UXTHEME wxUxThemeHandle theme(const_cast(this), L"Status"); @@ -514,11 +520,13 @@ void wxStatusBar::SetStatusStyles(int n, const int styles[]) } // The SB_SETTEXT message is both used to set the field's text as well as - // the fields' styles. + // the fields' styles. // NOTE: MSDN library doesn't mention that nField and style have to be 'ORed' wxString text = GetStatusText(i); if (!StatusBar_SetText(GetHwnd(), style | i, text.wx_str())) + { wxLogLastError("StatusBar_SetText"); + } } } diff --git a/src/msw/toolbar.cpp b/src/msw/toolbar.cpp index 24eeac7198..2f5abfd6d2 100644 --- a/src/msw/toolbar.cpp +++ b/src/msw/toolbar.cpp @@ -1600,7 +1600,9 @@ void wxToolBar::OnEraseBackground(wxEraseEvent& event) // it can also return S_FALSE which seems to simply say that it // didn't draw anything but no error really occurred if ( FAILED(hr) ) + { wxLogApiError(_T("DrawThemeParentBackground(toolbar)"), hr); + } } } @@ -1623,7 +1625,9 @@ void wxToolBar::OnEraseBackground(wxEraseEvent& event) // it can also return S_FALSE which seems to simply say that it // didn't draw anything but no error really occurred if ( FAILED(hr) ) + { wxLogApiError(_T("DrawThemeParentBackground(toolbar)"), hr); + } } } diff --git a/src/msw/utilsexc.cpp b/src/msw/utilsexc.cpp index 5d2e0b52cb..f5e70e2d91 100644 --- a/src/msw/utilsexc.cpp +++ b/src/msw/utilsexc.cpp @@ -923,7 +923,9 @@ long wxExecute(const wxString& cmd, int flags, wxProcess *handler) // close unneeded handle if ( !::CloseHandle(pi.hThread) ) + { wxLogLastError(wxT("CloseHandle(hThread)")); + } if ( !hThread ) { diff --git a/src/msw/volume.cpp b/src/msw/volume.cpp index dbc6c61e55..f92083976f 100644 --- a/src/msw/volume.cpp +++ b/src/msw/volume.cpp @@ -611,7 +611,9 @@ wxIcon wxFSVolume::GetIcon(wxFSIconType type) const long rc = SHGetFileInfo(m_volName.wx_str(), 0, &fi, sizeof(fi), flags); m_icons[type].SetHICON((WXHICON)fi.hIcon); if (!rc || !fi.hIcon) + { wxLogError(_("Cannot load icon from '%s'."), m_volName.c_str()); + } } return m_icons[type]; diff --git a/src/msw/window.cpp b/src/msw/window.cpp index be4133f07f..f38ff5e4e2 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -564,7 +564,9 @@ wxWindowMSW::~wxWindowMSW() //if (::IsWindow(GetHwnd())) { if ( !::DestroyWindow(GetHwnd()) ) + { wxLogLastError(wxT("DestroyWindow")); + } } // remove hWnd <-> wxWindow association @@ -1258,7 +1260,9 @@ void wxWindowMSW::AssociateHandle(WXWidget handle) if ( m_hWnd ) { if ( !::DestroyWindow(GetHwnd()) ) + { wxLogLastError(wxT("DestroyWindow")); + } } WXHWND wxhwnd = (WXHWND)handle; @@ -4694,9 +4698,13 @@ bool wxWindowMSW::HandlePaint() { HRGN hRegion = ::CreateRectRgn(0, 0, 0, 0); // Dummy call to get a handle if ( !hRegion ) + { wxLogLastError(wxT("CreateRectRgn")); + } if ( ::GetUpdateRgn(GetHwnd(), hRegion, FALSE) == ERROR ) + { wxLogLastError(wxT("GetUpdateRgn")); + } m_updateRegion = wxRegion((WXHRGN) hRegion); diff --git a/src/os2/clipbrd.cpp b/src/os2/clipbrd.cpp index e4bd46af6f..523ee72294 100644 --- a/src/os2/clipbrd.cpp +++ b/src/os2/clipbrd.cpp @@ -60,7 +60,9 @@ bool wxOpenClipboard() gs_wxClipboardIsOpen = ::OpenClipboard((HWND)win->GetHWND()) != 0; if ( !gs_wxClipboardIsOpen ) + { wxLogSysError(_("Failed to open the clipboard.")); + } return gs_wxClipboardIsOpen; } diff --git a/src/os2/iniconf.cpp b/src/os2/iniconf.cpp index 1aaa908772..5b352380e6 100644 --- a/src/os2/iniconf.cpp +++ b/src/os2/iniconf.cpp @@ -372,7 +372,9 @@ bool wxIniConfig::Write(const wxString& szKey, const wxString& WXUNUSED(szValue) // szValue, m_strLocalFilename) != 0; if ( !bOk ) + { wxLogLastError(wxT("WritePrivateProfileString")); + } return bOk; } @@ -417,7 +419,9 @@ bool wxIniConfig::DeleteEntry(const wxString& szKey, bool bGroupIfEmptyAlso) // NULL, m_strLocalFilename) != 0; if ( !bOk ) + { wxLogLastError(wxT("WritePrivateProfileString")); + } return bOk; } @@ -432,7 +436,9 @@ bool wxIniConfig::DeleteGroup(const wxString& szKey) // NULL, m_strLocalFilename) != 0; if ( !bOk ) + { wxLogLastError(wxT("WritePrivateProfileString")); + } return bOk; } diff --git a/src/os2/menu.cpp b/src/os2/menu.cpp index 7dc55b2412..a2654c5419 100644 --- a/src/os2/menu.cpp +++ b/src/os2/menu.cpp @@ -1097,7 +1097,9 @@ void wxMenuBar::Attach( ,m_vAccelTable.GetHACCEL() ,(HWND)pFrame->GetFrame() )) + { wxLogLastError(wxT("WinSetAccelTable")); + } #endif // wxUSE_ACCEL } // end of wxMenuBar::Attach diff --git a/src/os2/thread.cpp b/src/os2/thread.cpp index c3461f4af9..e83ecc0ca9 100644 --- a/src/os2/thread.cpp +++ b/src/os2/thread.cpp @@ -124,7 +124,9 @@ wxMutexInternal::~wxMutexInternal() if (m_vMutex) { if (::DosCloseMutexSem(m_vMutex)) + { wxLogLastError(_T("DosCloseMutexSem(mutex)")); + } } } diff --git a/src/os2/tooltip.cpp b/src/os2/tooltip.cpp index 300dedee4e..39481333bb 100644 --- a/src/os2/tooltip.cpp +++ b/src/os2/tooltip.cpp @@ -71,7 +71,9 @@ void wxToolTip::Create( ,NULL ); if (!m_hWnd) + { wxLogError(_T("Unable to create tooltip window")); + } wxColour vColor( wxT("YELLOW") ); lColor = (LONG)vColor.GetPixel(); diff --git a/src/os2/window.cpp b/src/os2/window.cpp index b0f1d70118..4d3522e857 100644 --- a/src/os2/window.cpp +++ b/src/os2/window.cpp @@ -352,7 +352,9 @@ wxWindowOS2::~wxWindowOS2() if (m_hWnd) { if(!::WinDestroyWindow(GetHWND())) + { wxLogLastError(wxT("DestroyWindow")); + } // // remove hWnd <-> wxWindow association // diff --git a/src/osx/carbon/mdi.cpp b/src/osx/carbon/mdi.cpp index eb86566919..f236d572a4 100644 --- a/src/osx/carbon/mdi.cpp +++ b/src/osx/carbon/mdi.cpp @@ -249,7 +249,9 @@ void wxMDIParentFrame::MacActivate(long timestamp, bool activating) else // schedule ourselves for deactivation { if (s_macDeactivateWindow) + { wxLogTrace(TRACE_MDI, wxT("window=%p SHOULD have been deactivated, oh well!"), s_macDeactivateWindow); + } wxLogTrace(TRACE_MDI, wxT("Scheduling delayed MDI Parent deactivation")); s_macDeactivateWindow = this; @@ -402,7 +404,9 @@ void wxMDIChildFrame::MacActivate(long timestamp, bool activating) else // schedule ourselves for deactivation { if (s_macDeactivateWindow) + { wxLogTrace(TRACE_MDI, wxT("window=%p SHOULD have been deactivated, oh well!"), s_macDeactivateWindow); + } wxLogTrace(TRACE_MDI, wxT("Scheduling delayed deactivation")); s_macDeactivateWindow = this; diff --git a/src/osx/carbon/mimetmac.cpp b/src/osx/carbon/mimetmac.cpp index 586b6e0c83..706a7f7335 100644 --- a/src/osx/carbon/mimetmac.cpp +++ b/src/osx/carbon/mimetmac.cpp @@ -1404,7 +1404,9 @@ wxFileType* wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& ftInfo) wxString sError; bInfoOpenSuccess = cfdInfo.ReadAsXML(cfdaInDict, &sError); if (!bInfoOpenSuccess) + { wxLogDebug(sError); + } indictfile.Close(); } @@ -1752,7 +1754,9 @@ wxMimeTypesManagerImpl::Unassociate(wxFileType *pFileType) wxString sError; bInfoOpenSuccess = cfdInfo.ReadAsXML(cfdaInDict, &sError); if (!bInfoOpenSuccess) + { wxLogDebug(sError); + } indictfile.Close(); } @@ -1853,7 +1857,9 @@ wxMimeTypesManagerImpl::Unassociate(wxFileType *pFileType) wxLogDebug(sPrintOut); for (size_t i = 0; i < asExtensions.GetCount(); ++i) + { wxLogDebug(asExtensions[i]); + } } } else diff --git a/src/osx/carbon/sound.cpp b/src/osx/carbon/sound.cpp index ba9b89bcfc..38fb58f0b8 100644 --- a/src/osx/carbon/sound.cpp +++ b/src/osx/carbon/sound.cpp @@ -235,7 +235,9 @@ inline bool wxInitQT () int nError; //-2093 no dll if ((nError = InitializeQTML(0)) != noErr) + { wxLogSysError(wxString::Format(wxT("Couldn't Initialize Quicktime-%i"), nError)); + } #endif EnterMovies(); return true; diff --git a/src/osx/core/hid.cpp b/src/osx/core/hid.cpp index 7430e714c5..746c5e27d1 100644 --- a/src/osx/core/hid.cpp +++ b/src/osx/core/hid.cpp @@ -193,7 +193,9 @@ bool wxHIDDevice::Create (int nClass, int nType, int nDev) //open the HID interface... if ( (*m_ppDevice)->open(m_ppDevice, 0) != S_OK ) + { wxLogDebug(_T("HID device: open failed")); + } // //Now the hard part - in order to scan things we need "cookies" @@ -316,7 +318,9 @@ void wxHIDDevice::AddCookieInQueue(CFTypeRef Data, int i) //3rd Param flags (none yet) AddCookie(Data, i); if ( (*m_ppQueue)->addElement(m_ppQueue, m_pCookies[i], 0) != S_OK ) + { wxLogDebug(_T("HID device: adding element failed")); + } } // ---------------------------------------------------------------------------- diff --git a/src/propgrid/property.cpp b/src/propgrid/property.cpp index 221ebb4f77..bbd56c2a03 100644 --- a/src/propgrid/property.cpp +++ b/src/propgrid/property.cpp @@ -2331,9 +2331,13 @@ wxPGProperty* wxPGProperty::GetItemAtY( unsigned int y, /* if ( current ) + { wxLogDebug(wxT("%s::GetItemAtY(%i) -> %s"),this->GetLabel().c_str(),y,current->GetLabel().c_str()); + } else + { wxLogDebug(wxT("%s::GetItemAtY(%i) -> NULL"),this->GetLabel().c_str(),y); + } */ return (wxPGProperty*) result; diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 305f246cc2..351c1ca287 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -3245,10 +3245,14 @@ bool wxPropertyGrid::DoSelectProperty( wxPGProperty* p, unsigned int flags ) { /* if (p) + { wxLogDebug(wxT("SelectProperty( %s (%s[%i]) )"),p->m_label.c_str(), p->m_parent->m_label.c_str(),p->GetIndexInParent()); + } else + { wxLogDebug(wxT("SelectProperty( NULL, -1 )")); + } */ if ( m_inDoSelectProperty ) diff --git a/src/richtext/richtextxml.cpp b/src/richtext/richtextxml.cpp index d967ae5d02..feb26567ae 100644 --- a/src/richtext/richtextxml.cpp +++ b/src/richtext/richtextxml.cpp @@ -181,9 +181,13 @@ bool wxRichTextXMLHandler::ImportXML(wxRichTextBuffer* buffer, wxXmlNode* node) // note: 0 == wxBITMAP_TYPE_INVALID if (type <= 0 || type >= wxBITMAP_TYPE_MAX) + { wxLogWarning("Invalid bitmap type specified for tag: %d", type); + } else + { imageType = (wxBitmapType)type; + } } wxString data; diff --git a/src/univ/menu.cpp b/src/univ/menu.cpp index 558f6205e2..9e23137767 100644 --- a/src/univ/menu.cpp +++ b/src/univ/menu.cpp @@ -2456,7 +2456,9 @@ void wxMenuBar::OnDismissMenu(bool dismissMenuBar) void wxMenuBar::OnDismiss() { if ( ReleaseMouseCapture() ) + { wxLogTrace(_T("mousecapture"), _T("Releasing mouse from wxMenuBar::OnDismiss")); + } if ( m_current != -1 ) { diff --git a/src/x11/app.cpp b/src/x11/app.cpp index e18014ec14..d89eccaf21 100644 --- a/src/x11/app.cpp +++ b/src/x11/app.cpp @@ -690,7 +690,9 @@ PangoContext* wxApp::GetPangoContext() s_pangoContext = pango_x_get_context(dpy); if (!PANGO_IS_CONTEXT(s_pangoContext)) + { wxLogError( wxT("No pango context.") ); + } } return s_pangoContext; diff --git a/src/x11/window.cpp b/src/x11/window.cpp index 3b3c9727eb..184282120b 100644 --- a/src/x11/window.cpp +++ b/src/x11/window.cpp @@ -522,7 +522,9 @@ void wxWindowX11::DoCaptureMouse() msg.Printf(wxT("Failed to grab pointer for window %s"), this->GetClassInfo()->GetClassName()); wxLogDebug(msg); if (res == GrabNotViewable) + { wxLogDebug( wxT("This is not a viewable window - perhaps not shown yet?") ); + } g_captureWindow = NULL; return; diff --git a/tests/archive/archivetest.cpp b/tests/archive/archivetest.cpp index c9f6d69c0b..0b143950e7 100644 --- a/tests/archive/archivetest.cpp +++ b/tests/archive/archivetest.cpp @@ -388,7 +388,9 @@ void TempDir::RemoveDir(wxString& path) wxRmdir(tmp + wxFileName(dirs[i], wxPATH_UNIX).GetFullPath()); if (!wxRmdir(m_tmp)) + { wxLogSysError(_T("can't remove temporary dir '%s'"), m_tmp.c_str()); + } } diff --git a/tests/streams/largefile.cpp b/tests/streams/largefile.cpp index f61d2943d1..6d6a0f7948 100644 --- a/tests/streams/largefile.cpp +++ b/tests/streams/largefile.cpp @@ -122,7 +122,7 @@ void LargeFileTest::runTest() // write a large file { auto_ptr out(MakeOutStream(tmpfile.m_name)); - + // write 'A's at [ 0x7fffffbf, 0x7fffffff [ pos = 0x7fffffff - size; CPPUNIT_ASSERT(out->SeekO(pos) == pos); @@ -317,7 +317,7 @@ CppUnit::Test *largeFile::suite() #ifndef FSCTL_SET_SPARSE -# ifndef FILE_SPECIAL_ACCESS +# ifndef FILE_SPECIAL_ACCESS # define FILE_SPECIAL_ACCESS FILE_ANY_ACCESS # endif # define FSCTL_SET_SPARSE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 49, \ @@ -332,7 +332,7 @@ void GetVolumeInfo(const wxString& path) { // extract the volume 'C:\' or '\\tooter\share\' from the path wxString vol; - + if (path.substr(1, 2) == _T(":\\")) { vol = path.substr(0, 3); } else { @@ -353,10 +353,12 @@ void GetVolumeInfo(const wxString& path) : vol.c_str(); if (!::GetVolumeInformation(pVol, NULL, 0, NULL, NULL, - &volumeFlags, + &volumeFlags, volumeType, WXSIZEOF(volumeType))) + { wxLogSysError(_T("GetVolumeInformation() failed")); + } volumeInfoInit = true; } @@ -374,7 +376,7 @@ void MakeSparse(const wxString& path, int fd) if (!volumeInfoInit) GetVolumeInfo(path); - + if ((volumeFlags & FILE_SUPPORTS_SPARSE_FILES) != 0) if (!::DeviceIoControl((HANDLE)_get_osfhandle(fd), FSCTL_SET_SPARSE, diff --git a/tests/streams/zlibstream.cpp b/tests/streams/zlibstream.cpp index 58b3c3b34e..92ed46edc2 100644 --- a/tests/streams/zlibstream.cpp +++ b/tests/streams/zlibstream.cpp @@ -400,16 +400,22 @@ void zlibStream::doDecompress_ExternalData(const unsigned char *data, const char break; case wxZLIB_ZLIB: if (!(data_size >= 1 && data[0] == 0x78)) + { wxLogError(_T("zlib data seems to not be zlib data!")); + } break; case wxZLIB_GZIP: if (!(data_size >= 2 && data[0] == 0x1F && data[1] == 0x8B)) + { wxLogError(_T("gzip data seems to not be gzip data!")); + } break; case wxZLIB_AUTO: if (!(data_size >= 1 && data[0] == 0x78) || !(data_size >= 2 && data[0] == 0x1F && data[1] == 0x8B)) + { wxLogError(_T("Data seems to not be zlib or gzip data!")); + } default: wxLogError(_T("Unknown flag, skipping quick test.")); }; diff --git a/utils/execmon/execmon.cpp b/utils/execmon/execmon.cpp index 00766ccd98..646bb62242 100644 --- a/utils/execmon/execmon.cpp +++ b/utils/execmon/execmon.cpp @@ -117,7 +117,9 @@ bool TestExec(const wxVector& programs, long timeout) long pid = wxExecute(programs[i].GetFullPath(), wxEXEC_ASYNC, &dt->process); if (pid == 0) + { wxLogError("could not run the program '%s'", programs[i].GetFullPath()); + } else { wxLogMessage("started program '%s' (pid %d)...", diff --git a/utils/helpview/src/remhelp.cpp b/utils/helpview/src/remhelp.cpp index 3831358c91..0d8a521098 100644 --- a/utils/helpview/src/remhelp.cpp +++ b/utils/helpview/src/remhelp.cpp @@ -53,10 +53,10 @@ rhhcClient::rhhcClient( bool *isconn_a ) wxConnectionBase *rhhcClient::OnMakeConnection() { - return new rhhcConnection( isconn_2 ); + return new rhhcConnection( isconn_2 ); } -rhhcConnection::rhhcConnection( bool *isconn_a ) +rhhcConnection::rhhcConnection( bool *isconn_a ) : wxConnection() { isconn_3 = isconn_a; @@ -89,8 +89,8 @@ IMPLEMENT_CLASS(wxRemoteHtmlHelpController, wxHelpControllerBase) wxRemoteHtmlHelpController::wxRemoteHtmlHelpController(int style ) { - m_style = style; - m_connection = NULL; + m_style = style; + m_connection = NULL; m_client = NULL; m_pid = 0; isconn_1 = false; @@ -113,7 +113,7 @@ wxRemoteHtmlHelpController::wxRemoteHtmlHelpController(int style ) m_appname = wxT("./helpview"); m_service = wxT("/tmp/") + thename + wxString(wxT("_helpservice")); #else - m_appname = wxT("./helpview"); + m_appname = wxT("./helpview"); m_service = wxT("4242"); #endif @@ -154,7 +154,7 @@ wxRemoteHtmlHelpController::~wxRemoteHtmlHelpController() delete m_process; m_process = NULL; } - if( m_client ) + if( m_client ) delete m_client; //should be automatic? } @@ -179,7 +179,7 @@ bool wxRemoteHtmlHelpController::DoConnection() wxLogNull nolog; //first try to connect assuming server is running - if( !isconn_1 ) + if( !isconn_1 ) m_connection = (rhhcConnection *)m_client->MakeConnection(hostName, m_service, wxT("HELP") ); //if not, start server @@ -201,20 +201,20 @@ bool wxRemoteHtmlHelpController::DoConnection() } while ( !isconn_1 ) - { + { //try every second for a while, then leave it to user wxSleep(1); if( nsleep > 4 ) { if ( wxMessageBox( wxT("Failed to make connection to Help server.\nRetry?") , wxT("wxRemoteHtmlHelpController Error"), wxICON_ERROR | wxYES_NO | wxCANCEL ) != wxYES ) - { + { // no server return false; } } nsleep++; - + m_connection = (rhhcConnection *)m_client->MakeConnection(hostName, m_service, wxT("HELP") ); } } @@ -254,11 +254,11 @@ bool wxRemoteHtmlHelpController::Quit() default: wxFAIL_MSG( _T("unexpected return value") ); // fall through - + case -1: // cancelled return false; - + case wxSIGNONE: case wxSIGHUP: case wxSIGINT: @@ -282,9 +282,13 @@ bool wxRemoteHtmlHelpController::Quit() if ( sig == 0 ) { if ( wxProcess::Exists(m_pid) ) + { wxLogStatus(_T("Process %ld is running."), m_pid); + } else + { wxLogStatus(_T("No process with pid = %ld."), m_pid); + } } else // not SIGNONE { @@ -303,7 +307,7 @@ bool wxRemoteHtmlHelpController::Quit() _T("no such process"), _T("unspecified error"), }; - + // sig = 3, 6, 9 or 12 all kill server with no apparent problem // but give error message on MSW - timout? // @@ -321,8 +325,8 @@ void wxRemoteHtmlHelpController::Display(const wxString& helpfile) if( !isconn_1 ) { if( !DoConnection() ) return; } - - if (!m_connection->Execute( helpfile, -1 ) ) + + if (!m_connection->Execute( helpfile, -1 ) ) wxLogError(wxT("wxRemoteHtmlHelpController - Display Failed")); } @@ -335,8 +339,8 @@ void wxRemoteHtmlHelpController::Display(const int id) wxString intstring; intstring.Printf( "--intstring%d", id ); - - if (!m_connection->Execute( intstring, -1 ) ) + + if (!m_connection->Execute( intstring, -1 ) ) wxLogError(wxT("wxRemoteHtmlHelpController - Display Failed")); } @@ -349,7 +353,9 @@ bool wxRemoteHtmlHelpController::AddBook(const wxString& book, bool show_wait_ms if( isconn_1 ) { if (!m_connection->Poke( wxT("--AddBook"), (char*)book.c_str() ) ) + { wxLogError(wxT("wxRemoteHtmlHelpController - AddBook Failed")); + } return false; } @@ -370,7 +376,9 @@ void wxRemoteHtmlHelpController::DisplayIndex() { if( isconn_1 ) { if (!m_connection->Poke( wxT("--DisplayIndex"), wxT("") ) ) + { wxLogError(wxT("wxRemoteHtmlHelpController - DisplayIndex Failed")); + } } } bool wxRemoteHtmlHelpController::KeywordSearch(const wxString& keyword) @@ -391,7 +399,9 @@ void wxRemoteHtmlHelpController::SetTitleFormat(const wxString& format) if( isconn_1 ) { if (!m_connection->Poke( wxT("--SetTitleFormat"), (char*)format.c_str() ) ) + { wxLogError(wxT("wxRemoteHtmlHelpController - SetTitleFormat Failed")); + } } } @@ -399,7 +409,9 @@ void wxRemoteHtmlHelpController::SetTempDir(const wxString& path) { if( isconn_1 ) { if (!m_connection->Poke( wxT("--SetTempDir"), (char*)path.c_str() ) ) + { wxLogError(wxT("wxRemoteHtmlHelpController - SetTempDir Failed")); + } } } diff --git a/utils/ifacecheck/src/ifacecheck.cpp b/utils/ifacecheck/src/ifacecheck.cpp index a04ce71dbc..13aca6a97e 100644 --- a/utils/ifacecheck/src/ifacecheck.cpp +++ b/utils/ifacecheck/src/ifacecheck.cpp @@ -214,7 +214,9 @@ bool IfaceCheckApp::Compare() interfaces.GetCount()); if (!m_strToMatch.IsEmpty()) + { wxLogMessage("Processing only header files matching '%s' expression.", m_strToMatch); + } for (unsigned int i=0; iGetHeader(), &m, &tmp)) + { wxLogMessage("Adjusted attributes of '%s' method", m.GetAsString()); + } proceed = false; break; @@ -397,7 +405,9 @@ int IfaceCheckApp::CompareClasses(const wxClass* iface, const wxClass* api) // TODO: decide which of these overloads is the most "similar" to m // and eventually modify it if (m_modify) + { wxLogWarning("\tmanual fix is required"); + } } else { @@ -574,7 +584,9 @@ bool IfaceCheckApp::FixMethod(const wxString& header, const wxMethod* iface, con return false; if (g_verbose) + { wxLogMessage("\tthe final row offset for following methods is %d lines.", nOffset); + } // update the other method's locations for those methods which belong to the modified header // and are placed _below_ the modified method diff --git a/utils/ifacecheck/src/xmlparser.cpp b/utils/ifacecheck/src/xmlparser.cpp index 1f0fce4847..8f46e23c21 100644 --- a/utils/ifacecheck/src/xmlparser.cpp +++ b/utils/ifacecheck/src/xmlparser.cpp @@ -234,8 +234,10 @@ bool wxArgumentType::operator==(const wxArgumentType& m) const (m.m_strDefaultValueForCmp.IsNumber() && m_strDefaultValueForCmp.StartsWith("wx"))) { if (g_verbose) + { wxLogMessage("Supposing '%s' default value to be the same of '%s'...", m_strDefaultValueForCmp, m.m_strDefaultValueForCmp); + } return true; } @@ -260,8 +262,10 @@ bool wxArgumentType::operator==(const wxArgumentType& m) const } if (g_verbose) + { wxLogMessage("Argument type '%s = %s' has different default value from '%s = %s'", m_strType, m_strDefaultValueForCmp, m.m_strType, m.m_strDefaultValueForCmp); + } return false; } @@ -330,14 +334,18 @@ bool wxMethod::MatchesExceptForAttributes(const wxMethod& m) const GetName() != m.GetName()) { if (g_verbose) + { wxLogMessage("The method '%s' does not match method '%s'; different names/rettype", GetName(), m.GetName()); + } return false; } if (m_args.GetCount()!=m.m_args.GetCount()) { if (g_verbose) + { wxLogMessage("Method '%s' has %d arguments while '%s' has %d arguments", m_strName, m_args.GetCount(), m_strName, m.m_args.GetCount()); + } return false; } @@ -372,7 +380,9 @@ bool wxMethod::operator==(const wxMethod& m) const GetAccessSpecifier() != m.GetAccessSpecifier()) { if (g_verbose) + { wxLogMessage("The method '%s' does not match method '%s'; different attributes", GetName(), m.GetName()); + } return false; } @@ -1009,8 +1019,10 @@ bool wxXmlGccInterface::Parse(const wxString& filename) // they're never used as return/argument types by wxWidgets methods if (g_verbose) + { wxLogWarning("Type node '%s' with ID '%s' does not have name attribute", n, child->GetAttribute("id")); + } types[id] = "TOFIX"; } @@ -1028,8 +1040,10 @@ bool wxXmlGccInterface::Parse(const wxString& filename) while (toResolveTypes.size()>0) { if (g_verbose) + { wxLogMessage("%d types were collected; %d types need yet to be resolved...", types.size(), toResolveTypes.size()); + } for (wxToResolveTypeHashMap::iterator i = toResolveTypes.begin(); i != toResolveTypes.end();) @@ -1468,7 +1482,9 @@ bool wxXmlDoxygenInterface::ParseCompoundDefinition(const wxString& filename) int nodes = 0; if (g_verbose) + { wxLogMessage("Parsing %s...", filename); + } if (!doc.Load(filename)) { wxLogError("can't load %s", filename); @@ -1576,10 +1592,14 @@ bool wxXmlDoxygenInterface::ParseCompoundDefinition(const wxString& filename) // add a new class if (klass.IsOk()) + { m_classes.Add(klass); + } else if (g_verbose) + { wxLogWarning("discarding class '%s' with %d methods...", klass.GetName(), klass.GetMethodCount()); + } } child = child->GetNext(); -- 2.45.2