From 4401deac27c257d0ded73a28d9fee52bc2cac38b Mon Sep 17 00:00:00 2001 From: HarrievG Date: Fri, 16 Sep 2022 23:12:54 +0200 Subject: [PATCH 1/3] idList iterator fix parser cleanup fix --- neo/idlib/containers/List.h | 15 ++++++++------- neo/idlib/gltfParser.h | 1 - 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/neo/idlib/containers/List.h b/neo/idlib/containers/List.h index 7ae0afe4..9b2f0013 100644 --- a/neo/idlib/containers/List.h +++ b/neo/idlib/containers/List.h @@ -203,11 +203,11 @@ public: memTag = ( byte )tag_; }; - /* + template struct Iterator { - _type_* p; - _type_& operator*() + T* p; + T& operator*() { return *p; } @@ -223,14 +223,15 @@ public: auto begin() const // const version { - return Iterator{list}; + return Iterator<_type_>{list}; }; auto end() const // const version { - return Iterator{list + Num()}; + return Iterator<_type_>{list + Num( )}; }; - */ + + /* // Begin/End methods for range-based for loops. _type_* begin() { @@ -277,7 +278,7 @@ public: return nullptr; } } - + */ private: int num; int size; diff --git a/neo/idlib/gltfParser.h b/neo/idlib/gltfParser.h index 654443f6..95b955ca 100644 --- a/neo/idlib/gltfParser.h +++ b/neo/idlib/gltfParser.h @@ -54,7 +54,6 @@ public: } virtual ~parseType() { - delete item; } T* item; }; From 5569af4f262b822a7fc8de687f5ee132ca0d3fa6 Mon Sep 17 00:00:00 2001 From: Robert Beckebans Date: Sat, 17 Sep 2022 08:12:31 +0200 Subject: [PATCH 2/3] Astyle --- neo/idlib/containers/List.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/neo/idlib/containers/List.h b/neo/idlib/containers/List.h index 9b2f0013..cf7951bb 100644 --- a/neo/idlib/containers/List.h +++ b/neo/idlib/containers/List.h @@ -223,13 +223,13 @@ public: auto begin() const // const version { - return Iterator<_type_>{list}; + return Iterator<_type_> {list}; }; auto end() const // const version { - return Iterator<_type_>{list + Num( )}; + return Iterator<_type_> {list + Num()}; }; - + /* // Begin/End methods for range-based for loops. From f426ae34725187fab826ecfcfcb85ba7bca9b4ae Mon Sep 17 00:00:00 2001 From: Robert Beckebans Date: Sat, 17 Sep 2022 10:51:34 +0200 Subject: [PATCH 3/3] Bumped required C++ standard to 14 --- neo/CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/neo/CMakeLists.txt b/neo/CMakeLists.txt index 46483660..4f6d6ba4 100644 --- a/neo/CMakeLists.txt +++ b/neo/CMakeLists.txt @@ -141,15 +141,15 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang") add_definitions(-Werror=format-security) add_definitions(-Werror=format) - # Compiler check (needs -std=c++11 flag) + # Compiler check (needs -std=c++14 flag) include(CheckCXXCompilerFlag) - CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) - if(COMPILER_SUPPORTS_CXX11) - set(CMAKE_CXX_STANDARD 11) + CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX14) + if(COMPILER_SUPPORTS_CXX14) + set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) else() - message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.") + message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++14 support. Please use a different C++ compiler.") endif() if(CPU_TYPE)