building avifile-0.7-0.7.16

Matthias Benkmann matthias at winterdrache.de
Fri Oct 18 10:51:10 PDT 2002


On Thu, 17 Oct 2002 19:33:09 -0500 Larry Lawrence
<larry at linuxfromscratch.org> wrote:

> Matthias Benkmann wrote:
> 
> > On Thu, 17 Oct 2002 23:01:22 +0200 Dan Osterrath
> > <do3 at mail.inf.tu-dresden.de> wrote:
> > 
> >> -----BEGIN PGP SIGNED MESSAGE-----
> >> Hash: SHA1
> >> 
> >> When trying to compile the latest snapshot of avifile I got an error
> >> with line 2172 in lib/video/renderer.cpp
> > 
> > What error?
> > 
> > MSB
> > 
> renderer.cpp: In member function `virtual avm::IRtConfig*
>    avm::YUVRenderer::GetRtConfig() const':
> renderer.cpp:2172: conditional expression between distinct pointer types
> `
>    avm::XvRtConfig*' and `avm::SDLGRtConfig*' lacks a cast

Yes, this makes sense. ?: is not equivalent to if else, because in ?: the
2nd and 3rd arguments must have the same type or be convertable to the
same type using certain conversions listed in the ANSI C++ standard (see
"5.16 Conditional operator" for the hideously complex details). This set
of conversions does NOT however include conversions of both arguments to a
parent class as would be required here (remember that C++ has multiple
inheritance; there could be several equally good candidates for
conversion, so there's no general way to specify which should be chosen).
If you want to use ?: you have to cast both pointers to a common type like
this:

virtual IRtConfig* GetRtConfig() const { return m_pXvRtConfig ?
static_cast<IRtConfig*>(m_pXvRtConfig) :
static_cast<IRtConfig*>(m_pSdlgRtConfig); }


MSB

-- 
This sentence no verb.

-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe blfs-dev' in the subject header of the message



More information about the blfs-dev mailing list