[MPlayer-dev-eng] [PATCH] loader compiler warnings

Dominik 'Rathann' Mierzejewski dominik at rangers.eu.org
Thu Apr 8 23:16:13 CEST 2004


On Thursday, 08 April 2004 at 19:37, D Richard Felker III wrote:
> On Thu, Apr 08, 2004 at 06:06:55PM +0200, Dominik 'Rathann' Mierzejewski wrote:
> > Problem:
> > if we enable Quicktime codecs, then
> > win32.c:898: warning: no return statement in function returning non-void
> > static HANDLE WINAPI expCreateMutexA(void *pSecAttr,
> >                     char bInitialOwner, const char *name)
> > {
> >     HANDLE mlist = (HANDLE)expCreateEventA(pSecAttr, 0, 0, name);
> > [...]
> > #ifndef QTX 
> >     /* 10l to QTX, if CreateMutex returns a real mutex, WaitForSingleObject 
> >        waits for ever, else it works ;) */
> >     return mlist;
> > #endif 
> > }
> > 
> > Solution:
> > #else 
> >     return (HANDLE)NULL;
> 
> Casting NULL is nonsensical. Just return NULL.

Why? NULL is a pointer. HANDLE isn't, so we get an "incompatible type"
warning. OK, maybe return 0; in that case is better. Still, as I said,
according to Alex we shouldn't return a NULL or 0 here.

-- 
MPlayer RPMs maintainer: http://greysector.rangers.eu.org/mplayer.html
"I am Grey. I stand between the candle and the star. We are Grey.
 We stand between the darkness ... and the light."
        -- Delenn in Grey Council in Babylon 5:"Babylon Squared"




More information about the MPlayer-dev-eng mailing list