From fb85d025bb2aff5140c2ca99a9bc15f67180bd2a Mon Sep 17 00:00:00 2001 From: Andreas Suter Date: Tue, 13 Apr 2021 07:31:01 +0200 Subject: [PATCH 1/2] add missing Qt6 flag for the case the user wants to choose himself. --- CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 98dcc9f2..57c6539b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,21 +14,21 @@ option(BMWlibs "build optional BMWlibs" OFF) option(BNMRlibs "build optional beta-NMR libs" OFF) option(qt_based_tools "try to install Qt based tools (musredit, musrWiz, musrStep, mupp)" ON) option(try_OpenMP "try to use OpenMP if available" ON) -# define qt_version with possible values 'auto' or version '3', '4', '5' +# define qt_version with possible values 'auto' or version '3', '4', '5', '6' set(qt_version AUTO CACHE STRING "provide a specific Qt version to be used.") -set_property(CACHE qt_version PROPERTY STRINGS AUTO 3 4 5) +set_property(CACHE qt_version PROPERTY STRINGS AUTO 3 4 5 6) #--- set a default build type if none was specified --------------------------- set(default_build_type "Release") - -if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + +if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) message(STATUS "Setting build type to '${default_build_type}' as none was specified.") set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose the type of build." FORCE) # Set the possible values of build type for cmake-gui set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") -endif() +endif () #--- perform some checks and generate the config.h ---------------------------- From f775ef3545e8f384c9b5fb5e897c25d2187bf3c5 Mon Sep 17 00:00:00 2001 From: Andreas Suter Date: Tue, 13 Apr 2021 07:33:14 +0200 Subject: [PATCH 2/2] Fix out-of-bound bug pointed out by Ryan McFadden. --- src/classes/PMsrHandler.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/classes/PMsrHandler.cpp b/src/classes/PMsrHandler.cpp index 84408668..b40ae3db 100644 --- a/src/classes/PMsrHandler.cpp +++ b/src/classes/PMsrHandler.cpp @@ -6674,10 +6674,12 @@ void PMsrHandler::MakeDetectorGroupingString(TString str, PIntVector &group, TSt UInt_t i=0, j=0; do { j = i; - while (group[j]+1 == group[j+1]) { - j++; - if (j == group.size()-1) - break; + if (j+1 < group.size()) { + while (group[j]+1 == group[j+1]) { + j++; + if (j == group.size()-1) + break; + } } if (j >= i+2) {