From a08e239e2842df5b152b16e46ecd653c52402f41 Mon Sep 17 00:00:00 2001 From: dhewg Date: Fri, 9 Dec 2011 20:49:12 +0100 Subject: [PATCH] Fix -Winvalid-offsetof warnings --- idlib/Heap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/idlib/Heap.h b/idlib/Heap.h index f02d3b5..f7bda34 100644 --- a/idlib/Heap.h +++ b/idlib/Heap.h @@ -214,7 +214,7 @@ type *idBlockAlloc::Alloc( void ) { template void idBlockAlloc::Free( type *t ) { - element_t *element = (element_t *)( ( (unsigned char *) t ) - ( (int) &((element_t *)0)->t ) ); + element_t *element = (element_t *)( intptr_t(t) - sizeof(intptr_t) ); element->next = free; free = element; active--;