Skip to content

Commit e0a47d5

Browse files
ChristianTackeGSIdennisklein
authored andcommitted
chore: Mark some free standing functions static
If free standing functions are only ever used in one compile unit, they should be marked `static` to not pollute the namespace during linking.
1 parent cbe100c commit e0a47d5

5 files changed

Lines changed: 15 additions & 12 deletions

File tree

examples/MQ/pixelDetector/src/PixelDigiSource.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/********************************************************************************
2-
* Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
2+
* Copyright (C) 2014-2024 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
33
* *
44
* This software is distributed under the terms of the *
55
* GNU Lesser General Public Licence (LGPL) version 3, *
@@ -64,7 +64,7 @@ Bool_t PixelDigiSource::Init()
6464
return kTRUE;
6565
}
6666

67-
int ReadIntFromString(const std::string& wholestr, const std::string& pattern)
67+
static int ReadIntFromString(const std::string& wholestr, const std::string& pattern)
6868
{
6969
std::string tempstr = wholestr;
7070
tempstr.replace(0, tempstr.find(pattern) + pattern.length(), "");

examples/MQ/serialization/data_generator/dataGenerator.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/********************************************************************************
2-
* Copyright (C) 2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
2+
* Copyright (C) 2023-2024 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
33
* *
44
* This software is distributed under the terms of the *
55
* GNU Lesser General Public Licence (LGPL) version 3, *
@@ -40,7 +40,7 @@ using std::string;
4040
using std::vector;
4141

4242
// fill data payload and save to file
43-
void SaveDataToFile(RootOutFileManager<MyDigi>& outMan, RooDataSet& dataset)
43+
static void SaveDataToFile(RootOutFileManager<MyDigi>& outMan, RooDataSet& dataset)
4444
{
4545
vector<MyDigi> dataBunch;
4646
dataBunch.reserve(dataset.numEntries());

fairroot/base/event/FairMultiLinkedData.cxx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/********************************************************************************
2-
* Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
2+
* Copyright (C) 2014-2024 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
33
* *
44
* This software is distributed under the terms of the *
55
* GNU Lesser General Public Licence (LGPL) version 3, *
@@ -284,7 +284,10 @@ FairMultiLinkedData FairMultiLinkedData::GetLinksWithType(Int_t type) const
284284
return result;
285285
}
286286

287-
bool LargerWeight(FairLink val1, FairLink val2) { return val1.GetWeight() > val2.GetWeight(); }
287+
static bool LargerWeight(FairLink const& val1, FairLink const& val2)
288+
{
289+
return val1.GetWeight() > val2.GetWeight();
290+
}
288291

289292
std::vector<FairLink> FairMultiLinkedData::GetSortedMCTracks()
290293
{

fairroot/base/steer/FairRunAna.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/********************************************************************************
2-
* Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
2+
* Copyright (C) 2014-2024 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
33
* *
44
* This software is distributed under the terms of the *
55
* GNU Lesser General Public Licence (LGPL) version 3, *
@@ -46,10 +46,10 @@
4646
using std::cout;
4747
using std::endl;
4848

49-
Bool_t gFRAIsInterrupted;
49+
static Bool_t gFRAIsInterrupted;
5050

5151
//_____________________________________________________________________________
52-
void FRA_handler_ctrlc(int)
52+
static void FRA_handler_ctrlc(int)
5353
{
5454
LOG(info) << "*********** CTRL C PRESSED *************";
5555
gFRAIsInterrupted = kTRUE;

fairroot/online/steer/FairRunOnline.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/********************************************************************************
2-
* Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
2+
* Copyright (C) 2014-2024 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
33
* *
44
* This software is distributed under the terms of the *
55
* GNU Lesser General Public Licence (LGPL) version 3, *
@@ -97,9 +97,9 @@ FairRunOnline::~FairRunOnline()
9797
}
9898
}
9999

100-
Bool_t gIsInterrupted;
100+
static Bool_t gIsInterrupted;
101101

102-
void handler_ctrlc(int)
102+
static void handler_ctrlc(int)
103103
{
104104
gIsInterrupted = kTRUE;
105105
}

0 commit comments

Comments
 (0)