Fix narrowing issue reported by gcc-4.7

This commit is contained in:
Norman Feske 2012-11-01 16:49:22 +01:00
parent ee2d45164e
commit d1de48e4a4
2 changed files with 6 additions and 6 deletions

View File

@ -16,11 +16,11 @@
template <typename T> template <typename T>
inline T bswap32(T x) inline T bswap32(T x)
{ {
char v[4] = { unsigned char v[4] = {
(x & 0xff000000) >> 24, (unsigned char)((x & 0xff000000) >> 24),
(x & 0x00ff0000) >> 16, (unsigned char)((x & 0x00ff0000) >> 16),
(x & 0x0000ff00) >> 8, (unsigned char)((x & 0x0000ff00) >> 8),
(x & 0x000000ff) >> 0, (unsigned char)((x & 0x000000ff) >> 0),
}; };
return *(T *)v; return *(T *)v;
} }

View File

@ -12,7 +12,7 @@
*/ */
static struct { static struct {
short w, h, pixels[16][16]; unsigned short w, h, pixels[16][16];
} big_mouse = { } big_mouse = {
16,16, 16,16,
{ {