From 37a84d64f1e884aa94086a4ff82c137066f5190f Mon Sep 17 00:00:00 2001 From: Martchus Date: Sun, 24 Sep 2017 19:57:13 +0200 Subject: [PATCH] Fix warnings about use of NULL in startConsole() Can't fix warnings about old-style casts because those macros are defined in windows headers. --- application/commandlineutils.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/commandlineutils.cpp b/application/commandlineutils.cpp index ee2e53d..90ab653 100644 --- a/application/commandlineutils.cpp +++ b/application/commandlineutils.cpp @@ -69,19 +69,19 @@ void startConsole() auto conHandle = _open_osfhandle(stdHandle, _O_TEXT); auto fp = _fdopen(conHandle, "w"); *stdout = *fp; - setvbuf(stdout, NULL, _IONBF, 0); + setvbuf(stdout, nullptr, _IONBF, 0); // redirect stdin stdHandle = reinterpret_cast(GetStdHandle(STD_INPUT_HANDLE)); conHandle = _open_osfhandle(stdHandle, _O_TEXT); fp = _fdopen(conHandle, "r"); *stdin = *fp; - setvbuf(stdin, NULL, _IONBF, 0); + setvbuf(stdin, nullptr, _IONBF, 0); // redirect stderr stdHandle = reinterpret_cast(GetStdHandle(STD_ERROR_HANDLE)); conHandle = _open_osfhandle(stdHandle, _O_TEXT); fp = _fdopen(conHandle, "w"); *stderr = *fp; - setvbuf(stderr, NULL, _IONBF, 0); + setvbuf(stderr, nullptr, _IONBF, 0); #ifdef CPP_UTILITIES_FORCE_UTF8_CODEPAGE // set console to handle UTF-8 IO correctly // however, this doesn't work as intended and is therefore disabled by default