From c4c09963ae0f1113dacb58aa68f7c475bc8aeff0 Mon Sep 17 00:00:00 2001 From: Kp Date: Fri, 22 May 2020 02:40:26 +0000 Subject: [PATCH] Use constexpr uint8_t for TRANSPARENCY_COLOR This encourages std::fill_n to become memset. When TRANSPARENCY_COLOR is `#define`'d to 255, it is an integer literal of type `int`. --- common/include/fwd-gr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/include/fwd-gr.h b/common/include/fwd-gr.h index 4b5dfac5a..9ce9295c6 100644 --- a/common/include/fwd-gr.h +++ b/common/include/fwd-gr.h @@ -31,7 +31,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #include "u_mem.h" // some defines for transparency and blending -#define TRANSPARENCY_COLOR 255 // palette entry of transparency color -- 255 on the PC +constexpr uint8_t TRANSPARENCY_COLOR = 255; // palette entry of transparency color -- 255 on the PC #define GR_FADE_LEVELS 34u #define GR_FADE_OFF GR_FADE_LEVELS // yes, max means OFF - don't screw that up enum gr_blend {