From 75eac05e2e5f913f98688897b8b3c78272dd26e0 Mon Sep 17 00:00:00 2001 From: Sergey Alirzaev Date: Wed, 26 Sep 2018 11:41:34 +0300 Subject: [PATCH] source/game/obj/object.h: don't complain about int overflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ./source/game/obj/object.h:19:49: warning: result of β€˜(255 << 26)’ requires 35 bits to represent, but β€˜int’ only has 32 bits [-Wshift-overflow=] const unsigned ObjectTypeMask = (unsigned)(0xFF << ObjectTypeBitOffset); ~~~~~^~~~~~~~~~~~~~~~~~~~~~ --- source/game/obj/object.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/game/obj/object.h b/source/game/obj/object.h index 175e441..b45bc63 100644 --- a/source/game/obj/object.h +++ b/source/game/obj/object.h @@ -16,7 +16,7 @@ #endif const unsigned ObjectTypeBitOffset = 26; -const unsigned ObjectTypeMask = (unsigned)(0xFF << ObjectTypeBitOffset); +const unsigned ObjectTypeMask = 0xFFU << ObjectTypeBitOffset; const unsigned ObjectIDMask = 0xFFFFFFFF >> (32 - ObjectTypeBitOffset); extern unsigned ObjectTypeCount;