From 51200b3e6bdea0762b2d968a772253a47ccfb685 Mon Sep 17 00:00:00 2001 From: sezero Date: Fri, 24 Nov 2017 20:55:00 +0300 Subject: [PATCH] replace several long casts with intptr_t and include stdint.h for it. --- src/client/refresh/soft/r_rast.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/client/refresh/soft/r_rast.c b/src/client/refresh/soft/r_rast.c index e81deefe..2d2333c0 100644 --- a/src/client/refresh/soft/r_rast.c +++ b/src/client/refresh/soft/r_rast.c @@ -19,6 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // r_rast.c +#include #include #include "r_local.h" @@ -489,7 +490,7 @@ void R_EmitCachedEdge (void) { edge_t *pedge_t; - pedge_t = (edge_t *)((unsigned long)r_edges + r_pedge->cachededgeoffset); + pedge_t = (edge_t *)((uintptr_t)r_edges + r_pedge->cachededgeoffset); if (!pedge_t->surfs[0]) pedge_t->surfs[0] = surface_p - surfaces; @@ -594,9 +595,9 @@ void R_RenderFace (msurface_t *fa, int clipflags) } else { - if ((((unsigned long)edge_p - (unsigned long)r_edges) > + if ((((uintptr_t)edge_p - (uintptr_t)r_edges) > r_pedge->cachededgeoffset) && - (((edge_t *)((unsigned long)r_edges + + (((edge_t *)((uintptr_t)r_edges + r_pedge->cachededgeoffset))->owner == r_pedge)) { R_EmitCachedEdge (); @@ -640,9 +641,9 @@ void R_RenderFace (msurface_t *fa, int clipflags) { // it's cached if the cached edge is valid and is owned // by this medge_t - if ((((unsigned long)edge_p - (unsigned long)r_edges) > + if ((((uintptr_t)edge_p - (uintptr_t)r_edges) > r_pedge->cachededgeoffset) && - (((edge_t *)((unsigned long)r_edges + + (((edge_t *)((uintptr_t)r_edges + r_pedge->cachededgeoffset))->owner == r_pedge)) { R_EmitCachedEdge ();