From 6ea37089fa61f33fd65e02a30c5ba0eec1ed3ed9 Mon Sep 17 00:00:00 2001 From: Dale Weiler Date: Thu, 22 Nov 2012 20:16:34 +0000 Subject: [PATCH] Fix some casting stuff --- con.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/con.c b/con.c index a46a750..a784ab7 100644 --- a/con.c +++ b/con.c @@ -30,8 +30,8 @@ #include #endif -#define GMQCC_IS_STDOUT(X) ((X) == stdout) -#define GMQCC_IS_STDERR(X) ((X) == stderr) +#define GMQCC_IS_STDOUT(X) ((FILE*)((void*)X) == stdout) +#define GMQCC_IS_STDERR(X) ((FILE*)((void*)X) == stderr) #define GMQCC_IS_DEFINE(X) (GMQCC_IS_STDERR(X) || GMQCC_IS_STDOUT(X)) typedef struct { @@ -271,13 +271,13 @@ void con_reset() { int con_change(const char *out, const char *err) { con_close(); - if (GMQCC_IS_DEFINE((FILE*)out)) { - console.handle_out = (((FILE*)out) == stdout) ? stdout : stderr; + if (GMQCC_IS_DEFINE(out)) { + console.handle_out = GMQCC_IS_STDOUT(out) ? stdout : stderr; con_enablecolor(); } else if (!(console.handle_out = fopen(out, "w"))) return 0; - if (GMQCC_IS_DEFINE((FILE*)err)) { - console.handle_err = (((FILE*)err) == stdout) ? stdout : stderr; + if (GMQCC_IS_DEFINE(err)) { + console.handle_err = GMQCC_IS_STDOUT(err) ? stdout : stderr; con_enablecolor(); } else if (!(console.handle_err = fopen(err, "w"))) return 0;