replace several long casts with intptr_t and include stdint.h for it.

This commit is contained in:
sezero 2017-11-24 20:55:00 +03:00 committed by Denis Pauk
parent c43e944a3d
commit 51200b3e6b

View file

@ -19,6 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// r_rast.c
#include <stdint.h>
#include <assert.h>
#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 ();