summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2019-12-10 09:56:29 +0200
committerTomi Valkeinen <tomi.valkeinen@ti.com>2020-01-29 08:44:45 +0200
commitada382fa5153dce6e4b8449c9e46c827c170eb95 (patch)
treebae38b93a256938f854e9e1b72092ea1ad1d3cef
parentc3e5d3b13f9f074efe9797897ffb6429a2e8c6fe (diff)
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 <tomi.valkeinen@ti.com>
-rw-r--r--kms++/inc/kms++/pixelformats.h8
1 files 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);
}