From 2bc6e50eded2a14099655ce0b4c7df582b87c93a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 22 Nov 2019 00:53:45 +0100 Subject: [PATCH] Wrap variable initializations after '=' consistently Replace a few occurrences of type var = value; with type var = value; which is used much more widely in wx sources for consistency. Also get rid of a couple of such lines, when it could be done easily. No real changes. --- src/common/ctrlsub.cpp | 4 ++-- src/common/image.cpp | 4 ++-- src/common/imagpng.cpp | 7 +++---- src/common/imagtiff.cpp | 4 ++-- src/generic/colrdlgg.cpp | 4 ++-- src/generic/progdlgg.cpp | 4 ++-- src/gtk1/toolbar.cpp | 4 ++-- src/msw/app.cpp | 4 ++-- src/msw/filedlg.cpp | 8 ++++---- 9 files changed, 21 insertions(+), 22 deletions(-) diff --git a/src/common/ctrlsub.cpp b/src/common/ctrlsub.cpp index d9ba02cd4c..03435b7056 100644 --- a/src/common/ctrlsub.cpp +++ b/src/common/ctrlsub.cpp @@ -168,8 +168,8 @@ void wxItemContainer::SetClientObject(unsigned int n, wxClientData *data) if ( HasClientObjectData() ) { - wxClientData * clientDataOld - = static_cast(DoGetItemClientData(n)); + wxClientData * clientDataOld = + static_cast(DoGetItemClientData(n)); if ( clientDataOld ) delete clientDataOld; } diff --git a/src/common/image.cpp b/src/common/image.cpp index 3ca0f640b9..2bf29a0864 100644 --- a/src/common/image.cpp +++ b/src/common/image.cpp @@ -1317,8 +1317,8 @@ wxImage wxImage::Rotate90( bool clockwise ) const for (long j = 0; j < height; j++) { - const unsigned char *source_data - = M_IMGDATA->m_data + (j*width + ii)*3; + const unsigned char *source_data = + M_IMGDATA->m_data + (j*width + ii)*3; for (long i = ii; i < next_ii; i++) { diff --git a/src/common/imagpng.cpp b/src/common/imagpng.cpp index cfd5e08d10..5a68dabbcf 100644 --- a/src/common/imagpng.cpp +++ b/src/common/imagpng.cpp @@ -544,10 +544,9 @@ bool wxPNGHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbos const int iHeight = image->GetHeight(); const int iWidth = image->GetWidth(); - const bool bHasPngFormatOption - = image->HasOption(wxIMAGE_OPTION_PNG_FORMAT); + const bool hasPngFormatOption = image->HasOption(wxIMAGE_OPTION_PNG_FORMAT); - int iColorType = bHasPngFormatOption + int iColorType = hasPngFormatOption ? image->GetOptionInt(wxIMAGE_OPTION_PNG_FORMAT) : wxPNG_TYPE_COLOUR; @@ -556,7 +555,7 @@ bool wxPNGHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbos bool bUsePalette = iColorType == wxPNG_TYPE_PALETTE #if wxUSE_PALETTE - || (!bHasPngFormatOption && image->HasPalette() ) + || (!hasPngFormatOption && image->HasPalette() ) #endif ; diff --git a/src/common/imagtiff.cpp b/src/common/imagtiff.cpp index 081b2a58bd..830ad691be 100644 --- a/src/common/imagtiff.cpp +++ b/src/common/imagtiff.cpp @@ -804,8 +804,8 @@ bool wxTIFFHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbo if (hasAlpha) { value = image->GetAlpha(column, row); - buf[column*bytesPerPixel+1] - = minIsWhite ? 255 - value : value; + buf[column*bytesPerPixel+1] = minIsWhite ? 255 - value + : value; } } } diff --git a/src/generic/colrdlgg.cpp b/src/generic/colrdlgg.cpp index 3da7c49c67..3c3919c40d 100644 --- a/src/generic/colrdlgg.cpp +++ b/src/generic/colrdlgg.cpp @@ -332,8 +332,8 @@ void wxGenericColourDialog::CreateWidgets() const wxSizerFlags sliderLabelFlags = wxSizerFlags().Right().Border(); const wxSizerFlags onesliderFlags = wxSizerFlags().CenterHorizontal(); - const wxSizerFlags sliderFlags - = wxSizerFlags().CentreVertical().DoubleBorder(); + const wxSizerFlags sliderFlags = + wxSizerFlags().CentreVertical().DoubleBorder(); wxBoxSizer *redSliderSizer = new wxBoxSizer(wxVERTICAL); redSliderSizer->Add(new wxStaticText(this, wxID_ANY, _("Red:")), sliderLabelFlags); diff --git a/src/generic/progdlgg.cpp b/src/generic/progdlgg.cpp index 25b3b05acf..c2686212d2 100644 --- a/src/generic/progdlgg.cpp +++ b/src/generic/progdlgg.cpp @@ -244,8 +244,8 @@ bool wxGenericProgressDialog::Create( const wxString& title, const int borderFlags = wxALL; - wxSizerFlags sizerFlags - = wxSizerFlags().Border(borderFlags, LAYOUT_MARGIN); + wxSizerFlags sizerFlags = + wxSizerFlags().Border(borderFlags, LAYOUT_MARGIN); if ( HasPDFlag(wxPD_CAN_SKIP) ) { diff --git a/src/gtk1/toolbar.cpp b/src/gtk1/toolbar.cpp index 1324cdda80..f7bc1d9add 100644 --- a/src/gtk1/toolbar.cpp +++ b/src/gtk1/toolbar.cpp @@ -393,8 +393,8 @@ bool wxToolBar::DoInsertTool(size_t pos, wxToolBarToolBase *toolBase) if ( tool->IsRadio() ) { - wxToolBarToolsList::compatibility_iterator node - = wxToolBarToolsList::compatibility_iterator(); + wxToolBarToolsList::compatibility_iterator node = + wxToolBarToolsList::compatibility_iterator(); if ( pos ) node = m_tools.Item(pos - 1); diff --git a/src/msw/app.cpp b/src/msw/app.cpp index d6af9e833c..027a075fd0 100644 --- a/src/msw/app.cpp +++ b/src/msw/app.cpp @@ -794,8 +794,8 @@ void wxApp::MSWProcessPendingEventsIfNeeded() { // The cast below is safe as wxEventLoop derives from wxMSWEventLoopBase in // both console and GUI applications. - wxMSWEventLoopBase * const evtLoop - = static_cast(wxEventLoop::GetActive()); + wxMSWEventLoopBase * const evtLoop = + static_cast(wxEventLoop::GetActive()); if ( evtLoop && evtLoop->MSWIsWakeUpRequested() ) ProcessPendingEvents(); } diff --git a/src/msw/filedlg.cpp b/src/msw/filedlg.cpp index 737b001439..6cf4c84151 100644 --- a/src/msw/filedlg.cpp +++ b/src/msw/filedlg.cpp @@ -83,11 +83,11 @@ namespace typedef BOOL (WINAPI *GetProcessUserModeExceptionPolicy_t)(LPDWORD); typedef BOOL (WINAPI *SetProcessUserModeExceptionPolicy_t)(DWORD); -GetProcessUserModeExceptionPolicy_t gs_pfnGetProcessUserModeExceptionPolicy - = (GetProcessUserModeExceptionPolicy_t) -1; +GetProcessUserModeExceptionPolicy_t gs_pfnGetProcessUserModeExceptionPolicy = + (GetProcessUserModeExceptionPolicy_t) -1; -SetProcessUserModeExceptionPolicy_t gs_pfnSetProcessUserModeExceptionPolicy - = (SetProcessUserModeExceptionPolicy_t) -1; +SetProcessUserModeExceptionPolicy_t gs_pfnSetProcessUserModeExceptionPolicy = + (SetProcessUserModeExceptionPolicy_t) -1; DWORD gs_oldExceptionPolicyFlags = 0;