mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-23 20:33:05 +00:00
Fix some casting stuff
This commit is contained in:
parent
a8b31be328
commit
6ea37089fa
1 changed files with 6 additions and 6 deletions
12
con.c
12
con.c
|
@ -30,8 +30,8 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define GMQCC_IS_STDOUT(X) ((X) == stdout)
|
#define GMQCC_IS_STDOUT(X) ((FILE*)((void*)X) == stdout)
|
||||||
#define GMQCC_IS_STDERR(X) ((X) == stderr)
|
#define GMQCC_IS_STDERR(X) ((FILE*)((void*)X) == stderr)
|
||||||
#define GMQCC_IS_DEFINE(X) (GMQCC_IS_STDERR(X) || GMQCC_IS_STDOUT(X))
|
#define GMQCC_IS_DEFINE(X) (GMQCC_IS_STDERR(X) || GMQCC_IS_STDOUT(X))
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -271,13 +271,13 @@ void con_reset() {
|
||||||
int con_change(const char *out, const char *err) {
|
int con_change(const char *out, const char *err) {
|
||||||
con_close();
|
con_close();
|
||||||
|
|
||||||
if (GMQCC_IS_DEFINE((FILE*)out)) {
|
if (GMQCC_IS_DEFINE(out)) {
|
||||||
console.handle_out = (((FILE*)out) == stdout) ? stdout : stderr;
|
console.handle_out = GMQCC_IS_STDOUT(out) ? stdout : stderr;
|
||||||
con_enablecolor();
|
con_enablecolor();
|
||||||
} else if (!(console.handle_out = fopen(out, "w"))) return 0;
|
} else if (!(console.handle_out = fopen(out, "w"))) return 0;
|
||||||
|
|
||||||
if (GMQCC_IS_DEFINE((FILE*)err)) {
|
if (GMQCC_IS_DEFINE(err)) {
|
||||||
console.handle_err = (((FILE*)err) == stdout) ? stdout : stderr;
|
console.handle_err = GMQCC_IS_STDOUT(err) ? stdout : stderr;
|
||||||
con_enablecolor();
|
con_enablecolor();
|
||||||
} else if (!(console.handle_err = fopen(err, "w"))) return 0;
|
} else if (!(console.handle_err = fopen(err, "w"))) return 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue