[MPlayer-cvslog] r33059 - trunk/gui/mplayer/gui_common.c

Ingo Brückl ib at wupperonline.de
Tue Mar 8 22:27:29 CET 2011

Clément Boesch wrote on Tue, 8 Mar 2011 22:08:12 +0100:

> Btw, what's the point of having trbuf static if it was zero'ed?

I don't get it.

It is the return value, so it has to be static, and it is av_strlcat'ed so it
must be erased - but not the whole buffer. (The function is called repeatedly
to update the dynamic labels.)

>> 3. The array indices are unsigned now, and the manual optimization of
>>    having strlen() outside the for loop has been removed in favor of
>>    optimization performed by the compiler.

> I'm not convinced this will ever be optimized. Also, it could mean, from a
> developer point of view, that the length could change during the loop. The
> function being pretty big, it's hard to get sure if it is or not.

That's up to the compiler. ;-)

But seriously, there are so many awkward strlen() (even to check for empty
strings) that I've put their revision on my list. Most of them will go some
time. A string can be run through by a char pointer and a check for 'length
is 0' doesn't need this call either.


More information about the MPlayer-cvslog mailing list