[MPlayer-cvslog] r33217 - trunk/gui/util/bitmap.c

Ingo Brückl ib at wupperonline.de
Tue Apr 5 21:53:56 CEST 2011


Reimar Döffinger wrote on Tue, 5 Apr 2011 18:37:51 +0200:

>> -    unsigned char ext[][6] = { ".png\0", ".PNG\0" };
>> +    unsigned char *ext[] = { "png", "PNG" };

> These are not even remotely equivalent.

The new one isn't equivalent, but adequate. At least I thought so. (You
noticed the change in the format from %s%s to %s.%s which I <shame>forgot
to note</shame>?)

> The first uses 12 bytes,

Ok, that's clear.

> the second between 16 and 24.

Uh...why? An objdump of such a definition gives me: .data 00000008 ext, thus
8 bytes (as expected).

> There are two ok ways of writing it, though the first
> is rather preferable (8 bytes size instead of up to 24):
> static const char ext[][4] = { "png", "PNG" };

I don't mind the [4] nor the const, but I don't understand why this makes a
difference, because that's the sizes anyway.

And what's the point of the "static"? Is ext on the function's stack not ok?

Ingo


More information about the MPlayer-cvslog mailing list