[MPlayer-dev-eng] [PATCH] Spring cleanup

D Richard Felker III dalias at aerifal.cx
Mon Apr 21 02:50:05 CEST 2003


On Mon, Apr 21, 2003 at 03:15:01AM +0300, Raindel Shachar wrote:
> I decided to do a little cleanup in mplayer's source, so that gcc will
> produce much less warnings when compiling with -Wall. I attach a patch
> which fixes some of the warnings. More tomorrow.
> 
> Cheers
> Shachar
> 
> P.S. I think that I spotted (and fixed in the patch) few 10l bugs in
> spudec.c: it was checking if an unsigned variable which was just
> calculated is SMALLER than 0 (and if it is, clipping it to 0), what can't
> be. the correct code, IMHO, is to check first if the result will be
> smaller than 0, what can be done faster, and only after that set it to 0,
> or calculate the value needed. I found this in 4 different places, so I
> think it should be counted as 40l ;-)

Hey, the cola is mine... :(

BTW, about changes like this:

-           while (de = readdir(d)) {
+           while ((de = readdir(d)) != NULL) {

Basically that's really ugly. At least leave off the != NULL part
(just use the extra parens), or better yet skip the change entirely.
IMO this warning is very misguided and is targetted as BASIC/PASCAL
programmers; no one who really writes C confuses = and ==.

Rich



More information about the MPlayer-dev-eng mailing list