diff --git a/CMakeLists.txt b/CMakeLists.txt index 3d83d1856..c2f5aa253 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -312,7 +312,7 @@ check_compiler() if(DEFINED ENV{WERROR} AND "$ENV{WERROR}") message(STATUS "Will compile with -Werror. ") set(CMAKE_CXX_FLAGS - "${CMAKE_CXX_FLAGS} -Wall -Wformat-security -Werror -Wno-sign-compare -Wno-reorder -Wno-unused-variable -Wno-unused-but-set-variable -Wfatal-errors" + "${CMAKE_CXX_FLAGS} -Wall -Wno-non-virtual-dtor -Wwrite-strings -Wpointer-arith -Wshadow -Wformat-security -Werror -Wno-sign-compare -Wno-reorder -Wno-unused-variable -Wno-unused-but-set-variable -Wfatal-errors" ) else() if(NOT APPLE) @@ -321,7 +321,7 @@ else() "Set env WERROR to 1 to enable -Werror. If origin/dev compiles on your platform with that option, it is definitly a good idea to do that." ) set(CMAKE_CXX_FLAGS - "${CMAKE_CXX_FLAGS} -Wall -Wformat-security -Wno-sign-compare -Wno-reorder -Wno-unused-variable -Wno-unused-but-set-variable" + "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Wno-ignored-qualifiers -Wfatal-errors -Wno-vla -Wwrite-strings -Woverloaded-virtual -Wshadow -Wformat-security -Wno-sign-compare -Wno-reorder" ) endif() endif() diff --git a/analysis/online/R3BFiberTrackingOnlineSpectra.cxx b/analysis/online/R3BFiberTrackingOnlineSpectra.cxx index 235ec86b7..f6dd14a86 100644 --- a/analysis/online/R3BFiberTrackingOnlineSpectra.cxx +++ b/analysis/online/R3BFiberTrackingOnlineSpectra.cxx @@ -50,6 +50,7 @@ #include #include #include +#include #define IS_NAN(x) TMath::IsNaN(x) diff --git a/los/calib/R3BLosCal2Hit.h b/los/calib/R3BLosCal2Hit.h index a30ac0efb..c5d1b2647 100644 --- a/los/calib/R3BLosCal2Hit.h +++ b/los/calib/R3BLosCal2Hit.h @@ -17,12 +17,11 @@ // ----- Convert time calibrated data to hit level (single time) ---- // ------------------------------------------------------------------ -#ifndef R3BLOSCAL2HIT -#define R3BLOSCAL2HIT +#pragma once #include -#include "FairTask.h" +#include class TClonesArray; class TH1F; @@ -30,17 +29,8 @@ class TH2F; class R3BEventHeader; class R3BLosHitPar; -/** - * TODO: This explanation is humbug. - * An analysis task to apply TCAL calibration for NeuLAND. - * This class reads NeuLAND mapped items with TDC values and - * produces time items with time in [ns]. It requires TCAL - * calibration parameters, which are produced in a separate - * analysis run containing R3BLosCal2HitFill task. - */ class R3BLosCal2Hit : public FairTask { - public: /** * Default constructor. @@ -244,7 +234,6 @@ class R3BLosCal2Hit : public FairTask TH2F* fhQ3_vs_Q7_corr; TH2F* fhQ4_vs_Q8; TH2F* fhQ4_vs_Q8_corr; - ; TH2F* fhTresX_M; TH2F* fhTresY_M; TH2F* fhTresX_T; @@ -266,7 +255,5 @@ class R3BLosCal2Hit : public FairTask Int_t Icount = 0; public: - ClassDef(R3BLosCal2Hit, 1) + ClassDef(R3BLosCal2Hit, 1); }; - -#endif diff --git a/los/calib/R3BLosMapped2TCal.cxx b/los/calib/R3BLosMapped2TCal.cxx index 518d4086c..7c1bc7309 100644 --- a/los/calib/R3BLosMapped2TCal.cxx +++ b/los/calib/R3BLosMapped2TCal.cxx @@ -136,7 +136,7 @@ InitStatus R3BLosMapped2TCal::ReInit() return kSUCCESS; } -void R3BLosMapped2TCal::Exec(Option_t* option) +void R3BLosMapped2TCal::Exec(Option_t*) { // check for requested trigger (Todo: should be done globablly / somewhere else) diff --git a/r3bbase/CMakeLists.txt b/r3bbase/CMakeLists.txt index 2ac7a332c..b048ae157 100644 --- a/r3bbase/CMakeLists.txt +++ b/r3bbase/CMakeLists.txt @@ -23,7 +23,6 @@ set(SRCS R3BException.cxx R3BFileSource.cxx R3BFileSource2.cxx - R3BLogger.cxx R3BModule.cxx R3BTcutPar.cxx R3BTsplinePar.cxx diff --git a/r3bbase/R3BFileSource2.cxx b/r3bbase/R3BFileSource2.cxx index cb66c34a7..5d4670b97 100644 --- a/r3bbase/R3BFileSource2.cxx +++ b/r3bbase/R3BFileSource2.cxx @@ -26,6 +26,7 @@ #include #include #include +#include #include namespace diff --git a/r3bbase/R3BLogger.cxx b/r3bbase/R3BLogger.cxx deleted file mode 100644 index 6a3cf2f5e..000000000 --- a/r3bbase/R3BLogger.cxx +++ /dev/null @@ -1,21 +0,0 @@ -/****************************************************************************** - * Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH * - * Copyright (C) 2019-2025 Members of R3B Collaboration * - * * - * This software is distributed under the terms of the * - * GNU General Public Licence (GPL) version 3, * - * copied verbatim in the file "LICENSE". * - * * - * In applying this license GSI does not waive the privileges and immunities * - * granted to it by virtue of its status as an Intergovernmental Organization * - * or submit itself to any jurisdiction. * - ******************************************************************************/ - -// ---------------------------------------------------------------------- -// ----- R3BLogger ----- -// ----- Created 15/12/21 by J.L. Rodriguez-Sanchez ----- -// ---------------------------------------------------------------------- - -#include "R3BLogger.h" - -ClassImp(R3BLogger) diff --git a/r3bbase/R3BLogger.h b/r3bbase/R3BLogger.h index e8aa89b5c..7658e764a 100644 --- a/r3bbase/R3BLogger.h +++ b/r3bbase/R3BLogger.h @@ -18,47 +18,40 @@ #pragma once -#include -#include -#include -#include -#include - #include +#include -// NOLINTBEGIN -class R3BLogger; +#include class R3BLogger : public FairLogger { public: -#define R3BLOG(severity, x) \ - if (true) \ - { \ - std::string fN(__FILE__); \ - std::stringstream ss; \ - ss << fN.substr(fN.find_last_of("/") + 1) << ":" << __LINE__ << ":" << __FUNCTION__ << "(): "; \ - LOG(severity) << ss.str() << x; \ - } \ - else \ - (void)0 - -#define R3BLOG_IF(severity, condition, x) \ - if (true) \ - { \ - std::string fNif(__FILE__); \ - std::stringstream ssif; \ - ssif << fNif.substr(fNif.find_last_of("/") + 1) << ":" << __LINE__ << ":" << __FUNCTION__ << "(): "; \ - LOG_IF(severity, condition) << ssif.str() << x; \ - } \ - else \ - (void)0 - +// NOLINTBEGIN +#define R3BLOG(severity, x) \ + do \ + { \ + std::string infile(__FILE__); \ + std::stringstream ss; \ + ss << infile.substr(infile.find_last_of("/") + 1) << ":" << __LINE__ << ":" << __FUNCTION__ << "(): "; \ + LOG(severity) << ss.str() << x; \ + } while (0) + +#define R3BLOG_IF(severity, condition, x) \ + do \ + { \ + if (condition) \ + { \ + std::string infile(__FILE__); \ + std::stringstream ss; \ + ss << infile.substr(infile.find_last_of("/") + 1) << ":" << __LINE__ << ":" << __FUNCTION__ << "(): "; \ + LOG(severity) << ss.str() << x; \ + } \ + } while (0) + // NOLINTEND private: R3BLogger(); - ~R3BLogger(); + ~R3BLogger() = default; public: - ClassDefOverride(R3BLogger, 0) + ClassDefOverride(R3BLogger, 0); }; -// NOLINTEND