From 36b32cad0f508244d4add8080789645d28a1df18 Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Mon, 28 Dec 2020 01:20:36 +0000 Subject: [PATCH] Fix 2 instances of void* pointer arithmetic Partially reverts https://github.com/FWGS/xash3d-fwgs/commit/341e440c0749db1817061f955e6710a154ee22df Let's see if this fixes the windows build on travis --- ref_gl/gl_dbghulls.c | 2 +- ref_gl/gl_sprite.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ref_gl/gl_dbghulls.c b/ref_gl/gl_dbghulls.c index d457bfb3..d21cfae5 100644 --- a/ref_gl/gl_dbghulls.c +++ b/ref_gl/gl_dbghulls.c @@ -17,7 +17,7 @@ GNU General Public License for more details. #include "mod_local.h" #define list_entry( ptr, type, member ) \ - ((type *)((void *)(ptr) - (size_t)(&((type *)0)->member))) + ((type *)((char *)(ptr) - (size_t)(&((type *)0)->member))) // iterate over each entry in the list #define list_for_each_entry( pos, head, member ) \ diff --git a/ref_gl/gl_sprite.c b/ref_gl/gl_sprite.c index 10596e9d..e6564740 100644 --- a/ref_gl/gl_sprite.c +++ b/ref_gl/gl_sprite.c @@ -87,7 +87,7 @@ static const dframetype_t *R_SpriteLoadFrame( model_t *mod, const void *pin, msp pspriteframe->gl_texturenum = gl_texturenum; *ppframe = pspriteframe; - return ( const dframetype_t* )(( const void* )pin + sizeof( dspriteframe_t ) + pinframe.width * pinframe.height * bytes ); + return ( const dframetype_t* )(( const byte* )pin + sizeof( dspriteframe_t ) + pinframe.width * pinframe.height * bytes ); } /*