[csw-maintainers] Error: Ambiguous "?:" expression
Jake Goerzen
jgoerzen at opencsw.org
Tue Mar 9 05:23:51 CET 2010
On Mon, Mar 8, 2010 at 6:12 PM, Roger Håkansson <hson at opencsw.org> wrote:
> On 2010-03-09 00:40, Jake Goerzen wrote:
>>
>> "marked-up_text.cpp", line 222: Error: Ambiguous "?:" expression,
>> second operand of type "surface" and third operand of type "int" can
>> be converted to one another.
>>
>> the relevant part of marked-up_text.cpp (line 222) contains:
>>
>> return draw_text(gui != NULL ? gui->getSurface() : NULL, area,
>> size, colour, txt, x, y, use_tooltips, style);
>>
>>
>> Is there some syntax I can add/modify to this statement that will
>> clear up the ambiguity the compiler is complaining about?
>>
>
> My interpretation is that the problem is that the surface class have
> operators both for converting a surface object to an int as well as
> converting a int to a surface object and that code is not clear on what's
> the desired way.
>
> I had a quick look at the code in your homedir and draw_text is defined in
> font.cpp and takes a surface object as first parameter so you probably want
> to change that line to:
>
> return draw_text((gui != NULL ? gui->getSurface() : (surface)NULL), area,
> size, colour, txt, x, y, use_tooltips, style);
>
> _______________________________________________
Thank you. I made this change and compiling continued for a long time
then stopped...
"./gui/widgets/generator.hpp", line 303: Warning:
gui2::tgenerator_::find_widget Hides the virtual function
gui2::twidget::find_widget(const std::string &, const bool) const in a
virtual base.
"./gui/widgets/generator.hpp", line 303: Warning:
gui2::tgenerator_::find_widget Hides the virtual function
gui2::twidget::find_widget(const std::string &, const bool) in a
virtual base.
"./gui/widgets/generator_private.hpp", line 76: Warning:
gui2::policy::minimum_selection::tone::create_item Hides the virtual
function gui2::tgenerator_::create_item(const int,
boost::intrusive_ptr<const gui2::tbuilder_grid>, const
std::map<std::string,t_string>&, void(*)(gui2::twidget*)) in a virtual
base.
"./gui/widgets/generator_private.hpp", line 76: Warning:
gui2::policy::minimum_selection::tone::create_item Hides the virtual
function gui2::tgenerator_::create_item(const int,
boost::intrusive_ptr<const gui2::tbuilder_grid>, const
std::map<std::string,std::map<std::string,t_string> >&,
void(*)(gui2::twidget*)) in a virtual base.
"./gui/widgets/generator_private.hpp", line 100: Warning:
gui2::policy::minimum_selection::tnone::create_item Hides the virtual
function gui2::tgenerator_::create_item(const int,
boost::intrusive_ptr<const gui2::tbuilder_grid>, const
std::map<std::string,t_string>&, void(*)(gui2::twidget*)) in a virtual
base."./gui/widgets/generator_private.hpp", line 100: Warning:
gui2::policy::minimum_selection::tnone::create_item Hides the virtual
function gui2::tgenerator_::create_item(const int,
boost::intrusive_ptr<const gui2::tbuilder_grid>, const
std::map<std::string,std::map<std::string,t_string> >&,
void(*)(gui2::twidget*)) in a virtual base.
"./gui/widgets/generator_private.hpp", line 131: Warning:
gui2::policy::maximum_selection::tone::select_item Hides the virtual
function gui2::tgenerator_::select_item(const unsigned, const bool) in
a virtual base.
"./gui/widgets/generator_private.hpp", line 141: Warning:
gui2::policy::maximum_selection::tinfinite::select_item Hides the
virtual function gui2::tgenerator_::select_item(const unsigned, const
bool) in a virtual base.
"./gui/widgets/generator_private.hpp", line 173: Error:
"gui2::policy::placement::thorizontal_list::calculate_best_size()
const" is expected to return a value.
"./gui/widgets/generator_private.hpp", line 201: Error:
"gui2::policy::placement::thorizontal_list::find_widget(const
gui2::tpoint&, const bool)" is expected to return a value.
"./gui/widgets/generator_private.hpp", line 205: Error:
"gui2::policy::placement::thorizontal_list::find_widget(const
gui2::tpoint&, const bool) const" is expected to return a value.
"./gui/widgets/generator_private.hpp", line 224: Warning:
gui2::policy::placement::thorizontal_list::create_item Hides the
virtual function gui2::tgenerator_::create_item(const int,
boost::intrusive_ptr<const gui2::tbuilder_grid>, const
std::map<std::string,t_string>&, void(*)(gui2::twidget*)) in a virtual
base.
"./gui/widgets/generator_private.hpp", line 224: Warning:
gui2::policy::placement::thorizontal_list::create_item Hides the
virtual function gui2::tgenerator_::create_item(const int,
boost::intrusive_ptr<const gui2::tbuilder_grid>, const
std::map<std::string,std::map<std::string,t_string> >&,
void(*)(gui2::twidget*)) in a virtual base.
"./gui/widgets/generator_private.hpp", line 284: Warning:
gui2::policy::placement::tvertical_list::create_item Hides the virtual
function gui2::tgenerator_::create_item(const int,
boost::intrusive_ptr<const gui2::tbuilder_grid>, const
std::map<std::string,t_string>&, void(*)(gui2::twidget*)) in a virtual
base.
"./gui/widgets/generator_private.hpp", line 284: Warning:
gui2::policy::placement::tvertical_list::create_item Hides the virtual
function gui2::tgenerator_::create_item(const int,
boost::intrusive_ptr<const gui2::tbuilder_grid>, const
std::map<std::string,std::map<std::string,t_string> >&,
void(*)(gui2::twidget*)) in a virtual base.
"./gui/widgets/generator_private.hpp", line 302: Error:
"gui2::policy::placement::tmatrix::calculate_best_size() const" is
expected to return a value.
"./gui/widgets/generator_private.hpp", line 317: Error:
"gui2::policy::placement::tmatrix::find_widget(const gui2::tpoint&,
const bool)" is expected to return a value.
"./gui/widgets/generator_private.hpp", line 321: Error:
"gui2::policy::placement::tmatrix::find_widget(const gui2::tpoint&,
const bool) const" is expected to return a value.
"./gui/widgets/generator_private.hpp", line 340: Warning:
gui2::policy::placement::tmatrix::create_item Hides the virtual
function gui2::tgenerator_::create_item(const int,
boost::intrusive_ptr<const gui2::tbuilder_grid>, const
std::map<std::string,t_string>&, void(*)(gui2::twidget*)) in a virtual
base.
"./gui/widgets/generator_private.hpp", line 340: Warning:
gui2::policy::placement::tmatrix::create_item Hides the virtual
function gui2::tgenerator_::create_item(const int,
boost::intrusive_ptr<const gui2::tbuilder_grid>, const
std::map<std::string,std::map<std::string,t_string> >&,
void(*)(gui2::twidget*)) in a virtual base.
"./gui/widgets/generator_private.hpp", line 357: Error:
"gui2::policy::placement::tindependant::calculate_best_size() const"
is expected to return a value."./gui/widgets/generator_private.hpp",
line 372: Error:
"gui2::policy::placement::tindependant::find_widget(const
gui2::tpoint&, const bool)" is expected to return a value.
"./gui/widgets/generator_private.hpp", line 376: Error:
"gui2::policy::placement::tindependant::find_widget(const
gui2::tpoint&, const bool) const" is expected to return a value.
"./gui/widgets/generator_private.hpp", line 395: Warning:
gui2::policy::placement::tindependant::create_item Hides the virtual
function gui2::tgenerator_::create_item(const int,
boost::intrusive_ptr<const gui2::tbuilder_grid>, const
std::map<std::string,t_string>&, void(*)(gui2::twidget*)) in a virtual
base.
"./gui/widgets/generator_private.hpp", line 395: Warning:
gui2::policy::placement::tindependant::create_item Hides the virtual
function gui2::tgenerator_::create_item(const int,
boost::intrusive_ptr<const gui2::tbuilder_grid>, const
std::map<std::string,std::map<std::string,t_string> >&,
void(*)(gui2::twidget*)) in a virtual base.
"gui/widgets/generator.cpp", line 95: Warning: grid hides
gui2::tgenerator_::grid.
"gui/widgets/generator.cpp", line 122: Warning: grid hides
gui2::tgenerator_::grid.
"gui/widgets/generator.cpp", line 142: Warning: grid hides
gui2::tgenerator_::grid.
"gui/widgets/generator.cpp", line 159: Warning: grid hides
gui2::tgenerator_::grid.
"gui/widgets/generator.cpp", line 172: Warning: grid hides
gui2::tgenerator_::grid.
"gui/widgets/generator.cpp", line 192: Warning: grid hides
gui2::tgenerator_::grid.
"gui/widgets/generator.cpp", line 253: Warning: grid hides
gui2::tgenerator_::grid.
9 Error(s) and 23 Warning(s) detected.
gmake[4]: *** [gui/widgets/generator.o] Error 9
gmake[4]: Leaving directory
`/home/jgoerzen/mgar/wesnoth/trunk/work/solaris8-sparc/build-isa-sparcv8/wesnoth-1.6.5/src'
gmake[3]: *** [all-recursive] Error 1
gmake[3]: Leaving directory
`/home/jgoerzen/mgar/wesnoth/trunk/work/solaris8-sparc/build-isa-sparcv8/wesnoth-1.6.5'
gmake[2]: *** [all] Error 2
gmake[2]: Leaving directory
`/home/jgoerzen/mgar/wesnoth/trunk/work/solaris8-sparc/build-isa-sparcv8/wesnoth-1.6.5'
gmake[1]: *** [build-work/solaris8-sparc/build-isa-sparcv8/wesnoth-1.6.5/Makefile]
Error 2
gmake[1]: Leaving directory `/home/jgoerzen/mgar/wesnoth/trunk'
gmake: *** [build-isa-sparcv8] Error 2
More information about the maintainers
mailing list