Build error with VS2005 (juce_Slider.cpp)


#1

Since (I think) commit 964b84c (2012-05-04 23:36)

juce\modules\juce_gui_basics\widgets\juce_slider.cpp(333) : error C2664: 'void juce::ListenerList<ListenerClass>::callChecked<juce::Component::BailOutChecker,juce::Slider*,juce::Slider*__w64 >(const BailOutCheckerType &,void (__thiscall juce::Slider::Listener::* )(P1),Q1 &)' : cannot convert parameter 3 from 'juce::Slider *__w64 ' to 'juce::Slider *__w64 &' 1> with 1> [ 1> ListenerClass=juce::SliderListener, 1> BailOutCheckerType=juce::Component::BailOutChecker, 1> P1=juce::Slider *, 1> Q1=juce::Slider *__w64 1> ] juce\modules\juce_gui_basics\widgets\juce_slider.cpp(341) : error C2664: 'void juce::ListenerList<ListenerClass>::callChecked<juce::Component::BailOutChecker,juce::Slider*,juce::Slider*__w64 >(const BailOutCheckerType &,void (__thiscall juce::Slider::Listener::* )(P1),Q1 &)' : cannot convert parameter 3 from 'juce::Slider *__w64 ' to 'juce::Slider *__w64 &' 1> with 1> [ 1> ListenerClass=juce::SliderListener, 1> BailOutCheckerType=juce::Component::BailOutChecker, 1> P1=juce::Slider *, 1> Q1=juce::Slider *__w64 1> ] juce\modules\juce_gui_basics\widgets\juce_slider.cpp(351) : error C2664: 'void juce::ListenerList<ListenerClass>::callChecked<juce::Component::BailOutChecker,juce::Slider*,juce::Slider*__w64 >(const BailOutCheckerType &,void (__thiscall juce::Slider::Listener::* )(P1),Q1 &)' : cannot convert prameter 3 from 'juce::Slider *__w64 ' to 'juce::Slider *__w64 &' 1> with 1> [ 1> ListenerClass=juce::SliderListener, 1> BailOutCheckerType=juce::Component::BailOutChecker, 1> P1=juce::Slider *, 1> Q1=juce::Slider *__w64 1> ]


#2

No error anymore if tweaking with an intermediate local variable, for instance:

[code] void handleAsyncUpdate()
{
cancelPendingUpdate();

    Component::BailOutChecker checker (&owner);
    juce::Slider*	lOwner = &owner;
    listeners.callChecked (checker, &SliderListener::sliderValueChanged, lOwner);
}[/code]

or more simply with an explicit cast (sorry for the old-style cast):


#3

Agh… Those buggy old compilers :evil:

I don’t even have a copy of VS2005 installed any more… Does it compile if you make changes like this, at line 333:

Slider* s = &owner; listeners.callChecked (checker, &SliderListener::sliderValueChanged, s); // (can't use Slider::Listener due to idiotic VC2005 bug)

?


#4

[quote=“jules”]Does it compile if you make changes like this, at line 333:

Slider* s = &owner; listeners.callChecked (checker, &SliderListener::sliderValueChanged, s); // (can't use Slider::Listener due to idiotic VC2005 bug)

?[/quote]
Yep, it works! Don’t forget to do the same on lines 341 and 351. I have posted (see my edited answer just above yours) a cast-style alternative, if you prefer that.

Thanks for your responsiveness!

[size=70](And if you want to reward me, I’m still interested by a working VST 64bit host on Mac inside of JUCE http://www.rawmaterialsoftware.com/viewtopic.php?f=2&t=9089&p=51767 :wink: but maybe your priority list is really, really huge :-/ )[/size]
All the best

Edit: it compiles well after your change (7a36867), thanks!