diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5f4432c2..45971ce2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -95,7 +95,7 @@ default: - - | # apt_common echo -e "\e[0Ksection_start:`date +%s`:apt_common[collapsed=true]\r\e[0KInstalling common packages" - - apt-get install make git ccache + - apt-get install make git ccache libsimde-dev - | # apt_common echo -e "\e[0Ksection_end:`date +%s`:apt_common\r\e[0K" @@ -219,6 +219,7 @@ i386: variables: CC: ccache i686-linux-gnu-gcc CXX: ccache i686-linux-gnu-g++ + CPPFLAGS: -msse2 -U NO_SSE artifacts: paths: @@ -343,6 +344,8 @@ win32: variables: CC: ccache i686-w64-mingw32-gcc-posix CXX: ccache i686-w64-mingw32-g++-posix + CFLAGS: -Wall -Wextra -Werror + CXXFLAGS: -Wall -Wextra -Werror -Wno-unused-parameter artifacts: paths: @@ -376,6 +379,8 @@ win64: variables: CC: ccache x86_64-w64-mingw32-gcc-posix CXX: ccache x86_64-w64-mingw32-g++-posix + CFLAGS: -Wall -Wextra -Werror + CXXFLAGS: -Wall -Wextra -Werror -Wno-unused-parameter artifacts: paths: diff --git a/Makefile b/Makefile index 0af6d3ae..f7543c5f 100644 --- a/Makefile +++ b/Makefile @@ -23,6 +23,10 @@ CPPFLAGS_ := $(INC_FLAGS) -MMD -MP CFLAGS_ = -O2 -g3 -fPIC +ifdef MINGW +CFLAGS_ += -msse2 +endif + CXXFLAGS_ = -std=c++14 $(CFLAGS_) ifdef MINGW diff --git a/Source/Native/OpenGL/OpenGLContext.cpp b/Source/Native/OpenGL/OpenGLContext.cpp index 4e2d7ec9..5781dc2d 100644 --- a/Source/Native/OpenGL/OpenGLContext.cpp +++ b/Source/Native/OpenGL/OpenGLContext.cpp @@ -178,14 +178,14 @@ void OpenGLContext::SwapBuffers() int OpenGLContext::GetWidth() const { - RECT box = { 0 }; + RECT box = { 0, 0, 0, 0 }; GetClientRect(window, &box); return box.right - box.left; } int OpenGLContext::GetHeight() const { - RECT box = { 0 }; + RECT box = { 0, 0, 0, 0 }; GetClientRect(window, &box); return box.bottom - box.top; } @@ -217,10 +217,10 @@ OpenGLContext::CreateFunctions OpenGLContext::GetCreateFunctions(HWND window) { wglMakeCurrent(queryDC, queryContext); - functions.wglCreateContextAttribsARB = (ptr_wglCreateContextAttribsARB)wglGetProcAddress("wglCreateContextAttribsARB"); - functions.wglGetPixelFormatAttribivEXT = (ptr_wglGetPixelFormatAttribivEXT)wglGetProcAddress("wglGetPixelFormatAttribivEXT"); - functions.wglGetPixelFormatAttribfvEXT = (ptr_wglGetPixelFormatAttribfvEXT)wglGetProcAddress("wglGetPixelFormatAttribfvEXT"); - functions.wglChoosePixelFormatEXT = (ptr_wglChoosePixelFormatEXT)wglGetProcAddress("wglChoosePixelFormatEXT"); + functions.wglCreateContextAttribsARB = (ptr_wglCreateContextAttribsARB)(void*)wglGetProcAddress("wglCreateContextAttribsARB"); + functions.wglGetPixelFormatAttribivEXT = (ptr_wglGetPixelFormatAttribivEXT)(void*)wglGetProcAddress("wglGetPixelFormatAttribivEXT"); + functions.wglGetPixelFormatAttribfvEXT = (ptr_wglGetPixelFormatAttribfvEXT)(void*)wglGetProcAddress("wglGetPixelFormatAttribfvEXT"); + functions.wglChoosePixelFormatEXT = (ptr_wglChoosePixelFormatEXT)(void*)wglGetProcAddress("wglChoosePixelFormatEXT"); HMODULE opengl32 = LoadLibrary("opengl32.dll"); if (opengl32) diff --git a/Source/Native/OpenGL/gl_load/gl_load.c b/Source/Native/OpenGL/gl_load/gl_load.c index 1a05e350..3685fab2 100644 --- a/Source/Native/OpenGL/gl_load/gl_load.c +++ b/Source/Native/OpenGL/gl_load/gl_load.c @@ -69,7 +69,7 @@ static int TestPointer(const PROC pTest) return 1; } -static PROC WinGetProcAddress(const char *name) +static void *WinGetProcAddress(const char *name) { HMODULE glMod = NULL; PROC pFunc = wglGetProcAddress((LPCSTR)name); diff --git a/Source/Native/RawMouse.cpp b/Source/Native/RawMouse.cpp index de416cae..5cdc0b4e 100644 --- a/Source/Native/RawMouse.cpp +++ b/Source/Native/RawMouse.cpp @@ -105,7 +105,7 @@ LRESULT RawMouse::OnMessage(INT message, WPARAM wparam, LPARAM lparam) { std::vector buf((size + 3) / 4); result = GetRawInputData(rawinputHandle, RID_INPUT, buf.data(), &size, sizeof(RAWINPUTHEADER)); - if (result >= 0) + if (result != (UINT)-1) { RAWINPUT* rawinput = (RAWINPUT*)buf.data(); if (rawinput->header.dwType == RIM_TYPEMOUSE)