shithub: choc

Download patch

ref: aed91e3cc7bc960f570a987c02097bd4202655df
parent: 9815f0f2325ec973c899db766faed87cac49e64d
author: Simon Howard <[email protected]>
date: Sat Nov 25 15:14:27 EST 2006

Use C99 types.

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 759

--- 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.
 
-#ifndef __BYTEBOOL__
-#define __BYTEBOOL__
-// Fixed to use builtin bool type with C++.
+#include <stdint.h>
+
 #ifdef __cplusplus
+
+// Use builtin bool type with C++.
+
 typedef bool boolean;
+
 #else
-typedef enum {false, true} boolean;
+
+typedef enum 
+{
+	false, 
+	true
+} boolean;
+
 #endif
-typedef unsigned char byte;
-#endif
 
+typedef uint8_t byte;
 
 #include <limits.h>
 
-
 #endif
+
--- a/src/m_fixed.c
+++ b/src/m_fixed.c
@@ -43,7 +43,7 @@
 ( 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 @@
     }
     else
     {
-	long long result;
+	int64_t result;
 
-	result = ((long long) a << 16) / b;
+	result = ((int64_t) a << 16) / b;
 
 	return (fixed_t) result;
     }