From af931eef1537cd4206eefcb981be75a2d01cba17 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 20 Oct 2022 22:19:19 +0200 Subject: fix some warnings --- CMakeLists.txt | 11 +++++------ external/CMakeLists.txt | 11 ++++++++++- main/editor.hpp | 2 +- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6ed73a2d..7447b2a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,19 +68,18 @@ function(fm_load_userconfig) endfunction() if(WIN32) - add_definitions(-D_CRT_SECURE_NO_WARNINGS -DNOMINMAX -DWIN32_LEAN_AND_MEAN) + add_definitions(-D_CRT_SECURE_NO_WARNINGS -DNOMINMAX -DWIN32_LEAN_AND_MEAN -D_HAS_EXCEPTIONS=0) endif() if(MSVC) add_definitions(-D_USE_MATH_DEFINES=1) add_compile_options(-permissive-) + add_compile_options(-external:W0 -external:anglebrackets) add_compile_options( - -wd4244 # warning C4244: 'argument': conversion from 'int' to 'float', possible loss of data - -wd4312 # warning C4312: 'reinterpret_cast': conversion from 'GLenum' to 'void *' of greater size - -wd4251 # warning C4251: 't::f': class 'x' needs to have dll-interface to be used by clients of class 'y' - -wd4456 # warning C4456: declaration of 'x' hides previous local declaration + #-wd4244 # warning C4244: 'argument': conversion from 'int' to 'float', possible loss of data + #-wd4251 # warning C4251: 't::f': class 'x' needs to have dll-interface to be used by clients of class 'y' + -wd4456 # warning C4456: declaration of 'x' hides previous local declaration ) - add_compile_options(-external:W0 -external:anglebrackets) if(CMAKE_SIZEOF_VOID_P GREATER_EQUAL 8) add_link_options(-HIGHENTROPYVA) endif() diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index 3b4110b7..6cf2ad2d 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -12,6 +12,15 @@ if(MSVC) set_property(DIRECTORY APPEND PROPERTY STATIC_LIBRARY_OPTIONS -IGNORE:4006 #warning LNK4006: main already defined in x.cpp.obj; second definition ignored ) + add_compile_options( + -wd4244 # warning C4244: 'argument': conversion from 'int' to 'float', possible loss of data + -wd4312 # warning C4312: 'reinterpret_cast': conversion from 'GLenum' to 'void *' of greater size + -wd4251 # warning C4251: 't::f': class 'x' needs to have dll-interface to be used by clients of class 'y' + -wd4456 # warning C4456: declaration of 'x' hides previous local declaration + -wd4457 # #warning C4457: declaration of 'name' hides function parameter + #-wd4530 # warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc + -wd4244 # warning C4244: 'initializing': conversion from 'unsigned int' to '_Ty', possible loss of data + ) else() add_compile_options( -Wno-error @@ -137,7 +146,7 @@ endif() if(FLOORMAT_SUBMODULE-DEPENDENCIES) if(MSVC) - target_compile_options(CorradeTestSuite PRIVATE -EHsc) + target_compile_options(CorradeTestSuiteObjects PRIVATE -EHsc) endif() endif() diff --git a/main/editor.hpp b/main/editor.hpp index f9e2def7..942185ac 100644 --- a/main/editor.hpp +++ b/main/editor.hpp @@ -47,7 +47,7 @@ private: std::string _name; std::map> _atlases; - std::tuple, std::uint32_t> _selected_tile; + std::tuple, std::uint8_t> _selected_tile; std::tuple, std::vector> _permutation; selection_mode _selection_mode = sel_none; editor_mode _mode; -- cgit v1.2.3