[Xorg-driver-geode] xf86-video-geode: one last compiler warning

Gaetan Nadon memsize at videotron.ca
Sun Dec 25 11:01:13 PST 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 11-12-25 12:48 PM, Martin-Éric Racine wrote:
> for (i = 0; i < 256; i++) {
> + unsigned int val;
> (*red) &= 0xff00;
> (*green) &= 0xff00;
> (*blue) &= 0xff00;
> - unsigned int val = (*(red++) << 8) | *(green++) | (*(blue++) >> 8);
> + val = (*(red++) << 8) | *(green++) | (*(blue++) >> 8);
>
> df_set_video_palette_entry(i, val);
> }
>
>
> Can anybody confirm my assertion or, alternately, provide a better fix?
The fix is correct. The warning is about declaring variables after the
first executable statement. This is not permitted in c89 but is in c99.
The xorg standard is somewhere in between as I understand it. These
warnings help not breaking some older platforms.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk73cvkACgkQubv1WfueyfwZsgCffhwmWfIREuzHhQgH4143/Kwy
epoAoJudAouTbGG1gOrkXwsvirbQhH9w
=RLse
-----END PGP SIGNATURE-----



More information about the Xorg-driver-geode mailing list