[MPlayer-dev-eng] [PATCH] trivial warning fixes

Shachar Raindel shacharr at gmail.com
Sat Jul 30 10:55:06 CEST 2005


On 7/30/05, Sycotic Smith <sycotic at linuxmail.org> wrote:
> << warningfix2.diff >>
> << warningfix5.diff >>
> 
> In regards to these patches, shouldn't the fix be to change the "%.4s" to "%.4d" instead? Isn't it proper to look for an int if you want to use an int? Call me old-fashoined, but this is how I would be doing it in my text-based muds if I were getting that error...
> 
> If I'm not understanding this correctly, just send this message to /dev/null.
> 
> i.e.:
> -       mp_msg(MSGT_DEMUX,MSGL_DBG2,"lschunks %.4s  %d\n",&id,(int)len);
> +       mp_msg(MSGT_DEMUX,MSGL_DBG2,"lschunks %.4s  %d\n",(char*)&id,(int)len);
> 
> would instead be
> +       mp_msg(MSGT_DEMUX,MSGL_DBG2,"lschunks %.4d  %d\n",&id,(int)len);
> 
> /S. Smith
> PS. Yes, I do not know as much about c as many of you, but IMHO if you want one thing, it's easier to look for that type than typecast something else to it...
> 

Which of the following is more readable as a representation for FOURCC:
XVID or 1145656920 (which can also be 1482049860, if you are running
on big-endian machine)?

This is why the correct fix here is to typecast &id to (char*).

    Shachar




More information about the MPlayer-dev-eng mailing list