From f9ead4ef834babffd4f2b2b535190d2d1990db11 Mon Sep 17 00:00:00 2001 From: "Nicholas \"LB\" Braden" Date: Wed, 2 Mar 2016 12:50:25 -0600 Subject: [PATCH] Fix 'zero as null pointer constant' warning Scanning dependencies of target MagnumWindowlessWglApplication [ 30%] Building CXX object src/Magnum/Platform/CMakeFiles/MagnumWindowlessWglApplication.dir/WindowlessWglApplication.cpp.obj C:\Users\LB\Code\Magnum\build\Magnum-prefix\src\Magnum\src\Magnum\Platform\WindowlessWglApplication.cpp: In member function 'bool Magnum::Platform::WindowlessWglApplication::tryCreateContext(const Magnum::Platform::WindowlessWglApplication::Configuration&)': C:\Users\LB\Code\Magnum\build\Magnum-prefix\src\Magnum\src\Magnum\Platform\WindowlessWglApplication.cpp:124:81: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant] _renderingContext = wglCreateContextAttribsARB(_deviceContext, 0, attributes); ^ [ 30%] Linking CXX static library libMagnumWindowlessWglApplication.a [ 30%] Built target MagnumWindowlessWglApplication --- src/Magnum/Platform/WindowlessWglApplication.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magnum/Platform/WindowlessWglApplication.cpp b/src/Magnum/Platform/WindowlessWglApplication.cpp index e2b99aa62..72597d12d 100644 --- a/src/Magnum/Platform/WindowlessWglApplication.cpp +++ b/src/Magnum/Platform/WindowlessWglApplication.cpp @@ -121,7 +121,7 @@ bool WindowlessWglApplication::tryCreateContext(const Configuration& configurati with it */ typedef HGLRC(WINAPI*PFNWGLCREATECONTEXTATTRIBSARBPROC)(HDC, HGLRC, const int*); const PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB = reinterpret_cast( wglGetProcAddress(reinterpret_cast("wglCreateContextAttribsARB"))); - _renderingContext = wglCreateContextAttribsARB(_deviceContext, 0, attributes); + _renderingContext = wglCreateContextAttribsARB(_deviceContext, nullptr, attributes); /* Delete the temporary context */ wglMakeCurrent(_deviceContext, nullptr);