pcsx2: remove template and pointer on overload function from wxGuiTools

Fixed clang build.

Note from Gregory:
C++ requests that at least 1 parameters is a class, an enumeration, or a
reference to those objects. Probably to avoid to screw basic type operation.
For example: *p += 4;

The realy buggy code was this one because T could be an int!
template T
f(*ptr, T)

To avoid any issue in the future the Team decide to drop all overload that use pointers.
This commit is contained in:
Forrest McDonald 2014-07-15 19:47:51 -07:00 committed by Gregory Hainaut
parent da93a960af
commit 81458912f9
5 changed files with 14 additions and 54 deletions

View File

@ -68,9 +68,7 @@ protected:
void OnSubtextClicked( wxCommandEvent& evt );
};
extern void operator+=( wxSizer& target, pxCheckBox* src );
extern void operator+=( wxSizer& target, pxCheckBox& src );
extern void operator+=( wxSizer* target, pxCheckBox& src );
template<>
inline void operator+=( wxSizer& target, const pxWindowAndFlags<pxCheckBox>& src )
@ -78,8 +76,3 @@ inline void operator+=( wxSizer& target, const pxWindowAndFlags<pxCheckBox>& src
target.Add( src.window, src.flags );
}
template<>
inline void operator+=( wxSizer* target, const pxWindowAndFlags<pxCheckBox>& src )
{
target->Add( src.window, src.flags );
}

View File

@ -115,9 +115,7 @@ protected:
void SetPaddingDefaults();
};
extern void operator+=( wxSizer& target, pxStaticText* src );
extern void operator+=( wxSizer& target, pxStaticText& src );
extern void operator+=( wxSizer* target, pxStaticText& src );
template<>
inline void operator+=( wxSizer& target, const pxWindowAndFlags<pxStaticText>& src )
@ -125,8 +123,3 @@ inline void operator+=( wxSizer& target, const pxWindowAndFlags<pxStaticText>& s
target.Add( src.window, src.flags );
}
template<>
inline void operator+=( wxSizer* target, const pxWindowAndFlags<pxStaticText>& src )
{
target->Add( src.window, src.flags );
}

View File

@ -270,32 +270,6 @@ void operator+=( wxSizer& target, const pxWindowAndFlags<WinType>& src )
target.Add( src.window, src.flags );
}
// ----------------------------------------------------------------------------
// Pointer Versions! (note that C++ requires one of the two operator params be a
// "proper" object type (non-pointer), so that's why some of these are missing.
template< typename WinType >
void operator+=( wxWindow* target, WinType& src )
{
if( !pxAssert( target != NULL ) ) return;
if( !pxAssert( target->GetSizer() != NULL ) ) return;
*target->GetSizer() += src;
}
template< typename WinType >
void operator+=( wxWindow* target, const pxWindowAndFlags<WinType>& src )
{
if( !pxAssert( target != NULL ) ) return;
if( !pxAssert( target->GetSizer() != NULL ) ) return;
*target->GetSizer() += src;
}
template< typename WinType >
void operator+=( wxSizer* target, const pxWindowAndFlags<WinType>& src )
{
if( !pxAssert( target != NULL ) ) return;
target->Add( src.window, src.flags );
}
BEGIN_DECLARE_EVENT_TYPES()

View File

@ -21,8 +21,8 @@ CheckedStaticBox::CheckedStaticBox( wxWindow* parent, int orientation, const wxS
, ThisSizer( *new wxStaticBoxSizer( orientation, this ) )
, ThisToggle( *new wxCheckBox( this, wxID_ANY, title, wxPoint( 8, 0 ) ) )
{
this += ThisToggle;
this += ThisSizer | pxExpand;
*this += ThisToggle;
*this += ThisSizer | pxExpand;
// Ensure that the right-side of the static group box isn't too cozy:
SetMinWidth( ThisToggle.GetSize().GetWidth() + 32 );

View File

@ -173,7 +173,7 @@ Dialogs::BaseConfigurationDialog::BaseConfigurationDialog( wxWindow* parent, con
void Dialogs::BaseConfigurationDialog::AddListbook( wxSizer* sizer )
{
if( !sizer ) sizer = GetSizer();
sizer += m_listbook | pxExpand.Border( wxLEFT | wxRIGHT, 2 );
*sizer += m_listbook | pxExpand.Border( wxLEFT | wxRIGHT, 2 );
}
void Dialogs::BaseConfigurationDialog::CreateListbook( wxImageList& bookicons )