From aed91e3cc7bc960f570a987c02097bd4202655df Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sat, 25 Nov 2006 20:14:27 +0000 Subject: Use C99 types. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 759 --- src/doomtype.h | 24 +++++++++++++++++------- src/m_fixed.c | 6 +++--- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/doomtype.h b/src/doomtype.h index b330eb9a..2bd67415 100644 --- a/src/doomtype.h +++ b/src/doomtype.h @@ -29,20 +29,30 @@ #ifndef __DOOMTYPE__ #define __DOOMTYPE__ +// C99 integer types; with gcc we just use this. Other compilers +// should add conditional statements that define the C99 types. + +#include -#ifndef __BYTEBOOL__ -#define __BYTEBOOL__ -// Fixed to use builtin bool type with C++. #ifdef __cplusplus + +// Use builtin bool type with C++. + typedef bool boolean; + #else -typedef enum {false, true} boolean; -#endif -typedef unsigned char byte; + +typedef enum +{ + false, + true +} boolean; + #endif +typedef uint8_t byte; #include - #endif + diff --git a/src/m_fixed.c b/src/m_fixed.c index 5e3050bc..ba76b36c 100644 --- a/src/m_fixed.c +++ b/src/m_fixed.c @@ -43,7 +43,7 @@ FixedMul ( fixed_t a, fixed_t b ) { - return ((long long) a * (long long) b) >> FRACBITS; + return ((int64_t) a * (int64_t) b) >> FRACBITS; } @@ -60,9 +60,9 @@ fixed_t FixedDiv(fixed_t a, fixed_t b) } else { - long long result; + int64_t result; - result = ((long long) a << 16) / b; + result = ((int64_t) a << 16) / b; return (fixed_t) result; } -- cgit v1.2.3