From f0c9019d912060979a3837eb857af6b25d843f31 Mon Sep 17 00:00:00 2001 From: terminx Date: Wed, 8 Jul 2015 03:33:43 +0000 Subject: [PATCH] Move swapptr() to pragmas. DONT_BUILD. git-svn-id: https://svn.eduke32.com/eduke32@5268 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/include/pragmas.h | 7 +++++++ polymer/eduke32/build/src/osd.c | 6 ------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/polymer/eduke32/build/include/pragmas.h b/polymer/eduke32/build/include/pragmas.h index a5d908c1e..fe63c598c 100644 --- a/polymer/eduke32/build/include/pragmas.h +++ b/polymer/eduke32/build/include/pragmas.h @@ -128,6 +128,13 @@ static inline int32_t scale(int32_t eax, int32_t edx, int32_t ecx) return dw(tabledivide64(numer, ecx)); } +static inline void swapptr(void *a, void *b) +{ + intptr_t t = *(intptr_t*) a; + *(intptr_t*) a = *(intptr_t*) b; + *(intptr_t*) b = t; +} + #if defined(__GNUC__) && defined(GEKKO) // GCC Inline Assembler version (PowerPC) diff --git a/polymer/eduke32/build/src/osd.c b/polymer/eduke32/build/src/osd.c index e1a64fab4..f9c30ee89 100644 --- a/polymer/eduke32/build/src/osd.c +++ b/polymer/eduke32/build/src/osd.c @@ -285,12 +285,6 @@ void OSD_GetShadePal(const char *ch, int32_t *shadeptr, int32_t *palptr) // http://blog.frama-c.com/index.php?post/2013/08/24/Function-pointers-in-C // Then again, my GCC just crashed (any kept on crashing until after a reboot!) // when I tried to rewrite this into something different. -static inline void swapptr(void *a, void *b) -{ - intptr_t t = *(intptr_t*)a; - *(intptr_t*)a = *(intptr_t*)b; - *(intptr_t*)b = t; -} static inline void swaposdptrs(void) {