From e0d1fd7f6e88e6554b21785dc8d7d86a8daccbb1 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 29 Oct 2007 12:10:48 +0000 Subject: [PATCH] fix more unused parameters warnings git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49514 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/clipbrd.cpp | 2 +- src/gtk/glcanvas.cpp | 8 +++-- src/gtk/print.cpp | 66 +++++++++++++++++++++++++----------- src/unix/epolldispatcher.cpp | 2 +- 4 files changed, 54 insertions(+), 24 deletions(-) diff --git a/src/gtk/clipbrd.cpp b/src/gtk/clipbrd.cpp index 649b4424d8..3e64f82515 100644 --- a/src/gtk/clipbrd.cpp +++ b/src/gtk/clipbrd.cpp @@ -80,7 +80,7 @@ public: // this method must be called by GTK+ callbacks to indicate that we got the // result for our clipboard operation - static void OnDone(wxClipboard *clipboard) + static void OnDone(wxClipboard * WXUNUSED_UNLESS_DEBUG(clipboard)) { wxASSERT_MSG( clipboard == ms_clipboard, _T("got notification for alien clipboard") ); diff --git a/src/gtk/glcanvas.cpp b/src/gtk/glcanvas.cpp index 0e17b1e8a7..ad811ae0a6 100644 --- a/src/gtk/glcanvas.cpp +++ b/src/gtk/glcanvas.cpp @@ -89,7 +89,9 @@ gtk_glwindow_expose_callback( GtkWidget *WXUNUSED(widget), GdkEventExpose *gdk_e extern "C" { static void -gtk_glcanvas_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxGLCanvas *win ) +gtk_glcanvas_size_callback(GtkWidget *WXUNUSED(widget), + GtkAllocation * WXUNUSED(alloc), + wxGLCanvas *win) { if (!win->m_hasVMT) return; @@ -175,8 +177,10 @@ bool wxGLCanvas::Create(wxWindow *parent, long style, const wxString& name, const int *attribList, - const wxPalette& palette) + const wxPalette& WXUNUSED_UNLESS_DEBUG(palette)) { + wxASSERT_MSG( !palette.IsOk(), _T("palettes not supported") ); + m_exposed = false; m_noExpose = true; m_nativeSizeEvent = true; diff --git a/src/gtk/print.cpp b/src/gtk/print.cpp index 2374a13d87..e9b17367a8 100644 --- a/src/gtk/print.cpp +++ b/src/gtk/print.cpp @@ -136,7 +136,9 @@ bool wxGtkPrintFactory::HasPrintSetupDialog() return false; } -wxDialog *wxGtkPrintFactory::CreatePrintSetupDialog( wxWindow *parent, wxPrintData *data ) +wxDialog * +wxGtkPrintFactory::CreatePrintSetupDialog(wxWindow * WXUNUSED(parent), + wxPrintData * WXUNUSED(data)) { return NULL; } @@ -183,7 +185,7 @@ wxPrintNativeDataBase *wxGtkPrintFactory::CreatePrintNativeData() // Callback functions for Gtk Printings. //---------------------------------------------------------------------------- -// We use it to pass useful objets to gtk printing callback functions. +// We use it to pass useful objects to GTK printing callback functions. struct wxPrinterToGtkData { wxGtkPrinter * printer; @@ -206,20 +208,28 @@ extern "C" data->printer->DrawPage(data->printout, operation, context, page_nr); } - static void gtk_end_print_callback (GtkPrintOperation *operation, GtkPrintContext *context, gpointer user_data) + static void gtk_end_print_callback(GtkPrintOperation * WXUNUSED(operation), + GtkPrintContext * WXUNUSED(context), + gpointer user_data) { wxPrintout *printout = (wxPrintout *) user_data; printout->OnEndPrinting(); } - static gboolean gtk_preview_print_callback (GtkPrintOperation *operation, GtkPrintOperationPreview *preview, GtkPrintContext *context, GtkWindow *parent, gpointer user_data) + static gboolean + gtk_preview_print_callback(GtkPrintOperation * WXUNUSED(operation), + GtkPrintOperationPreview * WXUNUSED(preview), + GtkPrintContext *context, + GtkWindow *parent, + gpointer user_data) { wxPrintout *printout = (wxPrintout *) user_data; printout->SetIsPreview(true); - /* We create a cairo context with 72dpi resolution. This resolution is only used for positionning. */ + /* We create a Cairo context with 72dpi resolution. This resolution is + * only used for positioning. */ cairo_t *cairo = gdk_cairo_create(GTK_WIDGET(parent)->window); gtk_print_context_set_cairo_context(context, cairo, 72, 72); @@ -968,7 +978,10 @@ void wxGtkPrinter::BeginPrint(wxPrintout *printout, GtkPrintOperation *operation gtk_print_operation_set_n_pages(operation, numPages); } -void wxGtkPrinter::DrawPage(wxPrintout *printout, GtkPrintOperation *operation, GtkPrintContext *context, int page_nr) +void wxGtkPrinter::DrawPage(wxPrintout *printout, + GtkPrintOperation *operation, + GtkPrintContext * WXUNUSED(context), + int page_nr) { int fromPage, toPage, minPage, maxPage, startPage, endPage; printout->GetPageInfo(&minPage, &maxPage, &fromPage, &toPage); @@ -1055,7 +1068,7 @@ wxDC* wxGtkPrinter::PrintDialog( wxWindow *parent ) return new wxGtkPrintDC( m_printDialogData.GetPrintData() ); } -bool wxGtkPrinter::Setup( wxWindow *parent ) +bool wxGtkPrinter::Setup( wxWindow * WXUNUSED(parent) ) { // Obsolete, for backward compatibility. return false; @@ -1102,7 +1115,7 @@ wxGtkPrintDC::wxGtkPrintDC( const wxPrintData& data ) m_signX = 1; // default x-axis left to right. m_signY = 1; // default y-axis bottom up -> top down. - // By default the origin of the cairo context is in the upper left + // By default the origin of the Cairo context is in the upper left // corner of the printable area. We need to translate it so that it // is in the upper left corner of the paper (without margins) GtkPageSetup *setup = gtk_print_context_get_page_setup( m_gpc ); @@ -1120,12 +1133,16 @@ wxGtkPrintDC::~wxGtkPrintDC() bool wxGtkPrintDC::IsOk() const { - return (m_gpc != NULL); + return m_gpc != NULL; } -bool wxGtkPrintDC::DoFloodFill(wxCoord x1, wxCoord y1, const wxColour &col, int style ) +bool wxGtkPrintDC::DoFloodFill(wxCoord WXUNUSED(x1), + wxCoord WXUNUSED(y1), + const wxColour& WXUNUSED(col), + int WXUNUSED(style)) { - // We can't access the given coord as a cairo context is scalable, ie a coord doesn't mean anything in this context. + // We can't access the given coord as a Cairo context is scalable, ie a + // coord doesn't mean anything in this context. wxFAIL_MSG(_("not implemented")); return false; } @@ -1226,9 +1243,10 @@ void wxGtkPrintDC::DoGradientFillLinear(const wxRect& rect, const wxColour& init CalcBoundingBox(x+w, y+h); } -bool wxGtkPrintDC::DoGetPixel(wxCoord x1, wxCoord y1, wxColour *col) const +bool wxGtkPrintDC::DoGetPixel(wxCoord WXUNUSED(x1), + wxCoord WXUNUSED(y1), + wxColour * WXUNUSED(col)) const { - // We can't access the given coord as a cairo context is scalable, ie a coord doesn't mean anything in this context. wxFAIL_MSG(_("not implemented")); return false; } @@ -1564,10 +1582,16 @@ void wxGtkPrintDC::DoDrawSpline(const wxPointList *points) } #endif // wxUSE_SPLINES -bool wxGtkPrintDC::DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, - wxDC *source, wxCoord xsrc, wxCoord ysrc, int rop, bool useMask, - wxCoord xsrcMask, wxCoord ysrcMask) +bool wxGtkPrintDC::DoBlit(wxCoord xdest, wxCoord ydest, + wxCoord width, wxCoord height, + wxDC *source, wxCoord xsrc, wxCoord ysrc, + int rop, bool useMask, + wxCoord WXUNUSED_UNLESS_DEBUG(xsrcMask), + wxCoord WXUNUSED_UNLESS_DEBUG(ysrcMask)) { + wxASSERT_MSG( xsrcMask == wxDefaultCoord && ysrcMask == wxDefaultCoord, + wxT("mask coordinates are not supported") ); + wxCHECK_MSG( source, false, wxT("invalid source dc") ); // Blit into a bitmap. @@ -2055,8 +2079,10 @@ void wxGtkPrintDC::SetBackground( const wxBrush& brush ) void wxGtkPrintDC::SetBackgroundMode(int mode) { - if (mode == wxSOLID) m_backgroundMode = wxSOLID; - else m_backgroundMode = wxTRANSPARENT; + if (mode == wxSOLID) + m_backgroundMode = wxSOLID; + else + m_backgroundMode = wxTRANSPARENT; } void wxGtkPrintDC::DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height) @@ -2070,7 +2096,7 @@ void wxGtkPrintDC::DestroyClippingRegion() gs_cairo->cairo_reset_clip(m_cairo); } -bool wxGtkPrintDC::StartDoc(const wxString& message) +bool wxGtkPrintDC::StartDoc(const wxString& WXUNUSED(message)) { return true; } @@ -2198,7 +2224,7 @@ void wxGtkPrintDC::SetPrintData(const wxPrintData& data) m_printData = data; } -void wxGtkPrintDC::SetResolution(int ppi) +void wxGtkPrintDC::SetResolution(int WXUNUSED(ppi)) { // We can't change ppi of the GtkPrintContext. // TODO: should we really support this? diff --git a/src/unix/epolldispatcher.cpp b/src/unix/epolldispatcher.cpp index 92a0bb0617..6f36836f0f 100644 --- a/src/unix/epolldispatcher.cpp +++ b/src/unix/epolldispatcher.cpp @@ -41,7 +41,7 @@ // helper: return EPOLLxxx mask corresponding to the given flags (and also log // debugging messages about it) -static uint32_t GetEpollMask(int flags, int fd) +static uint32_t GetEpollMask(int flags, int WXUNUSED_UNLESS_DEBUG(fd)) { uint32_t ep = 0;