From ada382fa5153dce6e4b8449c9e46c827c170eb95 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Tue, 10 Dec 2019 09:56:29 +0200 Subject: PixelFormats: cast to uin32_t PixelFormat is an uint32_t underneath, so use that type instead of int when casting. Signed-off-by: Tomi Valkeinen --- kms++/inc/kms++/pixelformats.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kms++/inc/kms++/pixelformats.h b/kms++/inc/kms++/pixelformats.h index 15fee7f..784717d 100644 --- a/kms++/inc/kms++/pixelformats.h +++ b/kms++/inc/kms++/pixelformats.h @@ -59,10 +59,10 @@ static inline PixelFormat FourCCToPixelFormat(const std::string& fourcc) static inline std::string PixelFormatToFourCC(PixelFormat f) { - char buf[5] = { (char)(((int)f >> 0) & 0xff), - (char)(((int)f >> 8) & 0xff), - (char)(((int)f >> 16) & 0xff), - (char)(((int)f >> 24) & 0xff), + char buf[5] = { (char)(((uint32_t)f >> 0) & 0xff), + (char)(((uint32_t)f >> 8) & 0xff), + (char)(((uint32_t)f >> 16) & 0xff), + (char)(((uint32_t)f >> 24) & 0xff), 0 }; return std::string(buf); } -- cgit v1.2.3