[MPlayer-dev-eng] [PATCH] Yet another batch of warning fixes :->

Dominik Mierzejewski dominik at rangers.eu.org
Tue Dec 10 12:05:23 CET 2002


On Tuesday, 10 December 2002, Arpi wrote:
> Hi,
> 
> >  typedef unsigned short  WORD;
> > -typedef unsigned int    DWORD;
> > -typedef unsigned int    ULONG;
> > +typedef unsigned long   DWORD;
> > +typedef unsigned long   ULONG;
> >  typedef unsigned char   BYTE;
> 
> ARGH&*!%^#&*%@*&
> 
> it'll break code on 64bit platforms badly

Will it? How about uint32_t then? And avifile's loader has those
defines exactly like in my patch.

> > -		    printf("%.4s ", &c->fcc);
> > +		    printf("%.4d ", c->fcc);
> 
> heh?
> %.4d won't print fourcc but a silly number

Hmmm. Right, sorry, missed this one (although there's another done right).
-		    printf("%.4s ", &c->fcc);
+		    printf("%.4s ", (char*)&c->fcc);

Better?

> 
> > -	*lpFilePart = strrchr(lpFileName, '\\');
> > +	lpFilePart = strrchr(lpFileName, '\\');
> >      else
> > -	*lpFilePart = lpFileName;
> > +	lpFilePart = lpFileName;
> 
> looks bad

But it's not bad. lpFilePart is LPTSTR and that is char *.

> >  #define ADDQUE(xi,xq,in)\
> >    xq[xi]=xq[xi+L]=(*in);\
> > -  xi=(--xi)&(L-1);
> > +  xi=(xi-1)&(L-1);\
> > +  xi--;
> 
> why?

Already explained by others (undefined behaviour).

> >      register int16_t* 	end   = in+ao_plugin_data.len/2;
> > -    while(in < end) *in=(*in++)>>1;
> > +    while(in < end) { *in=(*in)>>1; in++; }
> 
> again, why?

Same here.

> > +    InitializeQTML = (OSErr (*)(long))GetProcAddress(handler,
> > "InitializeQTML");
> 
> WTF is this mess?

It casts the pointer returned by GetProcAddress to an appropriate pointer
to a function, thus silencing "initialization from incompatible pointer
type" warnings.

> > -          uqvq = encoded[pixel_ptr++] + (encoded[pixel_ptr++] << 8);
> > +          uqvq = encoded[pixel_ptr+1] + (encoded[pixel_ptr+2] << 8);
> > +          pixel_ptr += 2;
> 
> i can't understand nor accept such changes

Again, undefined behaviour.

> > -//#include <string.h>      // FIXME: conflicts with fs.h
> > +#include <string.h>      // FIXME: conflicts with fs.h
>                                       ^^^^^^^^^^^^^^^^^^^

Oh, this one is interesting. I couldn't find any fs.h file on my system
and in mplayer sources. WTF is it?

> and so on
> 
> do NOT apply this mess!

Geez, A'rpi. Of course I won't do it over your objections. No need to
scream. :-P

> there are some good points but mostly broken stuff, and we're after -rc1...

Understood.
 
-- 
MPlayer RPMs maintainer: http://www.piorunek.pl/~dominik/linux/pkgs/mplayer/
"The Universe doesn't give you any points for doing things that are easy."
        -- Sheridan to Garibaldi in Babylon 5:"The Geometry of Shadows"



More information about the MPlayer-dev-eng mailing list