$OpenBSD: patch-Source_engine_cpp,v 1.2 2019/09/18 13:32:16 bcallah Exp $

clang

Index: Source/engine.cpp
--- Source/engine.cpp.orig
+++ Source/engine.cpp
@@ -264,14 +264,14 @@ void CelDecDatLightTrans(BYTE *pDecodeTo, BYTE *pRLEBy
 	dst = pDecodeTo;
 	tbl = &pLightTbl[light_table_index * 256];
 	w = nWidth;
-	shift = (BYTE)dst & 1;
+	shift = (uintptr_t)dst & 1;
 
 	for (; src != &pRLEBytes[nDataSize]; dst -= BUFFER_WIDTH + w, shift = (shift + 1) & 1) {
 		for (i = w; i;) {
 			width = *src++;
 			if (!(width & 0x80)) {
 				i -= width;
-				if (((BYTE)dst & 1) == shift) {
+				if (((uintptr_t)dst & 1) == shift) {
 					if (!(width & 1)) {
 						goto L_ODD;
 					} else {
@@ -733,7 +733,7 @@ void Cel2DecDatLightTrans(BYTE *pDecodeTo, BYTE *pRLEB
 	dst = pDecodeTo;
 	tbl = &pLightTbl[light_table_index * 256];
 	w = nWidth;
-	shift = (BYTE)dst & 1;
+	shift = (uintptr_t)dst & 1;
 
 	for (; src != &pRLEBytes[nDataSize]; dst -= BUFFER_WIDTH + w, shift = (shift + 1) & 1) {
 		for (i = w; i;) {
@@ -741,7 +741,7 @@ void Cel2DecDatLightTrans(BYTE *pDecodeTo, BYTE *pRLEB
 			if (!(width & 0x80)) {
 				i -= width;
 				if (dst < gpBufEnd) {
-					if (((BYTE)dst & 1) == shift) {
+					if (((uintptr_t)dst & 1) == shift) {
 						if (!(width & 1)) {
 							goto L_ODD;
 						} else {
