Skip to content

Commit a0c1c46

Browse files
committed
Use C++17 nested namespaces; remove using namespace std
1 parent 959eb59 commit a0c1c46

File tree

180 files changed

+438
-985
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

180 files changed

+438
-985
lines changed

src/sst/core/baseComponent.cc

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -919,9 +919,7 @@ BaseComponent::serialize_order(SST::Core::Serialization::serializer& ser)
919919
}
920920
}
921921

922-
namespace Core {
923-
namespace Serialization {
924-
namespace pvt {
922+
namespace Core::Serialization::pvt {
925923

926924
static const long null_ptr_id = -1;
927925

@@ -997,9 +995,6 @@ SerializeBaseComponentHelper::map_basecomponent(serializable_base*& s, serialize
997995
ser.mapper().map_hierarchy_end(); // obj_map
998996
}
999997

1000-
} // namespace pvt
1001-
} // namespace Serialization
1002-
} // namespace Core
1003-
998+
} // namespace Core::Serialization::pvt
1004999

10051000
} // namespace SST

src/sst/core/baseComponent.h

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,9 @@ class TimeConverter;
4949
class UnitAlgebra;
5050

5151

52-
namespace Core {
53-
namespace Serialization {
54-
namespace pvt {
52+
namespace Core::Serialization::pvt {
5553
class SerializeBaseComponentHelper;
56-
} // namespace pvt
57-
} // namespace Serialization
58-
} // namespace Core
54+
}
5955

6056
/**
6157
* Main component object for the simulation.
@@ -1117,11 +1113,9 @@ class SubComponentSlotInfo
11171113
}
11181114
};
11191115

1120-
namespace Core {
1121-
namespace Serialization {
1116+
namespace Core::Serialization {
11221117

11231118
namespace pvt {
1124-
11251119
class SerializeBaseComponentHelper
11261120
{
11271121
public:
@@ -1169,8 +1163,7 @@ class serialize_impl<T*, typename std::enable_if<std::is_base_of<SST::BaseCompon
11691163
}
11701164
};
11711165

1172-
} // namespace Serialization
1173-
} // namespace Core
1166+
} // namespace Core::Serialization
11741167

11751168
} // namespace SST
11761169

src/sst/core/cfgoutput/dotConfigOutput.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
#include "sst/core/configGraph.h"
1717
#include "sst/core/configGraphOutput.h"
1818

19-
namespace SST {
20-
namespace Core {
19+
namespace SST::Core {
2120

2221
class DotConfigGraphOutput : public ConfigGraphOutput
2322
{
@@ -33,7 +32,6 @@ class DotConfigGraphOutput : public ConfigGraphOutput
3332
void generateDot(const ConfigLink* link, const uint32_t dot_verbosity) const;
3433
};
3534

36-
} // namespace Core
37-
} // namespace SST
35+
} // namespace SST::Core
3836

3937
#endif // SST_CORE_DOT_CONFIG_OUTPUT_H

src/sst/core/cfgoutput/jsonConfigOutput.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
#include "sst/core/configGraph.h"
1717
#include "sst/core/configGraphOutput.h"
1818

19-
namespace SST {
20-
namespace Core {
19+
namespace SST::Core {
2120

2221
class JSONConfigGraphOutput : public ConfigGraphOutput
2322
{
@@ -27,7 +26,6 @@ class JSONConfigGraphOutput : public ConfigGraphOutput
2726
virtual void generate(const Config* cfg, ConfigGraph* graph) override;
2827
};
2928

30-
} // namespace Core
31-
} // namespace SST
29+
} // namespace SST::Core
3230

3331
#endif // SST_CORE_JSON_CONFIG_OUTPUT_H

src/sst/core/cfgoutput/pythonConfigOutput.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818

1919
#include <map>
2020

21-
namespace SST {
22-
namespace Core {
21+
namespace SST::Core {
2322

2423
class PythonConfigGraphOutput : public ConfigGraphOutput
2524
{
@@ -51,7 +50,6 @@ class PythonConfigGraphOutput : public ConfigGraphOutput
5150
std::map<LinkId_t, std::string> linkMap;
5251
};
5352

54-
} // namespace Core
55-
} // namespace SST
53+
} // namespace SST::Core
5654

5755
#endif // SST_CORE_PYTHON_CONFIG_OUTPUT_H

src/sst/core/cfgoutput/xmlConfigOutput.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
#include "sst/core/configGraph.h"
1717
#include "sst/core/configGraphOutput.h"
1818

19-
namespace SST {
20-
namespace Core {
19+
namespace SST::Core {
2120

2221
class XMLConfigGraphOutput : public ConfigGraphOutput
2322
{
@@ -30,7 +29,6 @@ class XMLConfigGraphOutput : public ConfigGraphOutput
3029
void generateXML(const std::string& indent, const ConfigLink* link, const ConfigComponentMap_t& compMap) const;
3130
};
3231

33-
} // namespace Core
34-
} // namespace SST
32+
} // namespace SST::Core
3533

3634
#endif // SST_CORE_XML_CONFIG_OUTPUT_H

src/sst/core/componentInfo.h

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,9 @@ class ConfigStatistic;
3434
class Simulation_impl;
3535
class TimeConverter;
3636

37-
namespace Core {
38-
namespace Serialization {
39-
namespace pvt {
37+
namespace Core::Serialization::pvt {
4038
class SerializeBaseComponentHelper;
41-
} // namespace pvt
42-
} // namespace Serialization
43-
} // namespace Core
39+
} // namespace Core::Serialization::pvt
4440

4541
class ComponentInfo
4642
{
@@ -52,8 +48,7 @@ class ComponentInfo
5248
static const uint64_t SHARE_PORTS = 0x1;
5349
static const uint64_t SHARE_STATS = 0x2;
5450
static const uint64_t INSERT_STATS = 0x4;
55-
56-
static const uint64_t SHARE_NONE = 0x0;
51+
static const uint64_t SHARE_NONE = 0x0;
5752

5853
private:
5954
// Mask to make sure users are only setting the flags that are

src/sst/core/config.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
#include <sys/stat.h>
2626
#include <unistd.h>
2727

28-
using namespace std;
29-
3028
namespace SST {
3129

3230
//// Helper class for setting options
@@ -1197,7 +1195,7 @@ Config::checkArgsAfterParsing()
11971195

11981196

11991197
bool
1200-
Config::setOptionFromModel(const string& entryName, const string& value)
1198+
Config::setOptionFromModel(const std::string& entryName, const std::string& value)
12011199
{
12021200
// Check to make sure option is settable in the SDL file
12031201
if ( getAnnotation(entryName, 'S') ) { return setOptionExternal(entryName, value); }

src/sst/core/configBase.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
#define E_OK 0
3030
#endif
3131

32-
using namespace std;
33-
3432
namespace SST {
3533

3634
bool
@@ -431,7 +429,7 @@ ConfigBase::parseCmdLine(int argc, char* argv[], bool ignore_unknown)
431429

432430

433431
bool
434-
ConfigBase::setOptionExternal(const string& entryName, const string& value)
432+
ConfigBase::setOptionExternal(const std::string& entryName, const std::string& value)
435433
{
436434
// NOTE: print outs in this function will not be suppressed
437435
for ( auto& option : options ) {

src/sst/core/configGraph.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
#include <fstream>
2727
#include <string.h>
2828

29-
using namespace std;
30-
3129
namespace {
3230
// bool zero_latency_warning = false;
3331

@@ -931,7 +929,7 @@ ConfigGraph::findStatistic(StatisticId_t id) const
931929
ConfigGraph*
932930
ConfigGraph::getSubGraph(uint32_t start_rank, uint32_t end_rank)
933931
{
934-
set<uint32_t> rank_set;
932+
std::set<uint32_t> rank_set;
935933
for ( uint32_t i = start_rank; i <= end_rank; i++ ) {
936934
rank_set.insert(i);
937935
}
@@ -1392,7 +1390,7 @@ PartitionComponent::print(std::ostream& os, const PartitionGraph* graph) const
13921390
for ( ComponentIdMap_t::const_iterator git = group.begin(); git != group.end(); ++git ) {
13931391
os << *git << " ";
13941392
}
1395-
os << ")" << endl;
1393+
os << ")" << std::endl;
13961394
os << " weight = " << weight << std::endl;
13971395
os << " rank = " << rank.rank << std::endl;
13981396
os << " thread = " << rank.thread << std::endl;

0 commit comments

Comments
 (0)