From d08280ea76e355e61f4701f45c444ad5be95fe84 Mon Sep 17 00:00:00 2001 From: Scott Snyder <scott.snyder@cern.ch> Date: Fri, 20 Jan 2023 10:38:38 +0100 Subject: [PATCH] TrigT1NSWSimTools: Fix cppcheck warnings. TrigT1NSWSimTools: Fix cppcheck warnings. Prefer to initialize class members in an initialization list. --- .../src/MMStripTdsOfflineTool.cxx | 8 ++- .../TrigT1/TrigT1NSWSimTools/src/MMT_Hit.cxx | 51 ++++++++++--------- .../src/PadTdsOfflineTool.cxx | 8 ++- .../src/StripTdsOfflineTool.cxx | 8 ++- 4 files changed, 44 insertions(+), 31 deletions(-) diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/src/MMStripTdsOfflineTool.cxx b/Trigger/TrigT1/TrigT1NSWSimTools/src/MMStripTdsOfflineTool.cxx index ca3b1fecbfb..f2f889943cc 100644 --- a/Trigger/TrigT1/TrigT1NSWSimTools/src/MMStripTdsOfflineTool.cxx +++ b/Trigger/TrigT1/TrigT1NSWSimTools/src/MMStripTdsOfflineTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration */ // Athena/Gaudi includes @@ -24,7 +24,11 @@ namespace NSWL1 { int t_cache_index; // constructor - MMStripHits(Identifier id, MMStripOfflineData* p, int c) { t_id = id; t_mmstrip=p; t_cache_index=c; } + MMStripHits(Identifier id, MMStripOfflineData* p, int c) + : t_id (id), + t_mmstrip (p), + t_cache_index (c) + { } }; typedef std::map < Identifier,std::vector<MMStripHits> > MMSTRIP_MAP; diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/src/MMT_Hit.cxx b/Trigger/TrigT1/TrigT1NSWSimTools/src/MMT_Hit.cxx index 22919083d86..24257cd8134 100644 --- a/Trigger/TrigT1/TrigT1NSWSimTools/src/MMT_Hit.cxx +++ b/Trigger/TrigT1/TrigT1NSWSimTools/src/MMT_Hit.cxx @@ -109,31 +109,32 @@ MMT_Hit::MMT_Hit(const hitData_entry &entry, const MuonGM::MuonDetectorManager* m_shift = roundedSlope*(planeCoordinates[m_plane].Z() - planeCoordinates[0].Z()); } -MMT_Hit::MMT_Hit(const MMT_Hit* hit) { - m_sector = hit->m_sector; - m_module = hit->m_module; - m_station_name = hit->m_station_name; - m_VMM_chip = hit->m_VMM_chip; - m_MMFE_VMM = hit->m_MMFE_VMM; - m_ART_ASIC = hit->m_ART_ASIC; - m_station_eta = hit->m_station_eta; - m_station_phi = hit->m_station_phi; - m_multiplet = hit->m_multiplet; - m_gasgap = hit->m_gasgap; - m_plane = hit->m_plane; - m_strip = hit->m_strip; - m_localX = hit->m_localX; - m_BC_time = hit->m_BC_time; - m_age = hit->m_age; - m_Y = hit->m_Y; - m_Z = hit->m_Z; - m_R = hit->m_R; - m_Ri = hit->m_Ri; - m_RZslope = hit->m_RZslope; - m_YZslope = hit->m_YZslope; - m_isNoise = hit->m_isNoise; - m_time = hit->m_time; - m_shift = hit->m_shift; +MMT_Hit::MMT_Hit(const MMT_Hit* hit) + : m_sector (hit->m_sector), + m_module (hit->m_module), + m_station_name (hit->m_station_name), + m_VMM_chip (hit->m_VMM_chip), + m_MMFE_VMM (hit->m_MMFE_VMM), + m_ART_ASIC (hit->m_ART_ASIC), + m_plane (hit->m_plane), + m_station_eta (hit->m_station_eta), + m_station_phi (hit->m_station_phi), + m_multiplet (hit->m_multiplet), + m_gasgap (hit->m_gasgap), + m_strip (hit->m_strip), + m_localX (hit->m_localX), + m_RZslope (hit->m_RZslope), + m_YZslope (hit->m_YZslope), + m_BC_time (hit->m_BC_time), + m_age (hit->m_age), + m_Y (hit->m_Y), + m_Z (hit->m_Z), + m_R (hit->m_R), + m_Ri (hit->m_Ri), + m_isNoise (hit->m_isNoise), + m_time (hit->m_time), + m_shift (hit->m_shift) +{ } bool MMT_Hit::isX() const { diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/src/PadTdsOfflineTool.cxx b/Trigger/TrigT1/TrigT1NSWSimTools/src/PadTdsOfflineTool.cxx index d667e332b5a..88e2c37d390 100644 --- a/Trigger/TrigT1/TrigT1NSWSimTools/src/PadTdsOfflineTool.cxx +++ b/Trigger/TrigT1/TrigT1NSWSimTools/src/PadTdsOfflineTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration */ #include "GaudiKernel/ConcurrencyFlags.h" @@ -14,7 +14,11 @@ namespace NSWL1 { std::shared_ptr<PadOfflineData> t_pad; int t_cache_index; - PadHits(Identifier id, std::shared_ptr<PadOfflineData> p, int c) { t_id = id; t_pad=std::move(p); t_cache_index=c; } + PadHits(Identifier id, std::shared_ptr<PadOfflineData> p, int c) + : t_id (id), + t_pad (std::move(p)), + t_cache_index (c) + { } }; diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/src/StripTdsOfflineTool.cxx b/Trigger/TrigT1/TrigT1NSWSimTools/src/StripTdsOfflineTool.cxx index 98e7555fb45..0c33abe5bfe 100644 --- a/Trigger/TrigT1/TrigT1NSWSimTools/src/StripTdsOfflineTool.cxx +++ b/Trigger/TrigT1/TrigT1NSWSimTools/src/StripTdsOfflineTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration */ #include "GaudiKernel/ConcurrencyFlags.h" @@ -13,7 +13,11 @@ namespace NSWL1 { Identifier t_id; StripOfflineData* t_strip; int t_cache_index; - StripHits(Identifier id, StripOfflineData* p, int c) { t_id = id; t_strip=p; t_cache_index=c; } + StripHits(Identifier id, StripOfflineData* p, int c) + : t_id (id), + t_strip (p), + t_cache_index (c) + { } }; using STRIP_MAP=std::map < Identifier,std::vector<StripHits> >; -- GitLab