From 522f6cfd01566896891204670ec32d12b1371f74 Mon Sep 17 00:00:00 2001 From: Sandu Liviu Catalin Date: Sat, 2 Apr 2016 12:33:24 +0300 Subject: [PATCH] Remove legacy casting when packing colors. --- source/SqBase.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/SqBase.hpp b/source/SqBase.hpp index 8e3b40c4..c050d2c0 100644 --- a/source/SqBase.hpp +++ b/source/SqBase.hpp @@ -689,12 +689,12 @@ enum CmdError * COLOR PACKING */ -#define SQMOD_PACK_RGB(r, g, b) (Uint32)(r << 16 | g << 8 | b) -#define SQMOD_PACK_RGBA(r, g, b, a) (Uint32)(r << 24 | g << 16 | b << 8 | a) -#define SQMOD_PACK_ARGB(a, r, g, b) (Uint32)(a << 24 | r << 16 | g << 8 | b) +#define SQMOD_PACK_RGB(r, g, b) static_cast< Uint32 >(r << 16 | g << 8 | b) +#define SQMOD_PACK_RGBA(r, g, b, a) static_cast< Uint32 >(r << 24 | g << 16 | b << 8 | a) +#define SQMOD_PACK_ARGB(a, r, g, b) static_cast< Uint32 >(a << 24 | r << 16 | g << 8 | b) -#define SQMOD_PACK_RGB_TO_RGBA(r, g, b) (Uint32)(r << 24 | g << 16 | b << 8 | 0) -#define SQMOD_PACK_RGB_TO_ARGB(r, g, b) (Uint32)(0 << 24 | r << 16 | g << 8 | b) +#define SQMOD_PACK_RGB_TO_RGBA(r, g, b) static_cast< Uint32 >(r << 24 | g << 16 | b << 8 | 0) +#define SQMOD_PACK_RGB_TO_ARGB(r, g, b) static_cast< Uint32 >(0 << 24 | r << 16 | g << 8 | b) /* ------------------------------------------------------------------------------------------------ * GENERAL RESPONSES