From 31c1e121b5826245e1ec074f83d4e3636cef7891 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Sat, 13 Jan 2018 18:03:24 +0300 Subject: [PATCH 1/2] Fix some warnings. Disable warning about invalid offsetof as it produces billion warnings in save-restore code --- dlls/CMakeLists.txt | 4 ++-- dlls/playermonster.cpp | 4 ++-- utils/false_vgui/include/VGUI_Panel.h | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/dlls/CMakeLists.txt b/dlls/CMakeLists.txt index bf65b00f..bfd7d80b 100644 --- a/dlls/CMakeLists.txt +++ b/dlls/CMakeLists.txt @@ -1,4 +1,4 @@ -# +# # Copyright (c) 2015 Pavlo Lavrenenko # # Permission is hereby granted, free of charge, to any person obtaining a copy @@ -28,7 +28,7 @@ set (SVDLL_LIBRARY server) add_definitions(-DCLIENT_WEAPONS) if(NOT MSVC) - add_compile_options(-fno-exceptions) # GCC/Clang flag + add_compile_options(-fno-exceptions -Wno-invalid-offsetof) # GCC/Clang flag add_definitions(-D_LINUX) # It seems enough for all non-Win32 systems add_definitions(-Dstricmp=strcasecmp -Dstrnicmp=strncasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf ) else() diff --git a/dlls/playermonster.cpp b/dlls/playermonster.cpp index cd3484ab..a6e38389 100644 --- a/dlls/playermonster.cpp +++ b/dlls/playermonster.cpp @@ -1,4 +1,4 @@ -//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============ +//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============ // // Purpose: New version of the slider bar // @@ -82,7 +82,7 @@ void CPlayerMonster :: HandleAnimEvent( MonsterEvent_t *pEvent ) //========================================================= int CPlayerMonster::ISoundMask( void ) { - return NULL; + return 0; } //========================================================= diff --git a/utils/false_vgui/include/VGUI_Panel.h b/utils/false_vgui/include/VGUI_Panel.h index bec7ac25..351b2375 100644 --- a/utils/false_vgui/include/VGUI_Panel.h +++ b/utils/false_vgui/include/VGUI_Panel.h @@ -219,7 +219,6 @@ private: bool _paintBorderEnabled; bool _paintBackgroundEnabled; bool _paintEnabled; -friend class Panel; friend class App; friend class SurfaceBase; friend class Image; From c13546377453d78c120d41d2b91326d3267e0a94 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Mon, 15 Jan 2018 02:43:57 +0300 Subject: [PATCH 2/2] add_compile_options for older cmake versions --- CMakeLists.txt | 10 ++++++++++ dlls/CMakeLists.txt | 5 +++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0d754eb5..e025342a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,6 +54,16 @@ if(CMAKE_SIZEOF_VOID_P EQUAL 8) endif() endif() +# add_compile_options for older cmake versions +if(${CMAKE_VERSION} VERSION_LESS "3.0.2") +macro(add_compile_options) + set(list_var "${ARGV}") + foreach(arg IN LISTS list_var) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${arg}") + endforeach() +endmacro() +endif() + if(BUILD_CLIENT) add_subdirectory(cl_dll) endif() diff --git a/dlls/CMakeLists.txt b/dlls/CMakeLists.txt index bfd7d80b..bf7d3370 100644 --- a/dlls/CMakeLists.txt +++ b/dlls/CMakeLists.txt @@ -1,4 +1,4 @@ -# +# # Copyright (c) 2015 Pavlo Lavrenenko # # Permission is hereby granted, free of charge, to any person obtaining a copy @@ -28,7 +28,8 @@ set (SVDLL_LIBRARY server) add_definitions(-DCLIENT_WEAPONS) if(NOT MSVC) - add_compile_options(-fno-exceptions -Wno-invalid-offsetof) # GCC/Clang flag + add_compile_options(-fno-exceptions) # GCC/Clang flag + add_compile_options(-Wno-invalid-offsetof) # GCC/Clang flag add_definitions(-D_LINUX) # It seems enough for all non-Win32 systems add_definitions(-Dstricmp=strcasecmp -Dstrnicmp=strncasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf ) else()