[Mplayer-cvslog] CVS: main/libmpcodecs vd.c,1.54,1.55

Dominik Mierzejewski dominik at rangers.eu.org
Tue Oct 8 00:10:50 CEST 2002


On Monday, 07 October 2002, Arpi of Ize wrote:
> Update of /cvsroot/mplayer/main/libmpcodecs
> In directory mail:/var/tmp.root/cvs-serv1142
> 
> Modified Files:
> 	vd.c 
> Log Message:
> argh. gcc sux. someone please explain why  float x=0; if(x>0) ...  is true.

It's not gcc that sux, it's float that sux. :-)
You should *NEVER* write code like that. Instead, do it like this:
float x=0.0; if (x>0.0) ...

Although on both gcc 2.nine-sux and 3.1 it works both ways for me.

Oh, and never check if float is zero like this:
if (x==0.0) ...
Always do it like this:
if (abs(x)<0.00001) ...

But you know all that, don't you?

-- 
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-cvslog mailing list