ref: 1054a1f61278d294174d88b1474da4f6e347f8eb
parent: 352c33c9ed18be9d7658e696cc876afbafee9fb6
author: Snesrev <[email protected]>
date: Mon Sep 5 20:32:15 EDT 2022
Put IntMax in types.h
--- a/main.c
+++ b/main.c
@@ -46,8 +46,6 @@
static void HandleGamepadAxisInput(int gamepad_id, int axis, int value);
static void OpenOneGamepad(int i);
-static inline int IntMin(int a, int b) { return a < b ? a : b; }
-static inline int IntMax(int a, int b) { return a > b ? a : b; }
enum {
kRenderWidth = 512,
--- a/types.h
+++ b/types.h
@@ -10,6 +10,7 @@
typedef uint32_t uint32;
typedef int32_t int32;
typedef uint64_t uint64;
+typedef unsigned int uint;
#define arraysize(x) sizeof(x)/sizeof(x[0])
#define sign8(x) ((x) & 0x80)
@@ -20,14 +21,18 @@
#define countof _countof
#define NORETURN __declspec(noreturn)
#define FORCEINLINE __forceinline
+#define NOINLINE __declspec(noinline)
#else
#define countof(a) (sizeof(a)/sizeof(*(a)))
#define NORETURN
#define FORCEINLINE inline
+#define NOINLINE
#endif
-static inline uint16 abs16(uint16 t) { return sign16(t) ? -t : t; }
-static inline uint8 abs8(uint8 t) { return sign8(t) ? -t : t; }
+static FORCEINLINE uint16 abs16(uint16 t) { return sign16(t) ? -t : t; }
+static FORCEINLINE uint8 abs8(uint8 t) { return sign8(t) ? -t : t; }
+static FORCEINLINE int IntMin(int a, int b) { return a < b ? a : b; }
+static FORCEINLINE int IntMax(int a, int b) { return a > b ? a : b; }
#define BYTE(x) (*(uint8*)&(x))
#define HIBYTE(x) (((uint8*)&(x))[1])