summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Howard2006-11-25 20:14:27 +0000
committerSimon Howard2006-11-25 20:14:27 +0000
commitaed91e3cc7bc960f570a987c02097bd4202655df (patch)
tree5fcacc0d0b18401618270e5a7adb0b142683d99f
parent9815f0f2325ec973c899db766faed87cac49e64d (diff)
downloadchocolate-doom-aed91e3cc7bc960f570a987c02097bd4202655df.tar.gz
chocolate-doom-aed91e3cc7bc960f570a987c02097bd4202655df.tar.bz2
chocolate-doom-aed91e3cc7bc960f570a987c02097bd4202655df.zip
Use C99 types.
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 759
-rw-r--r--src/doomtype.h24
-rw-r--r--src/m_fixed.c6
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 <stdint.h>
-#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 <limits.h>
-
#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;
}