--- a/lib/Image.cc +++ b/lib/Image.cc @@ -1,3 +1,4 @@ +#include #include #include "Image.hh" --- a/lib/scale.cc +++ b/lib/scale.cc @@ -1,3 +1,4 @@ +#include #include #include --- a/miniescreen/miniescreen.cc +++ b/miniescreen/miniescreen.cc @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -235,7 +236,7 @@ int main (int argc, char* argv[]) *it; it.getRGB (&r, &g, &b); - unsigned int x = + unsigned int v = ((uint32_t)r >> (8-fb_var.red.length)) << fb_var.red.offset | ((uint32_t)g >> (8-fb_var.green.length)) << fb_var.green.offset | ((uint32_t)b >> (8-fb_var.blue.length)) << fb_var.blue.offset; @@ -243,41 +244,41 @@ int main (int argc, char* argv[]) switch (fb_var.bits_per_pixel) { case 32: #if __BYTE_ORDER != __BIG_ENDIAN - dst[0] = (x>>0) & 0xff; - dst[1] = (x>>8) & 0xff; - dst[2] = (x>>16) & 0xff; - dst[3] = (x>>24) & 0xff; + dst[0] = (v>>0) & 0xff; + dst[1] = (v>>8) & 0xff; + dst[2] = (v>>16) & 0xff; + dst[3] = (v>>24) & 0xff; #else - dst[0] = (x>>24) & 0xff; - dst[1] = (x>>16) & 0xff; - dst[2] = (x>>8) & 0xff; - dst[3] = (x>>0) & 0xff; + dst[0] = (v>>24) & 0xff; + dst[1] = (v>>16) & 0xff; + dst[2] = (v>>8) & 0xff; + dst[3] = (v>>0) & 0xff; #endif break; case 24: #if __BYTE_ORDER != __BIG_ENDIAN - dst[0] = (x>>0) & 0xff; - dst[1] = (x>>8) & 0xff; - dst[2] = (x>>16) & 0xff; + dst[0] = (v>>0) & 0xff; + dst[1] = (v>>8) & 0xff; + dst[2] = (v>>16) & 0xff; #else - dst[0] = (x>>16) & 0xff; - dst[1] = (x>>8) & 0xff; - dst[2] = (x>>0) & 0xff; + dst[0] = (v>>16) & 0xff; + dst[1] = (v>>8) & 0xff; + dst[2] = (v>>0) & 0xff; #endif break; case 16: case 15: #if __BYTE_ORDER != __BIG_ENDIAN - dst[0] = (x>>0) & 0xff; - dst[1] = (x>>8) & 0xff; + dst[0] = (v>>0) & 0xff; + dst[1] = (v>>8) & 0xff; #else - dst[0] = (x>>8) & 0xff; - dst[1] = (x>>0) & 0xff; + dst[0] = (v>>8) & 0xff; + dst[1] = (v>>0) & 0xff; #endif break; default: - dst[0] = x & 0xff; + dst[0] = v & 0xff; break; }