From 46d16089ec82378f5ad85f94913b5df52b4e4e3a Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Mon, 15 Jun 2020 05:40:45 -0400 Subject: [PATCH] spearmint: OpenGL2: Fix setting (unused) dlightBits If num_dlights is 32, the dlightBits were set to 0. Now it's correctly set to UINT_MAX. However the "tr.refdef.dlightBits" variable isn't actually used for anything in the OpenGL2 renderer. Fixes undefined behavior reported by cppcheck analyzer. --- code/renderergl2/tr_light.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/renderergl2/tr_light.c b/code/renderergl2/tr_light.c index 1c9f69301..3f278d65b 100644 --- a/code/renderergl2/tr_light.c +++ b/code/renderergl2/tr_light.c @@ -72,7 +72,7 @@ void R_CullDlights( void ) { tr.refdef.num_dlights = MAX_DLIGHTS; } - tr.refdef.dlightBits = ( 1 << tr.refdef.num_dlights ) - 1; + tr.refdef.dlightBits = ( 1ULL << tr.refdef.num_dlights ) - 1; #else int i, numDlights, dlightBits; dlight_t *dl;