From 0d5cb0536e3077844761f990b2a87132a96c72d7 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Thu, 9 Mar 2017 18:08:09 -0500 Subject: [PATCH 1/2] - enable multiprocessor compilation with MSVC++ using /MP for MSBuild - Target NEON processors for ARM. --- src/CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d50274473..37746a89e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -413,6 +413,11 @@ else( X64 ) set( CMAKE_CXX_FLAGS ${SAFE_CMAKE_CXX_FLAGS} ) endif( X64 ) +# Set up flags for MSVC +if (MSVC) + set( CMAKE_CXX_FLAGS "/MP ${CMAKE_CXX_FLAGS}" ) +endif (MSVC) + # Set up flags for GCC if( ZD_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE ) @@ -471,6 +476,11 @@ if( ZD_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE ) set( CMAKE_C_FLAGS "-Wall -Wextra -Wno-unused -Wno-unused-parameter -Wno-missing-field-initializers -ffp-contract=off ${CMAKE_C_FLAGS}" ) set( CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused -Wno-unused-parameter -Wno-missing-field-initializers -ffp-contract=off ${CMAKE_CXX_FLAGS}" ) + # ARM processors (Raspberry Pi, et al) - enable ARM NEON support. + if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm") + set( CMAKE_CXX_FLAGS "-mfpu=neon ${CMAKE_CXX_FLAGS}" ) + endif () + # Use the highest C++ standard available since VS2015 compiles with C++14 # but we only require C++11. The recommended way to do this in CMake is to # probably to use target_compile_features, but I don't feel like maintaining From 5b9fece062e6343fb58b81b57ea29055ae69d1f4 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 10 Mar 2017 10:37:43 +0100 Subject: [PATCH 2/2] - fixed bad definition of FBlockThingsIterator.Next(). When implementing the BlockLinesIterator apparently some incorrect code got modified. - fixed an uninitialized variable in P_CheckSight. --- src/p_maputl.cpp | 6 +++--- src/p_sight.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/p_maputl.cpp b/src/p_maputl.cpp index c4fe47f31..053f44c13 100644 --- a/src/p_maputl.cpp +++ b/src/p_maputl.cpp @@ -954,7 +954,7 @@ DEFINE_ACTION_FUNCTION(DBlockLinesIterator, CreateFromPos) ACTION_RETURN_OBJECT(new DBlockLinesIterator(x, y, z, h, radius, sec)); } -DEFINE_ACTION_FUNCTION(DBlockThingsIterator, Next) +DEFINE_ACTION_FUNCTION(DBlockLinesIterator, Next) { PARAM_SELF_PROLOGUE(DBlockLinesIterator); ACTION_RETURN_BOOL(self->Next()); @@ -1293,9 +1293,9 @@ DEFINE_ACTION_FUNCTION(DBlockThingsIterator, CreateFromPos) ACTION_RETURN_OBJECT(new DBlockThingsIterator(x, y, z, h, radius, ignore, nullptr)); } -DEFINE_ACTION_FUNCTION(DBlockLinesIterator, Next) +DEFINE_ACTION_FUNCTION(DBlockThingsIterator, Next) { - PARAM_SELF_PROLOGUE(DBlockLinesIterator); + PARAM_SELF_PROLOGUE(DBlockThingsIterator); ACTION_RETURN_BOOL(self->Next()); } diff --git a/src/p_sight.cpp b/src/p_sight.cpp index 68bf2ed3d..92cd52b95 100644 --- a/src/p_sight.cpp +++ b/src/p_sight.cpp @@ -735,7 +735,7 @@ bool SightCheck::P_SightPathTraverse () // step through map blocks // Count is present to prevent a round off error from skipping the break - int itres; + int itres = -1; for (count = 0 ; count < 1000 ; count++) { // end traversing when reaching the end of the blockmap