From 82431b752d1b58ee39372f0cd48c6b94c800d104 Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Fri, 9 Oct 2020 06:50:17 +0200 Subject: [PATCH] removed unnessary bits that cmake should be doing for us; replace Misc::gcd with std::gcd --- CMakeLists.txt | 2 +- apps/launcher/graphicspage.cpp | 5 +++-- apps/openmw/mwgui/settingswindow.cpp | 4 ++-- components/CMakeLists.txt | 2 +- components/misc/gcd.hpp | 13 ------------- 5 files changed, 7 insertions(+), 19 deletions(-) delete mode 100644 components/misc/gcd.hpp diff --git a/CMakeLists.txt b/CMakeLists.txt index ac74f5f2c..87551fe01 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -416,7 +416,7 @@ endif() if (CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wundef -Wno-unused-parameter -std=c++17 -pedantic -Wno-long-long") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wundef -Wno-unused-parameter -pedantic -Wno-long-long") add_definitions( -DBOOST_NO_CXX11_SCOPED_ENUMS=ON ) if (APPLE) diff --git a/apps/launcher/graphicspage.cpp b/apps/launcher/graphicspage.cpp index c745332dc..d7e7eabc5 100644 --- a/apps/launcher/graphicspage.cpp +++ b/apps/launcher/graphicspage.cpp @@ -13,12 +13,13 @@ #include +#include + #include -#include QString getAspect(int x, int y) { - int gcd = Misc::gcd (x, y); + int gcd = std::gcd (x, y); int xaspect = x / gcd; int yaspect = y / gcd; // special case: 8 : 5 is usually referred to as 16:10 diff --git a/apps/openmw/mwgui/settingswindow.cpp b/apps/openmw/mwgui/settingswindow.cpp index aec3396a1..c5fa17ca4 100644 --- a/apps/openmw/mwgui/settingswindow.cpp +++ b/apps/openmw/mwgui/settingswindow.cpp @@ -10,10 +10,10 @@ #include #include +#include #include #include -#include #include #include #include @@ -60,7 +60,7 @@ namespace std::string getAspect (int x, int y) { - int gcd = Misc::gcd (x, y); + int gcd = std::gcd (x, y); int xaspect = x / gcd; int yaspect = y / gcd; // special case: 8 : 5 is usually referred to as 16:10 diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index c399a7010..69d8145f0 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -86,7 +86,7 @@ add_component_dir (esmterrain ) add_component_dir (misc - gcd constants utf8stream stringops resourcehelpers rng messageformatparser weakcache + constants utf8stream stringops resourcehelpers rng messageformatparser weakcache ) add_component_dir (debug diff --git a/components/misc/gcd.hpp b/components/misc/gcd.hpp deleted file mode 100644 index fd9e972e7..000000000 --- a/components/misc/gcd.hpp +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef MISC_GCD_H -#define MISC_GCD_H - -namespace Misc -{ - // TODO: replace to the std::gcd() when the C++17 will be available. - int gcd(int a, int b) - { - return b == 0 ? a : gcd(b, a % b); - } -} - -#endif