From 95e95f8904e40081a9faf8225c23801d081a6bd7 Mon Sep 17 00:00:00 2001 From: Eduardo Almeida Date: Sun, 9 Oct 2022 22:36:23 +0000 Subject: [PATCH] Fix clang-tidy warnings in brite, click, mpi, openflow, p2p, visualizer --- src/brite/helper/brite-topology-helper.cc | 22 +-- src/brite/helper/brite-topology-helper.h | 10 +- src/brite/test/brite-test-topology.cc | 12 +- src/click/examples/nsclick-defines.cc | 2 + src/click/examples/nsclick-raw-wlan.cc | 3 +- src/click/examples/nsclick-routing.cc | 2 + src/click/examples/nsclick-simple-lan.cc | 3 +- .../nsclick-udp-client-server-csma.cc | 2 + .../nsclick-udp-client-server-wifi.cc | 2 + .../helper/click-internet-stack-helper.cc | 4 +- .../helper/click-internet-stack-helper.h | 30 +-- src/click/model/ipv4-click-routing.cc | 8 +- src/click/model/ipv4-click-routing.h | 48 ++--- src/click/model/ipv4-l3-click-protocol.cc | 24 ++- src/click/model/ipv4-l3-click-protocol.h | 88 ++++----- src/click/test/ipv4-click-routing-test.cc | 12 +- src/config-store/model/gtk-config-store.cc | 4 +- src/config-store/model/gtk-config-store.h | 4 +- src/config-store/model/model-node-creator.cc | 10 +- src/config-store/model/model-node-creator.h | 32 ++-- .../model/model-typeid-creator.cc | 4 +- src/config-store/model/model-typeid-creator.h | 4 +- src/core/model/attribute-accessor-helper.h | 4 +- src/core/model/attribute-helper.h | 22 +-- src/core/model/breakpoint.cc | 2 +- src/core/model/int64x64-cairo.h | 10 +- src/core/model/int64x64-double.h | 12 +- src/core/model/make-event.cc | 2 +- src/core/model/random-variable-stream.h | 8 +- src/core/model/simulator-impl.h | 2 +- src/core/model/type-name.h | 2 +- src/core/model/type-traits.h | 6 +- src/core/model/version.cc | 26 +-- src/core/model/version.h | 26 +-- .../test/random-variable-stream-test-suite.cc | 110 +++++------ src/core/test/rng-test-suite.cc | 24 +-- src/core/test/type-traits-test-suite.cc | 12 +- .../helper/netmap-net-device-helper.cc | 4 +- .../helper/netmap-net-device-helper.h | 4 +- src/fd-net-device/model/dpdk-net-device.cc | 8 +- src/fd-net-device/model/dpdk-net-device.h | 8 +- src/fd-net-device/model/netmap-net-device.cc | 20 +- src/fd-net-device/model/netmap-net-device.h | 20 +- src/internet/model/ipv4-route.h | 2 +- src/lte/model/lte-rlc-am.h | 4 +- src/mesh/model/dot11s/ie-dot11s-id.h | 2 +- src/mobility/model/mobility-model.h | 2 +- src/mpi/examples/mpi-test-fixtures.cc | 2 +- src/mpi/examples/mpi-test-fixtures.h | 8 +- src/mpi/examples/nms-p2p-nix-distributed.cc | 18 +- src/mpi/model/distributed-simulator-impl.cc | 36 ++-- src/mpi/model/distributed-simulator-impl.h | 54 +++--- .../granted-time-window-mpi-interface.cc | 8 +- .../model/granted-time-window-mpi-interface.h | 20 +- src/mpi/model/mpi-interface.cc | 18 +- src/mpi/model/mpi-interface.h | 2 +- src/mpi/model/mpi-receiver.cc | 4 +- src/mpi/model/mpi-receiver.h | 6 +- src/mpi/model/null-message-mpi-interface.cc | 10 +- src/mpi/model/null-message-mpi-interface.h | 24 +-- src/mpi/model/null-message-simulator-impl.cc | 44 ++--- src/mpi/model/null-message-simulator-impl.h | 60 +++--- .../model/remote-channel-bundle-manager.cc | 10 +- src/mpi/model/remote-channel-bundle-manager.h | 8 +- src/mpi/model/remote-channel-bundle.cc | 12 +- src/mpi/model/remote-channel-bundle.h | 12 +- src/mpi/test/mpi-test-suite.cc | 12 +- src/network/model/address.h | 12 +- src/network/model/buffer.h | 4 +- src/network/model/tag-buffer.cc | 6 +- src/network/test/pcap-file-test-suite.cc | 12 +- src/network/utils/queue.h | 24 +-- .../model/nix-vector-routing.cc | 4 +- src/openflow/examples/openflow-switch.cc | 4 + src/openflow/model/openflow-interface.cc | 6 +- src/openflow/model/openflow-interface.h | 6 +- .../model/openflow-switch-net-device.cc | 28 +-- .../model/openflow-switch-net-device.h | 30 +-- .../test/openflow-switch-test-suite.cc | 7 +- .../model/point-to-point-remote-channel.cc | 2 +- .../model/point-to-point-remote-channel.h | 6 +- src/stats/model/sqlite-data-output.cc | 2 +- src/stats/model/sqlite-data-output.h | 2 +- src/visualizer/model/pyviz.cc | 173 ++++++++++++++++-- src/visualizer/model/visual-simulator-impl.cc | 24 +-- src/visualizer/model/visual-simulator-impl.h | 45 ++--- src/wifi/model/eht/eht-phy.cc | 2 +- src/wifi/model/he/he-phy.cc | 2 +- src/wifi/model/ht/ht-phy.cc | 2 +- src/wifi/model/non-ht/dsss-phy.cc | 2 +- src/wifi/model/non-ht/erp-ofdm-phy.cc | 2 +- src/wifi/model/non-ht/ofdm-phy.cc | 2 +- src/wifi/model/txop.cc | 8 +- src/wifi/model/vht/vht-phy.cc | 2 +- src/wifi/model/wifi-net-device.cc | 4 +- src/wifi/model/wifi-phy.h | 6 +- utils/print-introspected-doxygen.cc | 10 +- 97 files changed, 830 insertions(+), 649 deletions(-) diff --git a/src/brite/helper/brite-topology-helper.cc b/src/brite/helper/brite-topology-helper.cc index ab9b99d26..3d38ffeeb 100644 --- a/src/brite/helper/brite-topology-helper.cc +++ b/src/brite/helper/brite-topology-helper.cc @@ -41,7 +41,7 @@ BriteTopologyHelper::BriteTopologyHelper(std::string confFile, m_seedFile(seedFile), m_newSeedFile(newseedFile), m_numAs(0), - m_topology(NULL), + m_topology(nullptr), m_numNodes(0), m_numEdges(0) { @@ -53,7 +53,7 @@ BriteTopologyHelper::BriteTopologyHelper(std::string confFile, BriteTopologyHelper::BriteTopologyHelper(std::string confFile) : m_confFile(confFile), m_numAs(0), - m_topology(NULL), + m_topology(nullptr), m_numNodes(0), m_numEdges(0) { @@ -93,7 +93,7 @@ BriteTopologyHelper::AssignStreams(int64_t streamNumber) } void -BriteTopologyHelper::BuildBriteNodeInfoList(void) +BriteTopologyHelper::BuildBriteNodeInfoList() { NS_LOG_FUNCTION(this); brite::Graph* g = m_topology->GetGraph(); @@ -139,7 +139,7 @@ BriteTopologyHelper::BuildBriteNodeInfoList(void) break; default: NS_FATAL_ERROR( - "Topology::Output(): Improperly classfied Router node encountered..."); + "Topology::Output(): Improperly classified Router node encountered..."); } break; @@ -165,7 +165,7 @@ BriteTopologyHelper::BuildBriteNodeInfoList(void) nodeInfo.type = "AS_BACKBONE "; break; default: - NS_FATAL_ERROR("Topology::Output(): Improperly classfied AS node encountered..."); + NS_FATAL_ERROR("Topology::Output(): Improperly classified AS node encountered..."); } break; } @@ -180,7 +180,7 @@ BriteTopologyHelper::BuildBriteNodeInfoList(void) } void -BriteTopologyHelper::BuildBriteEdgeInfoList(void) +BriteTopologyHelper::BuildBriteEdgeInfoList() { NS_LOG_FUNCTION(this); brite::Graph* g = m_topology->GetGraph(); @@ -309,7 +309,7 @@ BriteTopologyHelper::GetNEdgesTopology() const } uint32_t -BriteTopologyHelper::GetNAs(void) const +BriteTopologyHelper::GetNAs() const { return m_numAs; } @@ -321,9 +321,9 @@ BriteTopologyHelper::GetSystemNumberForAs(uint32_t asNum) const } void -BriteTopologyHelper::GenerateBriteTopology(void) +BriteTopologyHelper::GenerateBriteTopology() { - NS_ASSERT_MSG(m_topology == NULL, "Brite Topology Already Created"); + NS_ASSERT_MSG(!m_topology, "Brite Topology Already Created"); // check to see if need to generate seed file bool generateSeedFile = m_seedFile.empty(); @@ -436,7 +436,7 @@ BriteTopologyHelper::AssignIpv4Addresses(Ipv4AddressHelper& address) { NS_LOG_FUNCTION(this); // assign IPs - for (unsigned int i = 0; i < m_netDevices.size(); ++i) + for (std::size_t i = 0; i < m_netDevices.size(); ++i) { address.Assign(*m_netDevices[i]); address.NewNetwork(); @@ -448,7 +448,7 @@ BriteTopologyHelper::AssignIpv6Addresses(Ipv6AddressHelper& address) { NS_LOG_FUNCTION(this); - for (unsigned int i = 0; i < m_netDevices.size(); ++i) + for (std::size_t i = 0; i < m_netDevices.size(); ++i) { address.Assign(*m_netDevices[i]); address.NewNetwork(); diff --git a/src/brite/helper/brite-topology-helper.h b/src/brite/helper/brite-topology-helper.h index 1539aaf30..3b3506a2d 100644 --- a/src/brite/helper/brite-topology-helper.h +++ b/src/brite/helper/brite-topology-helper.h @@ -150,7 +150,7 @@ class BriteTopologyHelper * * \returns the number of AS created in the topology */ - uint32_t GetNAs(void) const; + uint32_t GetNAs() const; /** * Returns the system number for the MPI instance that this AS is assigned to. Will always @@ -241,13 +241,13 @@ class BriteTopologyHelper NodeContainer m_nodes; /// Build the Node Info list - void BuildBriteNodeInfoList(void); + void BuildBriteNodeInfoList(); /// Build the Edge Info list - void BuildBriteEdgeInfoList(void); + void BuildBriteEdgeInfoList(); /// Construct the topology. - void ConstructTopology(void); + void ConstructTopology(); /// Generate the BRITE topology. - void GenerateBriteTopology(void); + void GenerateBriteTopology(); /// brite configuration file to use std::string m_confFile; diff --git a/src/brite/test/brite-test-topology.cc b/src/brite/test/brite-test-topology.cc index 0f9f82e47..022d61912 100644 --- a/src/brite/test/brite-test-topology.cc +++ b/src/brite/test/brite-test-topology.cc @@ -43,10 +43,10 @@ class BriteTopologyStructureTestCase : public TestCase { public: BriteTopologyStructureTestCase(); - virtual ~BriteTopologyStructureTestCase(); + ~BriteTopologyStructureTestCase() override; private: - virtual void DoRun(void); + void DoRun() override; }; BriteTopologyStructureTestCase::BriteTopologyStructureTestCase() @@ -60,7 +60,7 @@ BriteTopologyStructureTestCase::~BriteTopologyStructureTestCase() } void -BriteTopologyStructureTestCase::DoRun(void) +BriteTopologyStructureTestCase::DoRun() { std::string confFile = "src/brite/test/test.conf"; @@ -111,10 +111,10 @@ class BriteTopologyFunctionTestCase : public TestCase { public: BriteTopologyFunctionTestCase(); - virtual ~BriteTopologyFunctionTestCase(); + ~BriteTopologyFunctionTestCase() override; private: - virtual void DoRun(void); + void DoRun() override; }; BriteTopologyFunctionTestCase::BriteTopologyFunctionTestCase() @@ -127,7 +127,7 @@ BriteTopologyFunctionTestCase::~BriteTopologyFunctionTestCase() } void -BriteTopologyFunctionTestCase::DoRun(void) +BriteTopologyFunctionTestCase::DoRun() { std::string confFile = "src/brite/test/test.conf"; BriteTopologyHelper bth(confFile); diff --git a/src/click/examples/nsclick-defines.cc b/src/click/examples/nsclick-defines.cc index 58f201d96..dd1a0e619 100644 --- a/src/click/examples/nsclick-defines.cc +++ b/src/click/examples/nsclick-defines.cc @@ -69,4 +69,6 @@ main(int argc, char* argv[]) #else NS_FATAL_ERROR("Can't use ns-3-click without NSCLICK compiled in"); #endif + + return 0; } diff --git a/src/click/examples/nsclick-raw-wlan.cc b/src/click/examples/nsclick-raw-wlan.cc index e5900ae5d..47c669fcb 100644 --- a/src/click/examples/nsclick-raw-wlan.cc +++ b/src/click/examples/nsclick-raw-wlan.cc @@ -150,8 +150,9 @@ main(int argc, char* argv[]) Simulator::Run(); Simulator::Destroy(); - return 0; #else NS_FATAL_ERROR("Can't use ns-3-click without NSCLICK compiled in"); #endif + + return 0; } diff --git a/src/click/examples/nsclick-routing.cc b/src/click/examples/nsclick-routing.cc index 1757da9ce..82fd143db 100644 --- a/src/click/examples/nsclick-routing.cc +++ b/src/click/examples/nsclick-routing.cc @@ -134,4 +134,6 @@ main(int argc, char* argv[]) #else NS_FATAL_ERROR("Can't use ns-3-click without NSCLICK compiled in"); #endif + + return 0; } diff --git a/src/click/examples/nsclick-simple-lan.cc b/src/click/examples/nsclick-simple-lan.cc index 764e593a2..fc6f38e42 100644 --- a/src/click/examples/nsclick-simple-lan.cc +++ b/src/click/examples/nsclick-simple-lan.cc @@ -104,8 +104,9 @@ main(int argc, char* argv[]) Simulator::Run(); Simulator::Destroy(); - return 0; #else NS_FATAL_ERROR("Can't use ns-3-click without NSCLICK compiled in"); #endif + + return 0; } diff --git a/src/click/examples/nsclick-udp-client-server-csma.cc b/src/click/examples/nsclick-udp-client-server-csma.cc index b96d6e29d..6a2264234 100644 --- a/src/click/examples/nsclick-udp-client-server-csma.cc +++ b/src/click/examples/nsclick-udp-client-server-csma.cc @@ -133,4 +133,6 @@ main(int argc, char* argv[]) #else NS_FATAL_ERROR("Can't use ns-3-click without NSCLICK compiled in"); #endif + + return 0; } diff --git a/src/click/examples/nsclick-udp-client-server-wifi.cc b/src/click/examples/nsclick-udp-client-server-wifi.cc index 7bac7d5e5..c601ac2ef 100644 --- a/src/click/examples/nsclick-udp-client-server-wifi.cc +++ b/src/click/examples/nsclick-udp-client-server-wifi.cc @@ -219,4 +219,6 @@ main(int argc, char* argv[]) #else NS_FATAL_ERROR("Can't use ns-3-click without NSCLICK compiled in"); #endif + + return 0; } diff --git a/src/click/helper/click-internet-stack-helper.cc b/src/click/helper/click-internet-stack-helper.cc index 353d77c14..ee800ddc3 100644 --- a/src/click/helper/click-internet-stack-helper.cc +++ b/src/click/helper/click-internet-stack-helper.cc @@ -94,7 +94,7 @@ ClickInternetStackHelper::operator=(const ClickInternetStackHelper& o) } void -ClickInternetStackHelper::Reset(void) +ClickInternetStackHelper::Reset() { m_ipv4Enabled = true; Initialize(); @@ -168,7 +168,7 @@ ClickInternetStackHelper::Install(NodeContainer c) const } void -ClickInternetStackHelper::InstallAll(void) const +ClickInternetStackHelper::InstallAll() const { Install(NodeContainer::GetGlobal()); } diff --git a/src/click/helper/click-internet-stack-helper.h b/src/click/helper/click-internet-stack-helper.h index 0fa496be5..f0f039782 100644 --- a/src/click/helper/click-internet-stack-helper.h +++ b/src/click/helper/click-internet-stack-helper.h @@ -53,19 +53,19 @@ class ClickInternetStackHelper : public PcapHelperForIpv4, public AsciiTraceHelp /** * Create a new ClickInternetStackHelper which uses Ipv4ClickRouting for routing */ - ClickInternetStackHelper(void); + ClickInternetStackHelper(); /** * Destroy the ClickInternetStackHelper */ - virtual ~ClickInternetStackHelper(void); + ~ClickInternetStackHelper() override; ClickInternetStackHelper(const ClickInternetStackHelper&); ClickInternetStackHelper& operator=(const ClickInternetStackHelper& o); /** * Return helper internal state to that of a newly constructed one */ - void Reset(void); + void Reset(); /** * Aggregate implementations of the ns3::Ipv4L3ClickProtocol, ns3::ArpL3Protocol, @@ -99,7 +99,7 @@ class ClickInternetStackHelper : public PcapHelperForIpv4, public AsciiTraceHelp /** * Aggregate IPv4, UDP, and TCP stacks to all nodes in the simulation */ - void InstallAll(void) const; + void InstallAll() const; /** * \brief set the Tcp stack which will not need any other parameter. @@ -179,10 +179,10 @@ class ClickInternetStackHelper : public PcapHelperForIpv4, public AsciiTraceHelp * @param ipv4 Ptr to the Ipv4 interface on which you want to enable tracing. * @param interface Interface ID on the Ipv4 on which you want to enable tracing. */ - virtual void EnablePcapIpv4Internal(std::string prefix, - Ptr ipv4, - uint32_t interface, - bool explicitFilename); + void EnablePcapIpv4Internal(std::string prefix, + Ptr ipv4, + uint32_t interface, + bool explicitFilename) override; /** * @brief Enable ascii trace output on the indicated Ipv4 and interface pair. @@ -193,18 +193,18 @@ class ClickInternetStackHelper : public PcapHelperForIpv4, public AsciiTraceHelp * @param ipv4 Ptr to the Ipv4 interface on which you want to enable tracing. * @param interface Interface ID on the Ipv4 on which you want to enable tracing. */ - virtual void EnableAsciiIpv4Internal(Ptr stream, - std::string prefix, - Ptr ipv4, - uint32_t interface, - bool explicitFilename); + void EnableAsciiIpv4Internal(Ptr stream, + std::string prefix, + Ptr ipv4, + uint32_t interface, + bool explicitFilename) override; - void Initialize(void); + void Initialize(); ObjectFactory m_tcpFactory; static void CreateAndAggregateObjectFromTypeId(Ptr node, const std::string typeId); - static void Cleanup(void); + static void Cleanup(); bool PcapHooked(Ptr ipv4); diff --git a/src/click/model/ipv4-click-routing.cc b/src/click/model/ipv4-click-routing.cc index 5c56334a5..9bf8301cd 100644 --- a/src/click/model/ipv4-click-routing.cc +++ b/src/click/model/ipv4-click-routing.cc @@ -49,7 +49,7 @@ NS_OBJECT_ENSURE_REGISTERED(Ipv4ClickRouting); std::map> Ipv4ClickRouting::m_clickInstanceFromSimNode; TypeId -Ipv4ClickRouting::GetTypeId(void) +Ipv4ClickRouting::GetTypeId() { static TypeId tid = TypeId("ns3::Ipv4ClickRouting") .SetParent() @@ -112,7 +112,7 @@ Ipv4ClickRouting::SetIpv4(Ptr ipv4) } Ptr -Ipv4ClickRouting::GetRandomVariable(void) +Ipv4ClickRouting::GetRandomVariable() { return m_random; } @@ -142,7 +142,7 @@ Ipv4ClickRouting::SetDefines(std::map defines) } std::map -Ipv4ClickRouting::GetDefines(void) +Ipv4ClickRouting::GetDefines() { return m_defines; } @@ -630,7 +630,7 @@ simclick_sim_send(simclick_node_t* simnode, << ifid << " " << type << " " << data << " " << len); - if (simnode == NULL) + if (!simnode) { return -1; } diff --git a/src/click/model/ipv4-click-routing.h b/src/click/model/ipv4-click-routing.h index a4104517c..e6897e893 100644 --- a/src/click/model/ipv4-click-routing.h +++ b/src/click/model/ipv4-click-routing.h @@ -65,18 +65,18 @@ class Ipv4ClickRouting : public Ipv4RoutingProtocol friend class ::ClickIfidFromNameTest; friend class ::ClickIpMacAddressFromNameTest; - static TypeId GetTypeId(void); + static TypeId GetTypeId(); Ipv4ClickRouting(); - virtual ~Ipv4ClickRouting(); + ~Ipv4ClickRouting() override; - Ptr GetRandomVariable(void); + Ptr GetRandomVariable(); protected: - virtual void DoInitialize(void); + void DoInitialize() override; public: - virtual void DoDispose(); + void DoDispose() override; /** * \brief Click configuration file to be used by the node's Click Instance. @@ -148,7 +148,7 @@ class Ipv4ClickRouting : public Ipv4RoutingProtocol * \brief Provides for SIMCLICK_GET_DEFINES * \return The defines mapping for .click configuration file parsing */ - std::map GetDefines(void); + std::map GetDefines(); /** * \brief Provides for SIMCLICK_IFID_FROM_NAME @@ -194,7 +194,7 @@ class Ipv4ClickRouting : public Ipv4RoutingProtocol * \brief Set the Ipv4 instance to be used * \param ipv4 The Ipv4 instance */ - virtual void SetIpv4(Ptr ipv4); + void SetIpv4(Ptr ipv4) override; private: /** @@ -255,23 +255,23 @@ class Ipv4ClickRouting : public Ipv4RoutingProtocol void Receive(Ptr p, Mac48Address receiverAddr, Mac48Address dest); // From Ipv4RoutingProtocol - virtual Ptr RouteOutput(Ptr p, - const Ipv4Header& header, - Ptr oif, - Socket::SocketErrno& sockerr); - virtual bool RouteInput(Ptr p, - const Ipv4Header& header, - Ptr idev, - UnicastForwardCallback ucb, - MulticastForwardCallback mcb, - LocalDeliverCallback lcb, - ErrorCallback ecb); - virtual void PrintRoutingTable(Ptr stream, - Time::Unit unit = Time::S) const; - virtual void NotifyInterfaceUp(uint32_t interface); - virtual void NotifyInterfaceDown(uint32_t interface); - virtual void NotifyAddAddress(uint32_t interface, Ipv4InterfaceAddress address); - virtual void NotifyRemoveAddress(uint32_t interface, Ipv4InterfaceAddress address); + Ptr RouteOutput(Ptr p, + const Ipv4Header& header, + Ptr oif, + Socket::SocketErrno& sockerr) override; + bool RouteInput(Ptr p, + const Ipv4Header& header, + Ptr idev, + UnicastForwardCallback ucb, + MulticastForwardCallback mcb, + LocalDeliverCallback lcb, + ErrorCallback ecb) override; + void PrintRoutingTable(Ptr stream, + Time::Unit unit = Time::S) const override; + void NotifyInterfaceUp(uint32_t interface) override; + void NotifyInterfaceDown(uint32_t interface) override; + void NotifyAddAddress(uint32_t interface, Ipv4InterfaceAddress address) override; + void NotifyRemoveAddress(uint32_t interface, Ipv4InterfaceAddress address) override; private: std::string m_clickFile; diff --git a/src/click/model/ipv4-l3-click-protocol.cc b/src/click/model/ipv4-l3-click-protocol.cc index 7549fbb1a..227a90861 100644 --- a/src/click/model/ipv4-l3-click-protocol.cc +++ b/src/click/model/ipv4-l3-click-protocol.cc @@ -46,7 +46,7 @@ const uint16_t Ipv4L3ClickProtocol::PROT_NUMBER = 0x0800; NS_OBJECT_ENSURE_REGISTERED(Ipv4L3ClickProtocol); TypeId -Ipv4L3ClickProtocol::GetTypeId(void) +Ipv4L3ClickProtocol::GetTypeId() { static TypeId tid = TypeId("ns3::Ipv4L3ClickProtocol") @@ -77,7 +77,7 @@ Ipv4L3ClickProtocol::~Ipv4L3ClickProtocol() } void -Ipv4L3ClickProtocol::DoDispose(void) +Ipv4L3ClickProtocol::DoDispose() { NS_LOG_FUNCTION(this); for (L4List_t::iterator i = m_protocols.begin(); i != m_protocols.end(); ++i) @@ -94,8 +94,8 @@ Ipv4L3ClickProtocol::DoDispose(void) m_reverseInterfacesContainer.clear(); m_sockets.clear(); - m_node = 0; - m_routingProtocol = 0; + m_node = nullptr; + m_routingProtocol = nullptr; Object::DoDispose(); } @@ -124,7 +124,7 @@ Ipv4L3ClickProtocol::SetRoutingProtocol(Ptr routingProtocol } Ptr -Ipv4L3ClickProtocol::GetRoutingProtocol(void) const +Ipv4L3ClickProtocol::GetRoutingProtocol() const { return m_routingProtocol; } @@ -141,7 +141,7 @@ Ipv4L3ClickProtocol::GetInterface(uint32_t index) const } uint32_t -Ipv4L3ClickProtocol::GetNInterfaces(void) const +Ipv4L3ClickProtocol::GetNInterfaces() const { NS_LOG_FUNCTION_NOARGS(); return m_interfaces.size(); @@ -283,7 +283,7 @@ Ipv4L3ClickProtocol::SetIpForward(bool forward) } bool -Ipv4L3ClickProtocol::GetIpForward(void) const +Ipv4L3ClickProtocol::GetIpForward() const { return m_ipForward; } @@ -295,7 +295,7 @@ Ipv4L3ClickProtocol::SetWeakEsModel(bool model) } bool -Ipv4L3ClickProtocol::GetWeakEsModel(void) const +Ipv4L3ClickProtocol::GetWeakEsModel() const { return m_weakEsModel; } @@ -315,7 +315,7 @@ Ipv4L3ClickProtocol::SetDefaultTtl(uint8_t ttl) } void -Ipv4L3ClickProtocol::SetupLoopback(void) +Ipv4L3ClickProtocol::SetupLoopback() { NS_LOG_FUNCTION_NOARGS(); @@ -352,7 +352,7 @@ Ipv4L3ClickProtocol::SetupLoopback(void) } Ptr -Ipv4L3ClickProtocol::CreateRawSocket(void) +Ipv4L3ClickProtocol::CreateRawSocket() { NS_LOG_FUNCTION(this); Ptr socket = CreateObject(); @@ -373,7 +373,6 @@ Ipv4L3ClickProtocol::DeleteRawSocket(Ptr socket) return; } } - return; } void @@ -725,7 +724,6 @@ Ipv4L3ClickProtocol::Send(Ptr packet, } packet->AddHeader(ipHeader); click->Send(packet->Copy(), source, destination); - return; } void @@ -882,7 +880,7 @@ Ipv4L3ClickProtocol::LocalDeliver(Ptr packet, const Ipv4Header& ip } Ptr -Ipv4L3ClickProtocol::GetIcmp(void) const +Ipv4L3ClickProtocol::GetIcmp() const { Ptr prot = GetProtocol(Icmpv4L4Protocol::GetStaticProtocolNumber()); if (prot) diff --git a/src/click/model/ipv4-l3-click-protocol.h b/src/click/model/ipv4-l3-click-protocol.h index 102cf31b4..6f36f9cee 100644 --- a/src/click/model/ipv4-l3-click-protocol.h +++ b/src/click/model/ipv4-l3-click-protocol.h @@ -62,7 +62,7 @@ class Ipv4L3ClickProtocol : public Ipv4 { #ifdef NS3_CLICK public: - static TypeId GetTypeId(void); + static TypeId GetTypeId(); /** * Protocol number for Ipv4 L3 (0x0800). @@ -70,18 +70,18 @@ class Ipv4L3ClickProtocol : public Ipv4 static const uint16_t PROT_NUMBER; Ipv4L3ClickProtocol(); - virtual ~Ipv4L3ClickProtocol(); + ~Ipv4L3ClickProtocol() override; - virtual void Insert(Ptr protocol); - virtual void Insert(Ptr protocol, uint32_t interfaceIndex); + void Insert(Ptr protocol) override; + void Insert(Ptr protocol, uint32_t interfaceIndex) override; - virtual void Remove(Ptr protocol); - virtual void Remove(Ptr protocol, uint32_t interfaceIndex); + void Remove(Ptr protocol) override; + void Remove(Ptr protocol, uint32_t interfaceIndex) override; - virtual Ptr GetProtocol(int protocolNumber) const; - virtual Ptr GetProtocol(int protocolNumber, int32_t interfaceIndex) const; + Ptr GetProtocol(int protocolNumber) const override; + Ptr GetProtocol(int protocolNumber, int32_t interfaceIndex) const override; - virtual Ipv4Address SourceAddressSelection(uint32_t interface, Ipv4Address dest); + Ipv4Address SourceAddressSelection(uint32_t interface, Ipv4Address dest) override; /** * \param ttl default ttl to use @@ -105,7 +105,7 @@ class Ipv4L3ClickProtocol : public Ipv4 Ipv4Address source, Ipv4Address destination, uint8_t protocol, - Ptr route); + Ptr route) override; /** * \param packet packet to send @@ -115,7 +115,7 @@ class Ipv4L3ClickProtocol : public Ipv4 * Higher-level layers call this method to send a packet with IPv4 Header * (Intend to be used with IpHeaderInclude attribute.) */ - void SendWithHeader(Ptr packet, Ipv4Header ipHeader, Ptr route); + void SendWithHeader(Ptr packet, Ipv4Header ipHeader, Ptr route) override; /** * \param packet packet to send down the stack @@ -174,66 +174,66 @@ class Ipv4L3ClickProtocol : public Ipv4 * Returns the Icmpv4L4Protocol for the node * \returns Icmpv4L4Protocol instance of the node */ - Ptr GetIcmp(void) const; + Ptr GetIcmp() const; /** * Sets up a Loopback device */ - void SetupLoopback(void); + void SetupLoopback(); /** * Creates a raw-socket * \returns Pointer to the created socket */ - Ptr CreateRawSocket(void); + Ptr CreateRawSocket() override; /** * Deletes a particular raw socket * \param socket Pointer of socket to be deleted */ - void DeleteRawSocket(Ptr socket); + void DeleteRawSocket(Ptr socket) override; // functions defined in base class Ipv4 - void SetRoutingProtocol(Ptr routingProtocol); - Ptr GetRoutingProtocol(void) const; + void SetRoutingProtocol(Ptr routingProtocol) override; + Ptr GetRoutingProtocol() const override; - Ptr GetNetDevice(uint32_t i); + Ptr GetNetDevice(uint32_t i) override; - uint32_t AddInterface(Ptr device); - uint32_t GetNInterfaces(void) const; + uint32_t AddInterface(Ptr device) override; + uint32_t GetNInterfaces() const override; - int32_t GetInterfaceForAddress(Ipv4Address addr) const; - int32_t GetInterfaceForPrefix(Ipv4Address addr, Ipv4Mask mask) const; - int32_t GetInterfaceForDevice(Ptr device) const; - bool IsDestinationAddress(Ipv4Address address, uint32_t iif) const; + int32_t GetInterfaceForAddress(Ipv4Address addr) const override; + int32_t GetInterfaceForPrefix(Ipv4Address addr, Ipv4Mask mask) const override; + int32_t GetInterfaceForDevice(Ptr device) const override; + bool IsDestinationAddress(Ipv4Address address, uint32_t iif) const override; - bool AddAddress(uint32_t i, Ipv4InterfaceAddress address); - Ipv4InterfaceAddress GetAddress(uint32_t interfaceIndex, uint32_t addressIndex) const; - uint32_t GetNAddresses(uint32_t interface) const; - bool RemoveAddress(uint32_t interfaceIndex, uint32_t addressIndex); - bool RemoveAddress(uint32_t interfaceIndex, Ipv4Address address); + bool AddAddress(uint32_t i, Ipv4InterfaceAddress address) override; + Ipv4InterfaceAddress GetAddress(uint32_t interfaceIndex, uint32_t addressIndex) const override; + uint32_t GetNAddresses(uint32_t interface) const override; + bool RemoveAddress(uint32_t interfaceIndex, uint32_t addressIndex) override; + bool RemoveAddress(uint32_t interfaceIndex, Ipv4Address address) override; Ipv4Address SelectSourceAddress(Ptr device, Ipv4Address dst, - Ipv4InterfaceAddress::InterfaceAddressScope_e scope); + Ipv4InterfaceAddress::InterfaceAddressScope_e scope) override; - void SetMetric(uint32_t i, uint16_t metric); - uint16_t GetMetric(uint32_t i) const; - uint16_t GetMtu(uint32_t i) const; - bool IsUp(uint32_t i) const; - void SetUp(uint32_t i); - void SetDown(uint32_t i); - bool IsForwarding(uint32_t i) const; - void SetForwarding(uint32_t i, bool val); + void SetMetric(uint32_t i, uint16_t metric) override; + uint16_t GetMetric(uint32_t i) const override; + uint16_t GetMtu(uint32_t i) const override; + bool IsUp(uint32_t i) const override; + void SetUp(uint32_t i) override; + void SetDown(uint32_t i) override; + bool IsForwarding(uint32_t i) const override; + void SetForwarding(uint32_t i, bool val) override; void SetPromisc(uint32_t i); protected: - virtual void DoDispose(void); + void DoDispose() override; /** * This function will notify other components connected to the node that a new stack member is * now connected This will be used to notify Layer 3 protocol of layer 4 protocol stack to * connect them together. */ - virtual void NotifyNewAggregate(); + void NotifyNewAggregate() override; private: Ipv4Header BuildHeader(Ipv4Address source, @@ -243,10 +243,10 @@ class Ipv4L3ClickProtocol : public Ipv4 uint8_t ttl, bool mayFragment); - virtual void SetIpForward(bool forward); - virtual bool GetIpForward(void) const; - virtual void SetWeakEsModel(bool model); - virtual bool GetWeakEsModel(void) const; + void SetIpForward(bool forward) override; + bool GetIpForward() const override; + void SetWeakEsModel(bool model) override; + bool GetWeakEsModel() const override; typedef std::vector> Ipv4InterfaceList; /** diff --git a/src/click/test/ipv4-click-routing-test.cc b/src/click/test/ipv4-click-routing-test.cc index 32ec41026..89709668e 100644 --- a/src/click/test/ipv4-click-routing-test.cc +++ b/src/click/test/ipv4-click-routing-test.cc @@ -59,7 +59,7 @@ class ClickIfidFromNameTest : public TestCase { public: ClickIfidFromNameTest(); - virtual void DoRun(); + void DoRun() override; }; ClickIfidFromNameTest::ClickIfidFromNameTest() @@ -105,7 +105,7 @@ class ClickIpMacAddressFromNameTest : public TestCase { public: ClickIpMacAddressFromNameTest(); - virtual void DoRun(); + void DoRun() override; }; ClickIpMacAddressFromNameTest::ClickIpMacAddressFromNameTest() @@ -130,8 +130,7 @@ ClickIpMacAddressFromNameTest::DoRun() Ptr click = DynamicCast(ipv4->GetRoutingProtocol()); click->DoInitialize(); - char* buf = NULL; - buf = new char[255]; + char* buf = new char[255]; simclick_sim_command(click->m_simNode, SIMCLICK_IPADDR_FROM_NAME, "eth0", buf, 255); NS_TEST_EXPECT_MSG_EQ(strcmp(buf, "10.1.1.1"), 0, "eth0 has IP 10.1.1.1"); @@ -166,7 +165,7 @@ class ClickTrivialTest : public TestCase { public: ClickTrivialTest(); - virtual void DoRun(); + void DoRun() override; }; ClickTrivialTest::ClickTrivialTest() @@ -189,8 +188,7 @@ ClickTrivialTest::DoRun() click->DoInitialize(); int ret = 0; - char* buf = NULL; - buf = new char[255]; + char* buf = new char[255]; ret = simclick_sim_command(click->m_simNode, SIMCLICK_GET_NODE_NAME, buf, 255); NS_TEST_EXPECT_MSG_EQ(strcmp(buf, "myNode"), 0, "Node name is Node"); diff --git a/src/config-store/model/gtk-config-store.cc b/src/config-store/model/gtk-config-store.cc index 3ad4cab97..4e7d63f6b 100644 --- a/src/config-store/model/gtk-config-store.cc +++ b/src/config-store/model/gtk-config-store.cc @@ -35,7 +35,7 @@ GtkConfigStore::GtkConfigStore() } void -GtkConfigStore::ConfigureDefaults(void) +GtkConfigStore::ConfigureDefaults() { // this function should be called before running the script to enable the user // to configure the default values for the objects he wants to use @@ -84,7 +84,7 @@ GtkConfigStore::ConfigureDefaults(void) } void -GtkConfigStore::ConfigureAttributes(void) +GtkConfigStore::ConfigureAttributes() { GtkWidget* window; GtkWidget* view; diff --git a/src/config-store/model/gtk-config-store.h b/src/config-store/model/gtk-config-store.h index ae8d34a26..45d8bb049 100644 --- a/src/config-store/model/gtk-config-store.h +++ b/src/config-store/model/gtk-config-store.h @@ -35,11 +35,11 @@ class GtkConfigStore /** * Process default values */ - void ConfigureDefaults(void); + void ConfigureDefaults(); /** * Process attribute values */ - void ConfigureAttributes(void); + void ConfigureAttributes(); }; } // namespace ns3 diff --git a/src/config-store/model/model-node-creator.cc b/src/config-store/model/model-node-creator.cc index c98e3d93d..dcae70944 100644 --- a/src/config-store/model/model-node-creator.cc +++ b/src/config-store/model/model-node-creator.cc @@ -48,7 +48,7 @@ ModelCreator::Add(ModelNode* node) } void -ModelCreator::Remove(void) +ModelCreator::Remove() { GtkTreeIter* iter = m_iters.back(); g_free(iter); @@ -76,7 +76,7 @@ ModelCreator::DoStartVisitObject(Ptr object) } void -ModelCreator::DoEndVisitObject(void) +ModelCreator::DoEndVisitObject() { Remove(); } @@ -92,7 +92,7 @@ ModelCreator::DoStartVisitPointerAttribute(Ptr object, std::string name, } void -ModelCreator::DoEndVisitPointerAttribute(void) +ModelCreator::DoEndVisitPointerAttribute() { Remove(); } @@ -110,7 +110,7 @@ ModelCreator::DoStartVisitArrayAttribute(Ptr object, } void -ModelCreator::DoEndVisitArrayAttribute(void) +ModelCreator::DoEndVisitArrayAttribute() { Remove(); } @@ -132,7 +132,7 @@ ModelCreator::DoStartVisitArrayItem(const ObjectPtrContainerValue& vector, } void -ModelCreator::DoEndVisitArrayItem(void) +ModelCreator::DoEndVisitArrayItem() { GtkTreeIter* iter = m_iters.back(); g_free(iter); diff --git a/src/config-store/model/model-node-creator.h b/src/config-store/model/model-node-creator.h index b1dd93acf..c8e5b04d0 100644 --- a/src/config-store/model/model-node-creator.h +++ b/src/config-store/model/model-node-creator.h @@ -76,28 +76,28 @@ class ModelCreator : public AttributeIterator void Build(GtkTreeStore* treestore); private: - virtual void DoVisitAttribute(Ptr object, std::string name); - virtual void DoStartVisitObject(Ptr object); - virtual void DoEndVisitObject(void); - virtual void DoStartVisitPointerAttribute(Ptr object, - std::string name, - Ptr value); - virtual void DoEndVisitPointerAttribute(void); - virtual void DoStartVisitArrayAttribute(Ptr object, - std::string name, - const ObjectPtrContainerValue& vector); - virtual void DoEndVisitArrayAttribute(void); - virtual void DoStartVisitArrayItem(const ObjectPtrContainerValue& vector, - uint32_t index, - Ptr item); - virtual void DoEndVisitArrayItem(void); + void DoVisitAttribute(Ptr object, std::string name) override; + void DoStartVisitObject(Ptr object) override; + void DoEndVisitObject() override; + void DoStartVisitPointerAttribute(Ptr object, + std::string name, + Ptr value) override; + void DoEndVisitPointerAttribute() override; + void DoStartVisitArrayAttribute(Ptr object, + std::string name, + const ObjectPtrContainerValue& vector) override; + void DoEndVisitArrayAttribute() override; + void DoStartVisitArrayItem(const ObjectPtrContainerValue& vector, + uint32_t index, + Ptr item) override; + void DoEndVisitArrayItem() override; /** * Add item to attribute tree * \param node The model node */ void Add(ModelNode* node); /// Remove current tree item - void Remove(void); + void Remove(); GtkTreeStore* m_treestore; ///< attribute tree std::vector m_iters; ///< attribute tree item diff --git a/src/config-store/model/model-typeid-creator.cc b/src/config-store/model/model-typeid-creator.cc index 82f425052..cee40556e 100644 --- a/src/config-store/model/model-typeid-creator.cc +++ b/src/config-store/model/model-typeid-creator.cc @@ -45,7 +45,7 @@ ModelTypeidCreator::Add(ModelTypeid* node) } void -ModelTypeidCreator::Remove(void) +ModelTypeidCreator::Remove() { GtkTreeIter* iter = m_iters.back(); g_free(iter); @@ -78,7 +78,7 @@ ModelTypeidCreator::StartVisitTypeId(std::string name) } void -ModelTypeidCreator::EndVisitTypeId(void) +ModelTypeidCreator::EndVisitTypeId() { Remove(); } diff --git a/src/config-store/model/model-typeid-creator.h b/src/config-store/model/model-typeid-creator.h index f8ecbed1b..980a88b57 100644 --- a/src/config-store/model/model-typeid-creator.h +++ b/src/config-store/model/model-typeid-creator.h @@ -95,7 +95,7 @@ class ModelTypeidCreator : public AttributeDefaultIterator /** * \brief Remove the last gtk tree iterator */ - virtual void EndVisitTypeId(void); + virtual void EndVisitTypeId(); /** * \brief Adds a treestore iterator to m_treestore model * \param node the node to be added @@ -104,7 +104,7 @@ class ModelTypeidCreator : public AttributeDefaultIterator /** * Removes the last GtkTreeIterator from m_iters */ - void Remove(void); + void Remove(); /// this is the TreeStore model corresponding to the view GtkTreeStore* m_treestore; /// This contains a vector of iterators used to build the TreeStore diff --git a/src/core/model/attribute-accessor-helper.h b/src/core/model/attribute-accessor-helper.h index c28eb610a..55256761a 100644 --- a/src/core/model/attribute-accessor-helper.h +++ b/src/core/model/attribute-accessor-helper.h @@ -38,7 +38,7 @@ namespace ns3 * * The get functor method should have a signature like * \code - * typedef U (T::*getter)(void) const + * typedef U (T::*getter)() const * \endcode * where \pname{T} is the class and \pname{U} is the type of * the return value. @@ -76,7 +76,7 @@ inline Ptr MakeAccessorHelper(T1 a1); * * The get functor method should have a signature like * \code - * typedef U (T::*getter)(void) const + * typedef U (T::*getter)() const * \endcode * where \pname{T} is the class and \pname{U} is the type of * the return value. diff --git a/src/core/model/attribute-helper.h b/src/core/model/attribute-helper.h index 33d809a7b..a0f453bba 100644 --- a/src/core/model/attribute-helper.h +++ b/src/core/model/attribute-helper.h @@ -73,7 +73,7 @@ namespace ns3 * * There are three versions of DoMakeAccessorHelperOne: * - With a member variable: DoMakeAccessorHelperOne(U T::*) - * - With a class get functor: DoMakeAccessorHelperOne(U(T::*)(void) const) + * - With a class get functor: DoMakeAccessorHelperOne(U(T::*)() const) * - With a class set method: DoMakeAccessorHelperOne(void(T::*)(U)) * * There are two pairs of DoMakeAccessorHelperTwo (four total): @@ -202,17 +202,17 @@ MakeSimpleAttributeChecker(std::string name, std::string underlying) name##Value(); \ name##Value(const type& value); \ void Set(const type& value); \ - type Get(void) const; \ + type Get() const; \ template \ bool GetAccessor(T& value) const \ { \ value = T(m_value); \ return true; \ } \ - virtual Ptr Copy(void) const; \ - virtual std::string SerializeToString(Ptr checker) const; \ - virtual bool DeserializeFromString(std::string value, \ - Ptr checker); \ + Ptr Copy() const override; \ + std::string SerializeToString(Ptr checker) const override; \ + bool DeserializeFromString(std::string value, \ + Ptr checker) override; \ \ private: \ type m_value; \ @@ -268,7 +268,7 @@ MakeSimpleAttributeChecker(std::string name, std::string underlying) class type##Checker : public AttributeChecker \ { \ }; \ - Ptr Make##type##Checker(void) + Ptr Make##type##Checker() /** * \ingroup attributehelper @@ -299,11 +299,11 @@ MakeSimpleAttributeChecker(std::string name, std::string underlying) { \ m_value = v; \ } \ - type name##Value::Get(void) const \ + type name##Value::Get() const \ { \ return m_value; \ } \ - Ptr name##Value::Copy(void) const \ + Ptr name##Value::Copy() const \ { \ return ns3::Create(*this); \ } \ @@ -354,7 +354,7 @@ MakeSimpleAttributeChecker(std::string name, std::string underlying) * Typically invoked in the source file.. */ #define ATTRIBUTE_CHECKER_IMPLEMENT(type) \ - Ptr Make##type##Checker(void) \ + Ptr Make##type##Checker() \ { \ return MakeSimpleAttributeChecker(#type "Value", #type); \ } @@ -373,7 +373,7 @@ MakeSimpleAttributeChecker(std::string name, std::string underlying) * Typically invoked in the source file.. */ #define ATTRIBUTE_CHECKER_IMPLEMENT_WITH_NAME(type, name) \ - Ptr Make##type##Checker(void) \ + Ptr Make##type##Checker() \ { \ return MakeSimpleAttributeChecker(#type "Value", name); \ } diff --git a/src/core/model/breakpoint.cc b/src/core/model/breakpoint.cc index 4ae8637fb..a10bf1c23 100644 --- a/src/core/model/breakpoint.cc +++ b/src/core/model/breakpoint.cc @@ -63,7 +63,7 @@ BreakpointFallback() */ if (a == nullptr) { - *a = 0; + *a = nullptr; } } diff --git a/src/core/model/int64x64-cairo.h b/src/core/model/int64x64-cairo.h index c9071c338..bf2ed1a5a 100644 --- a/src/core/model/int64x64-cairo.h +++ b/src/core/model/int64x64-cairo.h @@ -220,7 +220,7 @@ class int64x64_t * * \return This value in floating form. */ - inline double GetDouble(void) const + inline double GetDouble() const { const bool negative = _cairo_int128_negative(_v); const cairo_int128_t value = negative ? _cairo_int128_negate(_v) : _v; @@ -237,7 +237,7 @@ class int64x64_t * * \return The integer portion of this value. */ - inline int64_t GetHigh(void) const + inline int64_t GetHigh() const { return (int64_t)_v.hi; } @@ -247,7 +247,7 @@ class int64x64_t * * \return The fractional portion, unscaled, as an integer. */ - inline uint64_t GetLow(void) const + inline uint64_t GetLow() const { return _v.lo; } @@ -257,7 +257,7 @@ class int64x64_t * Truncation is always toward zero, * \return The value truncated toward zero. */ - int64_t GetInt(void) const + int64_t GetInt() const { const bool negative = _cairo_int128_negative(_v); const cairo_int128_t value = negative ? _cairo_int128_negate(_v) : _v; @@ -272,7 +272,7 @@ class int64x64_t * regardless of the current (floating) rounding mode. * \return The value rounded to the nearest int. */ - int64_t Round(void) const + int64_t Round() const { const bool negative = _cairo_int128_negative(_v); cairo_uint128_t value = negative ? _cairo_int128_negate(_v) : _v; diff --git a/src/core/model/int64x64-double.h b/src/core/model/int64x64-double.h index 2341c0ac0..9b2a441ef 100644 --- a/src/core/model/int64x64-double.h +++ b/src/core/model/int64x64-double.h @@ -192,7 +192,7 @@ class int64x64_t * * \return This value in floating form. */ - inline double GetDouble(void) const + inline double GetDouble() const { return (double)_v; } @@ -203,7 +203,7 @@ class int64x64_t * * \return A pair of the high and low words */ - std::pair GetHighLow(void) const + std::pair GetHighLow() const { const bool negative = _v < 0; const long double v = negative ? -_v : _v; @@ -245,7 +245,7 @@ class int64x64_t * * \return The integer portion of this value. */ - inline int64_t GetHigh(void) const + inline int64_t GetHigh() const { return GetHighLow().first; } @@ -255,7 +255,7 @@ class int64x64_t * * \return The fractional portion, unscaled, as an integer. */ - inline uint64_t GetLow(void) const + inline uint64_t GetLow() const { return GetHighLow().second; } @@ -265,7 +265,7 @@ class int64x64_t * Truncation is always toward zero, * \return The value truncated toward zero. */ - int64_t GetInt(void) const + int64_t GetInt() const { int64_t retval = static_cast(_v); return retval; @@ -277,7 +277,7 @@ class int64x64_t * regardless of the current (floating) rounding mode. * \return The value rounded to the nearest int. */ - int64_t Round(void) const + int64_t Round() const { int64_t retval = std::round(_v); return retval; diff --git a/src/core/model/make-event.cc b/src/core/model/make-event.cc index fea550e79..8c32592a5 100644 --- a/src/core/model/make-event.cc +++ b/src/core/model/make-event.cc @@ -23,7 +23,7 @@ /** * \file * \ingroup events - * ns3::MakeEvent(void(*f)(void)) implementation. + * ns3::MakeEvent(void(*f)()) implementation. */ namespace ns3 diff --git a/src/core/model/random-variable-stream.h b/src/core/model/random-variable-stream.h index 79ecad27f..a7ea29eac 100644 --- a/src/core/model/random-variable-stream.h +++ b/src/core/model/random-variable-stream.h @@ -229,14 +229,14 @@ class UniformRandomVariable : public RandomVariableStream UniformRandomVariable(); /** - * \brief Get the lower bound on randoms returned by GetValue(void). - * \return The lower bound on values from GetValue(void). + * \brief Get the lower bound on randoms returned by GetValue(). + * \return The lower bound on values from GetValue(). */ double GetMin() const; /** - * \brief Get the upper bound on values returned by GetValue(void). - * \return The upper bound on values from GetValue(void). + * \brief Get the upper bound on values returned by GetValue(). + * \return The upper bound on values from GetValue(). */ double GetMax() const; diff --git a/src/core/model/simulator-impl.h b/src/core/model/simulator-impl.h index b711d91ff..e95395c31 100644 --- a/src/core/model/simulator-impl.h +++ b/src/core/model/simulator-impl.h @@ -58,7 +58,7 @@ class SimulatorImpl : public Object virtual void Destroy() = 0; /** \copydoc Simulator::IsFinished */ virtual bool IsFinished() const = 0; - /** \copydoc Simulator::Stop(void) */ + /** \copydoc Simulator::Stop() */ virtual void Stop() = 0; /** \copydoc Simulator::Stop(const Time&) */ virtual void Stop(const Time& delay) = 0; diff --git a/src/core/model/type-name.h b/src/core/model/type-name.h index 6be35ba33..41d73d0d4 100644 --- a/src/core/model/type-name.h +++ b/src/core/model/type-name.h @@ -59,7 +59,7 @@ TypeNameGet() */ #define TYPENAMEGET_DEFINE(T) \ template <> \ - inline std::string TypeNameGet(void) \ + inline std::string TypeNameGet() \ { \ return #T; \ } diff --git a/src/core/model/type-traits.h b/src/core/model/type-traits.h index fdc6ffd3d..7f5b4490d 100644 --- a/src/core/model/type-traits.h +++ b/src/core/model/type-traits.h @@ -228,7 +228,7 @@ struct TypeTraits * \tparam U \deduced Return type. */ template - struct FunctionPtrTraits + struct FunctionPtrTraits { /** Value. */ enum @@ -438,7 +438,7 @@ struct TypeTraits * \tparam V \deduced Class type. */ template - struct PtrToMemberTraits + struct PtrToMemberTraits { /** Value. */ enum @@ -460,7 +460,7 @@ struct TypeTraits * \tparam V \deduced Class type. */ template - struct PtrToMemberTraits + struct PtrToMemberTraits { /** Value. */ enum diff --git a/src/core/model/version.cc b/src/core/model/version.cc index 571165032..ceb2599e6 100644 --- a/src/core/model/version.cc +++ b/src/core/model/version.cc @@ -33,67 +33,67 @@ namespace ns3 { std::string -Version::VersionTag(void) +Version::VersionTag() { return NS3_VERSION_TAG; } std::string -Version::ClosestAncestorTag(void) +Version::ClosestAncestorTag() { return NS3_VERSION_CLOSEST_TAG; } uint32_t -Version::Major(void) +Version::Major() { return NS3_VERSION_MAJOR; } uint32_t -Version::Minor(void) +Version::Minor() { return NS3_VERSION_MINOR; } uint32_t -Version::Patch(void) +Version::Patch() { return NS3_VERSION_PATCH; } std::string -Version::ReleaseCandidate(void) +Version::ReleaseCandidate() { return std::string{NS3_VERSION_RELEASE_CANDIDATE}; } uint32_t -Version::TagDistance(void) +Version::TagDistance() { return NS3_VERSION_TAG_DISTANCE; } bool -Version::DirtyWorkingTree(void) +Version::DirtyWorkingTree() { return static_cast(NS3_VERSION_DIRTY_FLAG); } std::string -Version::CommitHash(void) +Version::CommitHash() { return std::string{NS3_VERSION_COMMIT_HASH}; } std::string -Version::BuildProfile(void) +Version::BuildProfile() { return std::string{NS3_VERSION_BUILD_PROFILE}; } std::string -Version::ShortVersion(void) +Version::ShortVersion() { std::ostringstream ostream; ostream << VersionTag(); @@ -112,7 +112,7 @@ Version::ShortVersion(void) } std::string -Version::BuildSummary(void) +Version::BuildSummary() { std::ostringstream ostream; ostream << ClosestAncestorTag(); @@ -130,7 +130,7 @@ Version::BuildSummary(void) } std::string -Version::LongVersion(void) +Version::LongVersion() { std::ostringstream ostream; ostream << VersionTag(); diff --git a/src/core/model/version.h b/src/core/model/version.h index f7fb2f1f8..a91c97226 100644 --- a/src/core/model/version.h +++ b/src/core/model/version.h @@ -112,7 +112,7 @@ class Version * * \return ns-3 version tag */ - static std::string VersionTag(void); + static std::string VersionTag(); /** * Returns the closest tag that is attached to a commit that is an ancestor @@ -123,7 +123,7 @@ class Version * * \return Closest tag attached to an ancestor of the current commit */ - static std::string ClosestAncestorTag(void); + static std::string ClosestAncestorTag(); /** * Major component of the build version @@ -135,7 +135,7 @@ class Version * * \return The major component of the build version */ - static uint32_t Major(void); + static uint32_t Major(); /** * Minor component of the build version @@ -147,7 +147,7 @@ class Version * * \return The minor component of the build version */ - static uint32_t Minor(void); + static uint32_t Minor(); /** * Patch component of the build version @@ -160,7 +160,7 @@ class Version * \return The patch component of the build version or 0 if the build version * does not have a patch component */ - static uint32_t Patch(void); + static uint32_t Patch(); /** * Release candidate component of the build version @@ -173,7 +173,7 @@ class Version * \return The release candidate component of the build version or an empty * string if the build version does not have a release candidate component */ - static std::string ReleaseCandidate(void); + static std::string ReleaseCandidate(); /** * The number of commits between the current @@ -181,14 +181,14 @@ class Version * * \return The number of commits made since the last tagged commit */ - static uint32_t TagDistance(void); + static uint32_t TagDistance(); /** * Indicates whether there were uncommitted changes during the build * * \return \c true if the working tree had uncommitted changes. */ - static bool DirtyWorkingTree(void); + static bool DirtyWorkingTree(); /** * Hash of the most recent commit @@ -204,7 +204,7 @@ class Version * * \return hexadecimal representation of the most recent commit id */ - static std::string CommitHash(void); + static std::string CommitHash(); /** * Indicates the type of build that was performed (debug/release/optimized). @@ -213,7 +213,7 @@ class Version * * \return String containing the type of build */ - static std::string BuildProfile(void); + static std::string BuildProfile(); /** * Constructs a string containing the ns-3 major and minor version components, @@ -232,7 +232,7 @@ class Version * * \return String containing the ns-3 major and minor components and flags. */ - static std::string ShortVersion(void); + static std::string ShortVersion(); /** * Constructs a string containing the most recent tag and status flags. @@ -250,7 +250,7 @@ class Version * * \return String containing the closest ancestor tag and flags. */ - static std::string BuildSummary(void); + static std::string BuildSummary(); /** * Constructs a string containing all of the build details @@ -268,7 +268,7 @@ class Version * * \return String containing full version */ - static std::string LongVersion(void); + static std::string LongVersion(); }; // class Version diff --git a/src/core/test/random-variable-stream-test-suite.cc b/src/core/test/random-variable-stream-test-suite.cc index 67f3f5b05..48c5950fe 100644 --- a/src/core/test/random-variable-stream-test-suite.cc +++ b/src/core/test/random-variable-stream-test-suite.cc @@ -146,7 +146,7 @@ class TestCaseBase : public TestCase * Create a new instance of a random variable stream * \returns The new random variable stream instance. */ - virtual Ptr Create(void) const = 0; + virtual Ptr Create() const = 0; }; /** @@ -168,7 +168,7 @@ class TestCaseBase : public TestCase } // Inherited - Ptr Create(void) const + Ptr Create() const { auto rng = CreateObject(); rng->SetAttribute("Antithetic", BooleanValue(m_anti)); @@ -314,7 +314,7 @@ class TestCaseBase : public TestCase * based on time-of-day, and run number=0: * NS_GLOBAL_VALUE="RngRun=0" ./test.py -s random-variable-stream-generators */ - void SetTestSuiteSeed(void) + void SetTestSuiteSeed() { if (m_seedSet == false) { @@ -358,7 +358,7 @@ class UniformTestCase : public TestCaseBase private: // Inherited - virtual void DoRun(void); + virtual void DoRun(); }; UniformTestCase::UniformTestCase() @@ -383,7 +383,7 @@ UniformTestCase::ChiSquaredTest(Ptr rng) const } void -UniformTestCase::DoRun(void) +UniformTestCase::DoRun() { NS_LOG_FUNCTION(this); SetTestSuiteSeed(); @@ -480,7 +480,7 @@ class UniformAntitheticTestCase : public TestCaseBase private: // Inherited - virtual void DoRun(void); + virtual void DoRun(); }; UniformAntitheticTestCase::UniformAntitheticTestCase() @@ -505,7 +505,7 @@ UniformAntitheticTestCase::ChiSquaredTest(Ptr rng) const } void -UniformAntitheticTestCase::DoRun(void) +UniformAntitheticTestCase::DoRun() { NS_LOG_FUNCTION(this); SetTestSuiteSeed(); @@ -552,7 +552,7 @@ class ConstantTestCase : public TestCaseBase private: // Inherited - virtual void DoRun(void); + virtual void DoRun(); /** Tolerance for testing rng values against expectation. */ static constexpr double TOLERANCE{1e-8}; @@ -564,7 +564,7 @@ ConstantTestCase::ConstantTestCase() } void -ConstantTestCase::DoRun(void) +ConstantTestCase::DoRun() { NS_LOG_FUNCTION(this); SetTestSuiteSeed(); @@ -603,7 +603,7 @@ class SequentialTestCase : public TestCaseBase private: // Inherited - virtual void DoRun(void); + virtual void DoRun(); /** Tolerance for testing rng values against expectation. */ static constexpr double TOLERANCE{1e-8}; @@ -615,7 +615,7 @@ SequentialTestCase::SequentialTestCase() } void -SequentialTestCase::DoRun(void) +SequentialTestCase::DoRun() { NS_LOG_FUNCTION(this); SetTestSuiteSeed(); @@ -663,7 +663,7 @@ class NormalTestCase : public TestCaseBase private: // Inherited - virtual void DoRun(void); + virtual void DoRun(); /** Tolerance for testing rng values against expectation, in rms. */ static constexpr double TOLERANCE{5}; @@ -699,7 +699,7 @@ NormalTestCase::ChiSquaredTest(Ptr rng) const } void -NormalTestCase::DoRun(void) +NormalTestCase::DoRun() { NS_LOG_FUNCTION(this); SetTestSuiteSeed(); @@ -749,7 +749,7 @@ class NormalAntitheticTestCase : public TestCaseBase private: // Inherited - virtual void DoRun(void); + virtual void DoRun(); /** Tolerance for testing rng values against expectation, in rms. */ static constexpr double TOLERANCE{5}; @@ -786,7 +786,7 @@ NormalAntitheticTestCase::ChiSquaredTest(Ptr rng) const } void -NormalAntitheticTestCase::DoRun(void) +NormalAntitheticTestCase::DoRun() { NS_LOG_FUNCTION(this); SetTestSuiteSeed(); @@ -837,7 +837,7 @@ class ExponentialTestCase : public TestCaseBase private: // Inherited - virtual void DoRun(void); + virtual void DoRun(); /** Tolerance for testing rng values against expectation, in rms. */ static constexpr double TOLERANCE{5}; @@ -873,7 +873,7 @@ ExponentialTestCase::ChiSquaredTest(Ptr rng) const } void -ExponentialTestCase::DoRun(void) +ExponentialTestCase::DoRun() { NS_LOG_FUNCTION(this); SetTestSuiteSeed(); @@ -918,7 +918,7 @@ class ExponentialAntitheticTestCase : public TestCaseBase private: // Inherited - virtual void DoRun(void); + virtual void DoRun(); /** Tolerance for testing rng values against expectation, in rms. */ static constexpr double TOLERANCE{5}; @@ -954,7 +954,7 @@ ExponentialAntitheticTestCase::ChiSquaredTest(Ptr rng) con } void -ExponentialAntitheticTestCase::DoRun(void) +ExponentialAntitheticTestCase::DoRun() { NS_LOG_FUNCTION(this); SetTestSuiteSeed(); @@ -1002,7 +1002,7 @@ class ParetoTestCase : public TestCaseBase private: // Inherited - virtual void DoRun(void); + virtual void DoRun(); /** * Tolerance for testing rng values against expectation, @@ -1041,7 +1041,7 @@ ParetoTestCase::ChiSquaredTest(Ptr rng) const } void -ParetoTestCase::DoRun(void) +ParetoTestCase::DoRun() { NS_LOG_FUNCTION(this); SetTestSuiteSeed(); @@ -1095,7 +1095,7 @@ class ParetoAntitheticTestCase : public TestCaseBase private: // Inherited - virtual void DoRun(void); + virtual void DoRun(); /** * Tolerance for testing rng values against expectation, @@ -1134,7 +1134,7 @@ ParetoAntitheticTestCase::ChiSquaredTest(Ptr rng) const } void -ParetoAntitheticTestCase::DoRun(void) +ParetoAntitheticTestCase::DoRun() { NS_LOG_FUNCTION(this); SetTestSuiteSeed(); @@ -1192,7 +1192,7 @@ class WeibullTestCase : public TestCaseBase private: // Inherited - virtual void DoRun(void); + virtual void DoRun(); /** * Tolerance for testing rng values against expectation, @@ -1234,7 +1234,7 @@ WeibullTestCase::ChiSquaredTest(Ptr rng) const } void -WeibullTestCase::DoRun(void) +WeibullTestCase::DoRun() { NS_LOG_FUNCTION(this); SetTestSuiteSeed(); @@ -1301,7 +1301,7 @@ class WeibullAntitheticTestCase : public TestCaseBase private: // Inherited - virtual void DoRun(void); + virtual void DoRun(); /** * Tolerance for testing rng values against expectation, @@ -1342,7 +1342,7 @@ WeibullAntitheticTestCase::ChiSquaredTest(Ptr rng) const } void -WeibullAntitheticTestCase::DoRun(void) +WeibullAntitheticTestCase::DoRun() { NS_LOG_FUNCTION(this); SetTestSuiteSeed(); @@ -1412,7 +1412,7 @@ class LogNormalTestCase : public TestCaseBase private: // Inherited - virtual void DoRun(void); + virtual void DoRun(); /** * Tolerance for testing rng values against expectation, @@ -1454,7 +1454,7 @@ LogNormalTestCase::ChiSquaredTest(Ptr rng) const } void -LogNormalTestCase::DoRun(void) +LogNormalTestCase::DoRun() { NS_LOG_FUNCTION(this); SetTestSuiteSeed(); @@ -1514,7 +1514,7 @@ class LogNormalAntitheticTestCase : public TestCaseBase private: // Inherited - virtual void DoRun(void); + virtual void DoRun(); /** * Tolerance for testing rng values against expectation, @@ -1556,7 +1556,7 @@ LogNormalAntitheticTestCase::ChiSquaredTest(Ptr rng) const } void -LogNormalAntitheticTestCase::DoRun(void) +LogNormalAntitheticTestCase::DoRun() { NS_LOG_FUNCTION(this); SetTestSuiteSeed(); @@ -1618,7 +1618,7 @@ class GammaTestCase : public TestCaseBase private: // Inherited - virtual void DoRun(void); + virtual void DoRun(); /** * Tolerance for testing rng values against expectation, @@ -1660,7 +1660,7 @@ GammaTestCase::ChiSquaredTest(Ptr rng) const } void -GammaTestCase::DoRun(void) +GammaTestCase::DoRun() { NS_LOG_FUNCTION(this); SetTestSuiteSeed(); @@ -1710,7 +1710,7 @@ class GammaAntitheticTestCase : public TestCaseBase private: // Inherited - virtual void DoRun(void); + virtual void DoRun(); /** * Tolerance for testing rng values against expectation, @@ -1752,7 +1752,7 @@ GammaAntitheticTestCase::ChiSquaredTest(Ptr rng) const } void -GammaAntitheticTestCase::DoRun(void) +GammaAntitheticTestCase::DoRun() { NS_LOG_FUNCTION(this); SetTestSuiteSeed(); @@ -1806,7 +1806,7 @@ class ErlangTestCase : public TestCaseBase private: // Inherited - virtual void DoRun(void); + virtual void DoRun(); /** * Tolerance for testing rng values against expectation, @@ -1851,7 +1851,7 @@ ErlangTestCase::ChiSquaredTest(Ptr rng) const } void -ErlangTestCase::DoRun(void) +ErlangTestCase::DoRun() { NS_LOG_FUNCTION(this); SetTestSuiteSeed(); @@ -1901,7 +1901,7 @@ class ErlangAntitheticTestCase : public TestCaseBase private: // Inherited - virtual void DoRun(void); + virtual void DoRun(); /** * Tolerance for testing rng values against expectation, @@ -1946,7 +1946,7 @@ ErlangAntitheticTestCase::ChiSquaredTest(Ptr rng) const } void -ErlangAntitheticTestCase::DoRun(void) +ErlangAntitheticTestCase::DoRun() { NS_LOG_FUNCTION(this); SetTestSuiteSeed(); @@ -1997,7 +1997,7 @@ class ZipfTestCase : public TestCaseBase private: // Inherited - virtual void DoRun(void); + virtual void DoRun(); /** * Tolerance for testing rng values against expectation, @@ -2012,7 +2012,7 @@ ZipfTestCase::ZipfTestCase() } void -ZipfTestCase::DoRun(void) +ZipfTestCase::DoRun() { NS_LOG_FUNCTION(this); SetTestSuiteSeed(); @@ -2077,7 +2077,7 @@ class ZipfAntitheticTestCase : public TestCaseBase private: // Inherited - virtual void DoRun(void); + virtual void DoRun(); /** * Tolerance for testing rng values against expectation, @@ -2092,7 +2092,7 @@ ZipfAntitheticTestCase::ZipfAntitheticTestCase() } void -ZipfAntitheticTestCase::DoRun(void) +ZipfAntitheticTestCase::DoRun() { NS_LOG_FUNCTION(this); SetTestSuiteSeed(); @@ -2160,7 +2160,7 @@ class ZetaTestCase : public TestCaseBase private: // Inherited - virtual void DoRun(void); + virtual void DoRun(); /** * Tolerance for testing rng values against expectation, @@ -2175,7 +2175,7 @@ ZetaTestCase::ZetaTestCase() } void -ZetaTestCase::DoRun(void) +ZetaTestCase::DoRun() { NS_LOG_FUNCTION(this); SetTestSuiteSeed(); @@ -2223,7 +2223,7 @@ class ZetaAntitheticTestCase : public TestCaseBase private: // Inherited - virtual void DoRun(void); + virtual void DoRun(); /** * Tolerance for testing rng values against expectation, @@ -2238,7 +2238,7 @@ ZetaAntitheticTestCase::ZetaAntitheticTestCase() } void -ZetaAntitheticTestCase::DoRun(void) +ZetaAntitheticTestCase::DoRun() { NS_LOG_FUNCTION(this); SetTestSuiteSeed(); @@ -2289,7 +2289,7 @@ class DeterministicTestCase : public TestCaseBase private: // Inherited - virtual void DoRun(void); + virtual void DoRun(); /** Tolerance for testing rng values against expectation. */ static constexpr double TOLERANCE{1e-8}; @@ -2301,7 +2301,7 @@ DeterministicTestCase::DeterministicTestCase() } void -DeterministicTestCase::DoRun(void) +DeterministicTestCase::DoRun() { NS_LOG_FUNCTION(this); SetTestSuiteSeed(); @@ -2364,7 +2364,7 @@ class EmpiricalTestCase : public TestCaseBase private: // Inherited - virtual void DoRun(void); + virtual void DoRun(); /** * Tolerance for testing rng values against expectation, @@ -2379,7 +2379,7 @@ EmpiricalTestCase::EmpiricalTestCase() } void -EmpiricalTestCase::DoRun(void) +EmpiricalTestCase::DoRun() { NS_LOG_FUNCTION(this); SetTestSuiteSeed(); @@ -2464,7 +2464,7 @@ class EmpiricalAntitheticTestCase : public TestCaseBase private: // Inherited - virtual void DoRun(void); + virtual void DoRun(); /** * Tolerance for testing rng values against expectation, @@ -2479,7 +2479,7 @@ EmpiricalAntitheticTestCase::EmpiricalAntitheticTestCase() } void -EmpiricalAntitheticTestCase::DoRun(void) +EmpiricalAntitheticTestCase::DoRun() { NS_LOG_FUNCTION(this); SetTestSuiteSeed(); @@ -2543,7 +2543,7 @@ class NormalCachingTestCase : public TestCaseBase private: // Inherited - virtual void DoRun(void); + virtual void DoRun(); }; NormalCachingTestCase::NormalCachingTestCase() @@ -2552,7 +2552,7 @@ NormalCachingTestCase::NormalCachingTestCase() } void -NormalCachingTestCase::DoRun(void) +NormalCachingTestCase::DoRun() { NS_LOG_FUNCTION(this); SetTestSuiteSeed(); diff --git a/src/core/test/rng-test-suite.cc b/src/core/test/rng-test-suite.cc index d4ae7d404..d884f1ea4 100644 --- a/src/core/test/rng-test-suite.cc +++ b/src/core/test/rng-test-suite.cc @@ -79,13 +79,13 @@ class RngUniformTestCase : public TestCase /** * Run a chi-squared test on the results of the random number generator. - * \param u The random number generaor. + * \param u The random number generator. * \return the chi-squared test result. */ double ChiSquaredTest(Ptr u); private: - virtual void DoRun(void); + virtual void DoRun(); }; RngUniformTestCase::RngUniformTestCase() @@ -133,7 +133,7 @@ RngUniformTestCase::ChiSquaredTest(Ptr u) } void -RngUniformTestCase::DoRun(void) +RngUniformTestCase::DoRun() { RngSeedManager::SetSeed(static_cast(time(0))); @@ -172,13 +172,13 @@ class RngNormalTestCase : public TestCase /** * Run a chi-squared test on the results of the random number generator. - * \param n The random number generaor. + * \param n The random number generator. * \return the chi-squared test result. */ double ChiSquaredTest(Ptr n); private: - virtual void DoRun(void); + virtual void DoRun(); }; RngNormalTestCase::RngNormalTestCase() @@ -240,7 +240,7 @@ RngNormalTestCase::ChiSquaredTest(Ptr n) } void -RngNormalTestCase::DoRun(void) +RngNormalTestCase::DoRun() { RngSeedManager::SetSeed(static_cast(time(0))); @@ -279,13 +279,13 @@ class RngExponentialTestCase : public TestCase /** * Run a chi-squared test on the results of the random number generator. - * \param n The random number generaor. + * \param n The random number generator. * \return the chi-squared test result. */ double ChiSquaredTest(Ptr n); private: - virtual void DoRun(void); + virtual void DoRun(); }; RngExponentialTestCase::RngExponentialTestCase() @@ -346,7 +346,7 @@ RngExponentialTestCase::ChiSquaredTest(Ptr e) } void -RngExponentialTestCase::DoRun(void) +RngExponentialTestCase::DoRun() { RngSeedManager::SetSeed(static_cast(time(0))); @@ -385,13 +385,13 @@ class RngParetoTestCase : public TestCase /** * Run a chi-squared test on the results of the random number generator. - * \param p The random number generaor. + * \param p The random number generator. * \return the chi-squared test result. */ double ChiSquaredTest(Ptr p); private: - virtual void DoRun(void); + virtual void DoRun(); }; RngParetoTestCase::RngParetoTestCase() @@ -455,7 +455,7 @@ RngParetoTestCase::ChiSquaredTest(Ptr p) } void -RngParetoTestCase::DoRun(void) +RngParetoTestCase::DoRun() { RngSeedManager::SetSeed(static_cast(time(0))); diff --git a/src/core/test/type-traits-test-suite.cc b/src/core/test/type-traits-test-suite.cc index b003493e6..70f509f71 100644 --- a/src/core/test/type-traits-test-suite.cc +++ b/src/core/test/type-traits-test-suite.cc @@ -59,12 +59,12 @@ TypeTraitsTestCase::TypeTraitsTestCase() void TypeTraitsTestCase::DoRun() { - NS_TEST_ASSERT_MSG_EQ(TypeTraits::IsPointerToMember, + NS_TEST_ASSERT_MSG_EQ(TypeTraits::IsPointerToMember, 1, - "Check pointer to member function (void)"); - NS_TEST_ASSERT_MSG_EQ(TypeTraits::IsPointerToMember, + "Check pointer to member function ()"); + NS_TEST_ASSERT_MSG_EQ(TypeTraits::IsPointerToMember, 1, - "Check pointer to member function (void) const"); + "Check pointer to member function () const"); NS_TEST_ASSERT_MSG_EQ(TypeTraits::IsPointerToMember, 1, "Check pointer to member function (int)"); @@ -72,9 +72,9 @@ TypeTraitsTestCase::DoRun() 1, "Check pointer to member function (int) const"); NS_TEST_ASSERT_MSG_EQ( - TypeTraits::PointerToMemberTraits::nArgs, + TypeTraits::PointerToMemberTraits::nArgs, 0, - "Check number of arguments for pointer to member function (void) const"); + "Check number of arguments for pointer to member function () const"); NS_TEST_ASSERT_MSG_EQ( TypeTraits::PointerToMemberTraits::nArgs, 1, diff --git a/src/fd-net-device/helper/netmap-net-device-helper.cc b/src/fd-net-device/helper/netmap-net-device-helper.cc index 7e96daf8d..71e4ceabe 100644 --- a/src/fd-net-device/helper/netmap-net-device-helper.cc +++ b/src/fd-net-device/helper/netmap-net-device-helper.cc @@ -69,7 +69,7 @@ NetmapNetDeviceHelper::NetmapNetDeviceHelper() } std::string -NetmapNetDeviceHelper::GetDeviceName(void) +NetmapNetDeviceHelper::GetDeviceName() { return m_deviceName; } @@ -195,7 +195,7 @@ NetmapNetDeviceHelper::SetDeviceAttributes(Ptr device) const } int -NetmapNetDeviceHelper::CreateFileDescriptor(void) const +NetmapNetDeviceHelper::CreateFileDescriptor() const { NS_LOG_FUNCTION(this); diff --git a/src/fd-net-device/helper/netmap-net-device-helper.h b/src/fd-net-device/helper/netmap-net-device-helper.h index a26fa2705..8d312c060 100644 --- a/src/fd-net-device/helper/netmap-net-device-helper.h +++ b/src/fd-net-device/helper/netmap-net-device-helper.h @@ -54,7 +54,7 @@ class NetmapNetDeviceHelper : public FdNetDeviceHelper * \brief Get the device name of this device. * \returns The device name of this device. */ - std::string GetDeviceName(void); + std::string GetDeviceName(); /** * \brief Set the device name of this device. @@ -82,7 +82,7 @@ class NetmapNetDeviceHelper : public FdNetDeviceHelper * socket. We do this to avoid having the entire simulation running as root. * \return the rawSocket number */ - virtual int CreateFileDescriptor(void) const; + virtual int CreateFileDescriptor() const; /** * \brief Switch the fd in netmap mode. diff --git a/src/fd-net-device/model/dpdk-net-device.cc b/src/fd-net-device/model/dpdk-net-device.cc index b5f20defa..07b1449d2 100644 --- a/src/fd-net-device/model/dpdk-net-device.cc +++ b/src/fd-net-device/model/dpdk-net-device.cc @@ -51,7 +51,7 @@ NS_OBJECT_ENSURE_REGISTERED(DpdkNetDevice); volatile bool DpdkNetDevice::m_forceQuit = false; TypeId -DpdkNetDevice::GetTypeId(void) +DpdkNetDevice::GetTypeId() { static TypeId tid = TypeId("ns3::DpdkNetDevice") @@ -117,7 +117,7 @@ DpdkNetDevice::SetDeviceName(std::string deviceName) } void -DpdkNetDevice::CheckAllPortsLinkStatus(void) +DpdkNetDevice::CheckAllPortsLinkStatus() { NS_LOG_FUNCTION(this); @@ -241,7 +241,7 @@ DpdkNetDevice::LaunchCore(void* arg) } bool -DpdkNetDevice::IsLinkUp(void) const +DpdkNetDevice::IsLinkUp() const { // Refer https://mails.dpdk.org/archives/users/2018-December/003822.html return true; @@ -458,7 +458,7 @@ DpdkNetDevice::Write(uint8_t* buffer, size_t length) } void -DpdkNetDevice::DoFinishStoppingDevice(void) +DpdkNetDevice::DoFinishStoppingDevice() { std::unique_lock lock{m_pendingReadMutex}; diff --git a/src/fd-net-device/model/dpdk-net-device.h b/src/fd-net-device/model/dpdk-net-device.h index 7ca9ac381..0be486a0a 100644 --- a/src/fd-net-device/model/dpdk-net-device.h +++ b/src/fd-net-device/model/dpdk-net-device.h @@ -51,7 +51,7 @@ class DpdkNetDevice : public FdNetDevice * \brief Get the type ID. * \return the object TypeId */ - static TypeId GetTypeId(void); + static TypeId GetTypeId(); /** * Constructor for the DpdkNetDevice. @@ -67,7 +67,7 @@ class DpdkNetDevice : public FdNetDevice * Check the link status of all ports in up to 9s * and print them finally */ - void CheckAllPortsLinkStatus(void); + void CheckAllPortsLinkStatus(); /** * Initialize Dpdk. @@ -114,7 +114,7 @@ class DpdkNetDevice : public FdNetDevice * Check the status of the link. * \return Status of the link - up/down as true/false. */ - bool IsLinkUp(void) const; + bool IsLinkUp() const; /** * Free the given packet buffer. @@ -149,7 +149,7 @@ class DpdkNetDevice : public FdNetDevice std::string m_deviceName; private: - void DoFinishStoppingDevice(void); + void DoFinishStoppingDevice(); /** * Condition variable for Dpdk to stop */ diff --git a/src/fd-net-device/model/netmap-net-device.cc b/src/fd-net-device/model/netmap-net-device.cc index 686567808..78344216a 100644 --- a/src/fd-net-device/model/netmap-net-device.cc +++ b/src/fd-net-device/model/netmap-net-device.cc @@ -31,7 +31,7 @@ namespace ns3 NS_LOG_COMPONENT_DEFINE("NetmapNetDevice"); TypeId -NetDeviceQueueLock::GetTypeId(void) +NetDeviceQueueLock::GetTypeId() { static TypeId tid = TypeId("ns3::NetDeviceQueueLock") .SetParent() @@ -49,7 +49,7 @@ NetDeviceQueueLock::~NetDeviceQueueLock() } bool -NetDeviceQueueLock::IsStopped(void) const +NetDeviceQueueLock::IsStopped() const { m_mutex.lock(); bool stopped = NetDeviceQueue::IsStopped(); @@ -58,7 +58,7 @@ NetDeviceQueueLock::IsStopped(void) const } void -NetDeviceQueueLock::Start(void) +NetDeviceQueueLock::Start() { m_mutex.lock(); NetDeviceQueue::Start(); @@ -66,7 +66,7 @@ NetDeviceQueueLock::Start(void) } void -NetDeviceQueueLock::Stop(void) +NetDeviceQueueLock::Stop() { m_mutex.lock(); NetDeviceQueue::Stop(); @@ -74,7 +74,7 @@ NetDeviceQueueLock::Stop(void) } void -NetDeviceQueueLock::Wake(void) +NetDeviceQueueLock::Wake() { m_mutex.lock(); NetDeviceQueue::Wake(); @@ -119,7 +119,7 @@ NetmapNetDeviceFdReader::SetNetmapIfp(struct netmap_if* nifp) } FdReader::Data -NetmapNetDeviceFdReader::DoRead(void) +NetmapNetDeviceFdReader::DoRead() { NS_LOG_FUNCTION(this); @@ -172,7 +172,7 @@ NetmapNetDeviceFdReader::DoRead(void) NS_OBJECT_ENSURE_REGISTERED(NetmapNetDevice); TypeId -NetmapNetDevice::GetTypeId(void) +NetmapNetDevice::GetTypeId() { static TypeId tid = TypeId("ns3::NetmapNetDevice") @@ -209,7 +209,7 @@ NetmapNetDevice::~NetmapNetDevice() } Ptr -NetmapNetDevice::DoCreateFdReader(void) +NetmapNetDevice::DoCreateFdReader() { NS_LOG_FUNCTION(this); @@ -221,7 +221,7 @@ NetmapNetDevice::DoCreateFdReader(void) } void -NetmapNetDevice::DoFinishStartingDevice(void) +NetmapNetDevice::DoFinishStartingDevice() { NS_LOG_FUNCTION(this); @@ -230,7 +230,7 @@ NetmapNetDevice::DoFinishStartingDevice(void) } void -NetmapNetDevice::DoFinishStoppingDevice(void) +NetmapNetDevice::DoFinishStoppingDevice() { NS_LOG_FUNCTION(this); diff --git a/src/fd-net-device/model/netmap-net-device.h b/src/fd-net-device/model/netmap-net-device.h index 58dcd3d82..8065f74f8 100644 --- a/src/fd-net-device/model/netmap-net-device.h +++ b/src/fd-net-device/model/netmap-net-device.h @@ -49,7 +49,7 @@ class NetDeviceQueueLock : public NetDeviceQueue * \brief Get the type ID. * \return the object TypeId */ - static TypeId GetTypeId(void); + static TypeId GetTypeId(); NetDeviceQueueLock(); virtual ~NetDeviceQueueLock(); @@ -58,20 +58,20 @@ class NetDeviceQueueLock : public NetDeviceQueue * Called by the device to start this device transmission queue. * This is the analogous to the netif_tx_start_queue function of the Linux kernel. */ - virtual void Start(void); + virtual void Start(); /** * Called by the device to stop this device transmission queue. * This is the analogous to the netif_tx_stop_queue function of the Linux kernel. */ - virtual void Stop(void); + virtual void Stop(); /** * Called by the device to wake the queue disc associated with this * device transmission queue. This is done by invoking the wake callback. * This is the analogous to the netif_tx_wake_queue function of the Linux kernel. */ - virtual void Wake(void); + virtual void Wake(); /** * \brief Get the status of the device transmission queue. @@ -80,7 +80,7 @@ class NetDeviceQueueLock : public NetDeviceQueue * Called by queue discs to enquire about the status of a given transmission queue. * This is the analogous to the netif_xmit_stopped function of the Linux kernel. */ - virtual bool IsStopped(void) const; + virtual bool IsStopped() const; /** * \brief Called by the netdevice to report the number of bytes queued to the device queue @@ -121,7 +121,7 @@ class NetmapNetDeviceFdReader : public FdReader void SetNetmapIfp(struct netmap_if* nifp); private: - FdReader::Data DoRead(void); + FdReader::Data DoRead(); uint32_t m_bufferSize; //!< size of the read buffer struct netmap_if* m_nifp; //!< Netmap interface representation @@ -142,7 +142,7 @@ class NetmapNetDevice : public FdNetDevice * \brief Get the type ID. * \return the object TypeId */ - static TypeId GetTypeId(void); + static TypeId GetTypeId(); NetmapNetDevice(); virtual ~NetmapNetDevice(); @@ -194,9 +194,9 @@ class NetmapNetDevice : public FdNetDevice virtual ssize_t Write(uint8_t* buffer, size_t length); private: - Ptr DoCreateFdReader(void); - void DoFinishStartingDevice(void); - void DoFinishStoppingDevice(void); + Ptr DoCreateFdReader(); + void DoFinishStartingDevice(); + void DoFinishStoppingDevice(); /** * \brief This function syncs netmap ring and notifies netdevice queue. diff --git a/src/internet/model/ipv4-route.h b/src/internet/model/ipv4-route.h index d0c00ef4a..9d77f13b8 100644 --- a/src/internet/model/ipv4-route.h +++ b/src/internet/model/ipv4-route.h @@ -84,7 +84,7 @@ class Ipv4Route : public SimpleRefCount #ifdef NOTYET // rtable.idev void SetInputIfIndex(uint32_t iif); - uint32_t GetInputIfIndex(void) const; + uint32_t GetInputIfIndex() const; #endif private: diff --git a/src/lte/model/lte-rlc-am.h b/src/lte/model/lte-rlc-am.h index 5359fa2f1..58d4056a8 100644 --- a/src/lte/model/lte-rlc-am.h +++ b/src/lte/model/lte-rlc-am.h @@ -86,11 +86,11 @@ class LteRlcAm : public LteRlc * method called when the T_status_prohibit timer expires * * \param seqNumber SequenceNumber10 - * \returns true is inside receivign window + * \returns true is inside receiving window */ bool IsInsideReceivingWindow(SequenceNumber10 seqNumber); // - // void ReassembleOutsideWindow (void); + // void ReassembleOutsideWindow (); // void ReassembleSnLessThan (uint16_t seqNumber); // diff --git a/src/mesh/model/dot11s/ie-dot11s-id.h b/src/mesh/model/dot11s/ie-dot11s-id.h index 2916a9d6e..faa2fb547 100644 --- a/src/mesh/model/dot11s/ie-dot11s-id.h +++ b/src/mesh/model/dot11s/ie-dot11s-id.h @@ -57,7 +57,7 @@ class IeMeshId : public WifiInformationElement * \returns true if broadcast */ bool IsBroadcast() const; - // uint32_t GetLength (void) const; + // uint32_t GetLength () const; /** * Peek the IeMeshId as a string value * \returns the mesh ID as a string diff --git a/src/mobility/model/mobility-model.h b/src/mobility/model/mobility-model.h index 917f4590c..ea39cf16a 100644 --- a/src/mobility/model/mobility-model.h +++ b/src/mobility/model/mobility-model.h @@ -118,7 +118,7 @@ class MobilityModel : public Object * \return the current position. * * Unless subclasses override, this method will disregard the reference - * position and return "DoGetPosition (void)". + * position and return "DoGetPosition ()". */ virtual Vector DoGetPositionWithReference(const Vector& referencePosition) const; /** diff --git a/src/mpi/examples/mpi-test-fixtures.cc b/src/mpi/examples/mpi-test-fixtures.cc index 76a96c055..6cd9063d1 100644 --- a/src/mpi/examples/mpi-test-fixtures.cc +++ b/src/mpi/examples/mpi-test-fixtures.cc @@ -37,7 +37,7 @@ int SinkTracer::m_worldRank = -1; int SinkTracer::m_worldSize = -1; void -SinkTracer::Init(void) +SinkTracer::Init() { m_sinkCount = 0; m_line = 0; diff --git a/src/mpi/examples/mpi-test-fixtures.h b/src/mpi/examples/mpi-test-fixtures.h index 25a1ed7e8..ae9000b10 100644 --- a/src/mpi/examples/mpi-test-fixtures.h +++ b/src/mpi/examples/mpi-test-fixtures.h @@ -93,7 +93,7 @@ class SinkTracer /** * PacketSink Init. */ - static void Init(void); + static void Init(); /** * PacketSink receive trace callback. @@ -124,7 +124,7 @@ class SinkTracer * * \return MPI world rank. */ - static int GetWorldRank(void) + static int GetWorldRank() { return m_worldRank; } @@ -134,7 +134,7 @@ class SinkTracer * * \return MPI world size. */ - static int GetWorldSize(void) + static int GetWorldSize() { return m_worldSize; } @@ -143,7 +143,7 @@ class SinkTracer * Get current line count and increment it. * \return the line count. */ - static int GetLineCount(void) + static int GetLineCount() { return m_line++; } diff --git a/src/mpi/examples/nms-p2p-nix-distributed.cc b/src/mpi/examples/nms-p2p-nix-distributed.cc index f23615af2..24d42103e 100644 --- a/src/mpi/examples/nms-p2p-nix-distributed.cc +++ b/src/mpi/examples/nms-p2p-nix-distributed.cc @@ -136,7 +136,9 @@ main(int argc, char* argv[]) nCN, vectorOfVectorOfNodeContainer(5, vectorOfNodeContainer(nLANClients))); - PointToPointHelper p2p_2gb200ms, p2p_1gb5ms, p2p_100mb1ms; + PointToPointHelper p2p_2gb200ms; + PointToPointHelper p2p_1gb5ms; + PointToPointHelper p2p_100mb1ms; InternetStackHelper stack; Ipv4InterfaceContainer ifs; @@ -310,7 +312,12 @@ main(int argc, char* argv[]) NetDeviceContainer ndcLR; ndcLR = p2p_1gb5ms.Install(nodes_netLR[z]); // Connect Net2/Net3 through Lone Routers to Net0 - NodeContainer net0_4, net0_5, net2_4a, net2_4b, net3_5a, net3_5b; + NodeContainer net0_4; + NodeContainer net0_5; + NodeContainer net2_4a; + NodeContainer net2_4b; + NodeContainer net3_5a; + NodeContainer net3_5b; net0_4.Add(nodes_netLR[z].Get(0)); net0_4.Add(nodes_net0[z][0].Get(0)); net0_5.Add(nodes_netLR[z].Get(1)); @@ -323,7 +330,12 @@ main(int argc, char* argv[]) net3_5a.Add(nodes_net3[z][0].Get(0)); net3_5b.Add(nodes_netLR[z].Get(1)); net3_5b.Add(nodes_net3[z][1].Get(0)); - NetDeviceContainer ndc0_4, ndc0_5, ndc2_4a, ndc2_4b, ndc3_5a, ndc3_5b; + NetDeviceContainer ndc0_4; + NetDeviceContainer ndc0_5; + NetDeviceContainer ndc2_4a; + NetDeviceContainer ndc2_4b; + NetDeviceContainer ndc3_5a; + NetDeviceContainer ndc3_5b; ndc0_4 = p2p_1gb5ms.Install(net0_4); oss.str(""); oss << 10 + z << ".1.253.0"; diff --git a/src/mpi/model/distributed-simulator-impl.cc b/src/mpi/model/distributed-simulator-impl.cc index ca04b215c..cf4989b7f 100644 --- a/src/mpi/model/distributed-simulator-impl.cc +++ b/src/mpi/model/distributed-simulator-impl.cc @@ -89,7 +89,7 @@ LbtsMessage::IsFinished() Time DistributedSimulatorImpl::m_lookAhead = Time::Max(); TypeId -DistributedSimulatorImpl::GetTypeId(void) +DistributedSimulatorImpl::GetTypeId() { static TypeId tid = TypeId("ns3::DistributedSimulatorImpl") .SetParent() @@ -117,7 +117,7 @@ DistributedSimulatorImpl::DistributedSimulatorImpl() m_currentContext = Simulator::NO_CONTEXT; m_unscheduledEvents = 0; m_eventCount = 0; - m_events = 0; + m_events = nullptr; } DistributedSimulatorImpl::~DistributedSimulatorImpl() @@ -126,7 +126,7 @@ DistributedSimulatorImpl::~DistributedSimulatorImpl() } void -DistributedSimulatorImpl::DoDispose(void) +DistributedSimulatorImpl::DoDispose() { NS_LOG_FUNCTION(this); @@ -135,7 +135,7 @@ DistributedSimulatorImpl::DoDispose(void) Scheduler::Event next = m_events->RemoveNext(); next.impl->Unref(); } - m_events = 0; + m_events = nullptr; delete[] m_pLBTS; SimulatorImpl::DoDispose(); } @@ -160,7 +160,7 @@ DistributedSimulatorImpl::Destroy() } void -DistributedSimulatorImpl::CalculateLookAhead(void) +DistributedSimulatorImpl::CalculateLookAhead() { NS_LOG_FUNCTION(this); @@ -303,7 +303,7 @@ DistributedSimulatorImpl::SetScheduler(ObjectFactory schedulerFactory) } void -DistributedSimulatorImpl::ProcessOneEvent(void) +DistributedSimulatorImpl::ProcessOneEvent() { NS_LOG_FUNCTION(this); @@ -324,19 +324,19 @@ DistributedSimulatorImpl::ProcessOneEvent(void) } bool -DistributedSimulatorImpl::IsFinished(void) const +DistributedSimulatorImpl::IsFinished() const { return m_globalFinished; } bool -DistributedSimulatorImpl::IsLocalFinished(void) const +DistributedSimulatorImpl::IsLocalFinished() const { return m_events->IsEmpty() || m_stop; } uint64_t -DistributedSimulatorImpl::NextTs(void) const +DistributedSimulatorImpl::NextTs() const { // If local MPI task is has no more events or stop was called // next event time is infinity. @@ -352,13 +352,13 @@ DistributedSimulatorImpl::NextTs(void) const } Time -DistributedSimulatorImpl::Next(void) const +DistributedSimulatorImpl::Next() const { return TimeStep(NextTs()); } void -DistributedSimulatorImpl::Run(void) +DistributedSimulatorImpl::Run() { NS_LOG_FUNCTION(this); @@ -457,7 +457,7 @@ DistributedSimulatorImpl::GetSystemId() const } void -DistributedSimulatorImpl::Stop(void) +DistributedSimulatorImpl::Stop() { NS_LOG_FUNCTION(this); @@ -529,7 +529,7 @@ DistributedSimulatorImpl::ScheduleDestroy(EventImpl* event) } Time -DistributedSimulatorImpl::Now(void) const +DistributedSimulatorImpl::Now() const { return TimeStep(m_currentTs); } @@ -594,7 +594,7 @@ DistributedSimulatorImpl::IsExpired(const EventId& id) const { if (id.GetUid() == EventId::UID::DESTROY) { - if (id.PeekEventImpl() == 0 || id.PeekEventImpl()->IsCancelled()) + if (id.PeekEventImpl() == nullptr || id.PeekEventImpl()->IsCancelled()) { return true; } @@ -609,7 +609,7 @@ DistributedSimulatorImpl::IsExpired(const EventId& id) const } return true; } - if (id.PeekEventImpl() == 0 || id.GetTs() < m_currentTs || + if (id.PeekEventImpl() == nullptr || id.GetTs() < m_currentTs || (id.GetTs() == m_currentTs && id.GetUid() <= m_currentUid) || id.PeekEventImpl()->IsCancelled()) { @@ -622,7 +622,7 @@ DistributedSimulatorImpl::IsExpired(const EventId& id) const } Time -DistributedSimulatorImpl::GetMaximumSimulationTime(void) const +DistributedSimulatorImpl::GetMaximumSimulationTime() const { /// \todo I am fairly certain other compilers use other non-standard /// post-fixes to indicate 64 bit constants. @@ -630,13 +630,13 @@ DistributedSimulatorImpl::GetMaximumSimulationTime(void) const } uint32_t -DistributedSimulatorImpl::GetContext(void) const +DistributedSimulatorImpl::GetContext() const { return m_currentContext; } uint64_t -DistributedSimulatorImpl::GetEventCount(void) const +DistributedSimulatorImpl::GetEventCount() const { return m_eventCount; } diff --git a/src/mpi/model/distributed-simulator-impl.h b/src/mpi/model/distributed-simulator-impl.h index f1d32ebee..129627c97 100644 --- a/src/mpi/model/distributed-simulator-impl.h +++ b/src/mpi/model/distributed-simulator-impl.h @@ -111,33 +111,33 @@ class DistributedSimulatorImpl : public SimulatorImpl * Register this type. * \return The object TypeId. */ - static TypeId GetTypeId(void); + static TypeId GetTypeId(); /** Default constructor. */ DistributedSimulatorImpl(); /** Destructor. */ - ~DistributedSimulatorImpl(); + ~DistributedSimulatorImpl() override; // virtual from SimulatorImpl - virtual void Destroy(); - virtual bool IsFinished(void) const; - virtual void Stop(void); - virtual void Stop(const Time& delay); - virtual EventId Schedule(const Time& delay, EventImpl* event); - virtual void ScheduleWithContext(uint32_t context, const Time& delay, EventImpl* event); - virtual EventId ScheduleNow(EventImpl* event); - virtual EventId ScheduleDestroy(EventImpl* event); - virtual void Remove(const EventId& id); - virtual void Cancel(const EventId& id); - virtual bool IsExpired(const EventId& id) const; - virtual void Run(void); - virtual Time Now(void) const; - virtual Time GetDelayLeft(const EventId& id) const; - virtual Time GetMaximumSimulationTime(void) const; - virtual void SetScheduler(ObjectFactory schedulerFactory); - virtual uint32_t GetSystemId(void) const; - virtual uint32_t GetContext(void) const; - virtual uint64_t GetEventCount(void) const; + void Destroy() override; + bool IsFinished() const override; + void Stop() override; + void Stop(const Time& delay) override; + EventId Schedule(const Time& delay, EventImpl* event) override; + void ScheduleWithContext(uint32_t context, const Time& delay, EventImpl* event) override; + EventId ScheduleNow(EventImpl* event) override; + EventId ScheduleDestroy(EventImpl* event) override; + void Remove(const EventId& id) override; + void Cancel(const EventId& id) override; + bool IsExpired(const EventId& id) const override; + void Run() override; + Time Now() const override; + Time GetDelayLeft(const EventId& id) const override; + Time GetMaximumSimulationTime() const override; + void SetScheduler(ObjectFactory schedulerFactory) override; + uint32_t GetSystemId() const override; + uint32_t GetContext() const override; + uint64_t GetEventCount() const override; /** * Add additional bound to lookahead constraints. @@ -156,7 +156,7 @@ class DistributedSimulatorImpl : public SimulatorImpl private: // Inherited from Object - virtual void DoDispose(void); + void DoDispose() override; /** * Calculate lookahead constraint based on network latency. @@ -166,17 +166,17 @@ class DistributedSimulatorImpl : public SimulatorImpl * user may impose additional constraints on lookahead * using the ConstrainLookAhead() method. */ - void CalculateLookAhead(void); + void CalculateLookAhead(); /** * Check if this rank is finished. It's finished when there are * no more events or stop has been requested. * * \returns \c true when this rank is finished. */ - bool IsLocalFinished(void) const; + bool IsLocalFinished() const; /** Process the next event. */ - void ProcessOneEvent(void); + void ProcessOneEvent(); /** * Get the timestep of the next event. * @@ -184,13 +184,13 @@ class DistributedSimulatorImpl : public SimulatorImpl * * \return The next event timestep. */ - uint64_t NextTs(void) const; + uint64_t NextTs() const; /** * Get the time of the next event, as returned by NextTs(). * * \return The next event time stamp. */ - Time Next(void) const; + Time Next() const; /** Container type for the events to run at Simulator::Destroy(). */ typedef std::list DestroyEvents; diff --git a/src/mpi/model/granted-time-window-mpi-interface.cc b/src/mpi/model/granted-time-window-mpi-interface.cc index 75b371e3b..488bcf34a 100644 --- a/src/mpi/model/granted-time-window-mpi-interface.cc +++ b/src/mpi/model/granted-time-window-mpi-interface.cc @@ -51,8 +51,8 @@ NS_OBJECT_ENSURE_REGISTERED(GrantedTimeWindowMpiInterface); SentBuffer::SentBuffer() { - m_buffer = 0; - m_request = 0; + m_buffer = nullptr; + m_request = nullptr; } SentBuffer::~SentBuffer() @@ -93,7 +93,7 @@ bool GrantedTimeWindowMpiInterface::g_freeCommunicator = false; ; TypeId -GrantedTimeWindowMpiInterface::GetTypeId(void) +GrantedTimeWindowMpiInterface::GetTypeId() { static TypeId tid = TypeId("ns3::GrantedTimeWindowMpiInterface").SetParent().SetGroupName("Mpi"); @@ -284,7 +284,7 @@ GrantedTimeWindowMpiInterface::ReceiveMessages() // Find the correct node/device to schedule receive event Ptr pNode = NodeList::GetNode(node); - Ptr pMpiRec = 0; + Ptr pMpiRec = nullptr; uint32_t nDevices = pNode->GetNDevices(); for (uint32_t i = 0; i < nDevices; ++i) { diff --git a/src/mpi/model/granted-time-window-mpi-interface.h b/src/mpi/model/granted-time-window-mpi-interface.h index 7e493c089..c5365544c 100644 --- a/src/mpi/model/granted-time-window-mpi-interface.h +++ b/src/mpi/model/granted-time-window-mpi-interface.h @@ -96,18 +96,18 @@ class GrantedTimeWindowMpiInterface : public ParallelCommunicationInterface, Obj * Register this type. * \return The object TypeId. */ - static TypeId GetTypeId(void); + static TypeId GetTypeId(); // Inherited - virtual void Destroy(); - virtual uint32_t GetSystemId(); - virtual uint32_t GetSize(); - virtual bool IsEnabled(); - virtual void Enable(int* pargc, char*** pargv); - virtual void Enable(MPI_Comm communicator); - virtual void Disable(); - virtual void SendPacket(Ptr p, const Time& rxTime, uint32_t node, uint32_t dev); - virtual MPI_Comm GetCommunicator(); + void Destroy() override; + uint32_t GetSystemId() override; + uint32_t GetSize() override; + bool IsEnabled() override; + void Enable(int* pargc, char*** pargv) override; + void Enable(MPI_Comm communicator) override; + void Disable() override; + void SendPacket(Ptr p, const Time& rxTime, uint32_t node, uint32_t dev) override; + MPI_Comm GetCommunicator() override; private: /* diff --git a/src/mpi/model/mpi-interface.cc b/src/mpi/model/mpi-interface.cc index 1700a1599..c7c97cefd 100644 --- a/src/mpi/model/mpi-interface.cc +++ b/src/mpi/model/mpi-interface.cc @@ -37,7 +37,7 @@ namespace ns3 NS_LOG_COMPONENT_DEFINE("MpiInterface"); -ParallelCommunicationInterface* MpiInterface::g_parallelCommunicationInterface = 0; +ParallelCommunicationInterface* MpiInterface::g_parallelCommunicationInterface = nullptr; void MpiInterface::Destroy() @@ -50,18 +50,26 @@ uint32_t MpiInterface::GetSystemId() { if (g_parallelCommunicationInterface) + { return g_parallelCommunicationInterface->GetSystemId(); + } else + { return 0; + } } uint32_t MpiInterface::GetSize() { if (g_parallelCommunicationInterface) + { return g_parallelCommunicationInterface->GetSize(); + } else + { return 1; + } } bool @@ -78,7 +86,7 @@ MpiInterface::IsEnabled() } void -MpiInterface::SetParallelSimulatorImpl(void) +MpiInterface::SetParallelSimulatorImpl() { StringValue simulationTypeValue; bool useDefault = true; @@ -89,12 +97,12 @@ MpiInterface::SetParallelSimulatorImpl(void) // Set communication interface based on the simulation type being used. // Defaults to synchronous. - if (simulationType.compare("ns3::NullMessageSimulatorImpl") == 0) + if (simulationType == "ns3::NullMessageSimulatorImpl") { g_parallelCommunicationInterface = new NullMessageMpiInterface(); useDefault = false; } - else if (simulationType.compare("ns3::DistributedSimulatorImpl") == 0) + else if (simulationType == "ns3::DistributedSimulatorImpl") { g_parallelCommunicationInterface = new GrantedTimeWindowMpiInterface(); useDefault = false; @@ -147,7 +155,7 @@ MpiInterface::Disable() NS_ASSERT(g_parallelCommunicationInterface); g_parallelCommunicationInterface->Disable(); delete g_parallelCommunicationInterface; - g_parallelCommunicationInterface = 0; + g_parallelCommunicationInterface = nullptr; } } // namespace ns3 diff --git a/src/mpi/model/mpi-interface.h b/src/mpi/model/mpi-interface.h index 587423f1d..bc12d685e 100644 --- a/src/mpi/model/mpi-interface.h +++ b/src/mpi/model/mpi-interface.h @@ -159,7 +159,7 @@ class MpiInterface /** * Common enable logic. */ - static void SetParallelSimulatorImpl(void); + static void SetParallelSimulatorImpl(); /** * Static instance of the instantiated parallel controller. diff --git a/src/mpi/model/mpi-receiver.cc b/src/mpi/model/mpi-receiver.cc index 9d749caaa..d03f83304 100644 --- a/src/mpi/model/mpi-receiver.cc +++ b/src/mpi/model/mpi-receiver.cc @@ -28,7 +28,7 @@ namespace ns3 { TypeId -MpiReceiver::GetTypeId(void) +MpiReceiver::GetTypeId() { static TypeId tid = TypeId("ns3::MpiReceiver") .SetParent() @@ -55,7 +55,7 @@ MpiReceiver::Receive(Ptr p) } void -MpiReceiver::DoDispose(void) +MpiReceiver::DoDispose() { m_rxCallback = MakeNullCallback>(); } diff --git a/src/mpi/model/mpi-receiver.h b/src/mpi/model/mpi-receiver.h index 6a4bed8d6..8cdc220ad 100644 --- a/src/mpi/model/mpi-receiver.h +++ b/src/mpi/model/mpi-receiver.h @@ -51,8 +51,8 @@ class MpiReceiver : public Object * Register this type. * \return The object TypeId. */ - static TypeId GetTypeId(void); - virtual ~MpiReceiver(); + static TypeId GetTypeId(); + ~MpiReceiver() override; /** * \brief Direct an incoming packet to the device Receive() method @@ -66,7 +66,7 @@ class MpiReceiver : public Object void SetReceiveCallback(Callback> callback); private: - virtual void DoDispose(void); + void DoDispose() override; /** Callback to send received packets to. */ Callback> m_rxCallback; diff --git a/src/mpi/model/null-message-mpi-interface.cc b/src/mpi/model/null-message-mpi-interface.cc index 5964f324f..2c12e7473 100644 --- a/src/mpi/model/null-message-mpi-interface.cc +++ b/src/mpi/model/null-message-mpi-interface.cc @@ -96,8 +96,8 @@ const uint32_t NULL_MESSAGE_MAX_MPI_MSG_SIZE = 2000; NullMessageSentBuffer::NullMessageSentBuffer() { - m_buffer = 0; - m_request = 0; + m_buffer = nullptr; + m_request = nullptr; } NullMessageSentBuffer::~NullMessageSentBuffer() @@ -137,7 +137,7 @@ MPI_Request* NullMessageMpiInterface::g_requests; char** NullMessageMpiInterface::g_pRxBuffers; TypeId -NullMessageMpiInterface::GetTypeId(void) +NullMessageMpiInterface::GetTypeId() { static TypeId tid = TypeId("ns3::NullMessageMpiInterface").SetParent().SetGroupName("Mpi"); @@ -228,7 +228,7 @@ NullMessageMpiInterface::Enable(MPI_Comm communicator) } void -NullMessageMpiInterface::InitializeSendReceiveBuffers(void) +NullMessageMpiInterface::InitializeSendReceiveBuffers() { NS_LOG_FUNCTION_NOARGS(); NS_ASSERT(g_enabled); @@ -414,7 +414,7 @@ NullMessageMpiInterface::ReceiveMessages(bool blocking) // Find the correct node/device to schedule receive event Ptr pNode = NodeList::GetNode(node); - Ptr pMpiRec = 0; + Ptr pMpiRec = nullptr; uint32_t nDevices = pNode->GetNDevices(); for (uint32_t i = 0; i < nDevices; ++i) { diff --git a/src/mpi/model/null-message-mpi-interface.h b/src/mpi/model/null-message-mpi-interface.h index 4409b374d..dad2dade9 100644 --- a/src/mpi/model/null-message-mpi-interface.h +++ b/src/mpi/model/null-message-mpi-interface.h @@ -55,21 +55,21 @@ class NullMessageMpiInterface : public ParallelCommunicationInterface, Object * Register this type. * \return The object TypeId. */ - static TypeId GetTypeId(void); + static TypeId GetTypeId(); NullMessageMpiInterface(); - ~NullMessageMpiInterface(); + ~NullMessageMpiInterface() override; // Inherited - virtual void Destroy(); - virtual uint32_t GetSystemId(); - virtual uint32_t GetSize(); - virtual bool IsEnabled(); - virtual void Enable(int* pargc, char*** pargv); - virtual void Enable(MPI_Comm communicator); - virtual void Disable(); - virtual void SendPacket(Ptr p, const Time& rxTime, uint32_t node, uint32_t dev); - virtual MPI_Comm GetCommunicator(); + void Destroy() override; + uint32_t GetSystemId() override; + uint32_t GetSize() override; + bool IsEnabled() override; + void Enable(int* pargc, char*** pargv) override; + void Enable(MPI_Comm communicator) override; + void Disable() override; + void SendPacket(Ptr p, const Time& rxTime, uint32_t node, uint32_t dev) override; + MPI_Comm GetCommunicator() override; private: /** @@ -121,7 +121,7 @@ class NullMessageMpiInterface : public ParallelCommunicationInterface, Object * This method should be called after all links have been added to the RemoteChannelBundle * manager to setup any required send and receive buffers. */ - static void InitializeSendReceiveBuffers(void); + static void InitializeSendReceiveBuffers(); /** * Check for received messages complete. Will block until message diff --git a/src/mpi/model/null-message-simulator-impl.cc b/src/mpi/model/null-message-simulator-impl.cc index 0a86f0dff..7cf4a5a12 100644 --- a/src/mpi/model/null-message-simulator-impl.cc +++ b/src/mpi/model/null-message-simulator-impl.cc @@ -53,10 +53,10 @@ NS_LOG_COMPONENT_DEFINE("NullMessageSimulatorImpl"); NS_OBJECT_ENSURE_REGISTERED(NullMessageSimulatorImpl); -NullMessageSimulatorImpl* NullMessageSimulatorImpl::g_instance = 0; +NullMessageSimulatorImpl* NullMessageSimulatorImpl::g_instance = nullptr; TypeId -NullMessageSimulatorImpl::GetTypeId(void) +NullMessageSimulatorImpl::GetTypeId() { static TypeId tid = TypeId("ns3::NullMessageSimulatorImpl") @@ -85,11 +85,11 @@ NullMessageSimulatorImpl::NullMessageSimulatorImpl() m_currentContext = Simulator::NO_CONTEXT; m_unscheduledEvents = 0; m_eventCount = 0; - m_events = 0; + m_events = nullptr; m_safeTime = Seconds(0); - NS_ASSERT(g_instance == 0); + NS_ASSERT(g_instance == nullptr); g_instance = this; } @@ -99,7 +99,7 @@ NullMessageSimulatorImpl::~NullMessageSimulatorImpl() } void -NullMessageSimulatorImpl::DoDispose(void) +NullMessageSimulatorImpl::DoDispose() { NS_LOG_FUNCTION(this); @@ -108,7 +108,7 @@ NullMessageSimulatorImpl::DoDispose(void) Scheduler::Event next = m_events->RemoveNext(); next.impl->Unref(); } - m_events = 0; + m_events = nullptr; SimulatorImpl::DoDispose(); } @@ -133,7 +133,7 @@ NullMessageSimulatorImpl::Destroy() } void -NullMessageSimulatorImpl::CalculateLookAhead(void) +NullMessageSimulatorImpl::CalculateLookAhead() { NS_LOG_FUNCTION(this); @@ -227,7 +227,7 @@ NullMessageSimulatorImpl::SetScheduler(ObjectFactory schedulerFactory) } void -NullMessageSimulatorImpl::ProcessOneEvent(void) +NullMessageSimulatorImpl::ProcessOneEvent() { NS_LOG_FUNCTION(this); @@ -248,13 +248,13 @@ NullMessageSimulatorImpl::ProcessOneEvent(void) } bool -NullMessageSimulatorImpl::IsFinished(void) const +NullMessageSimulatorImpl::IsFinished() const { return m_events->IsEmpty() || m_stop; } Time -NullMessageSimulatorImpl::Next(void) const +NullMessageSimulatorImpl::Next() const { NS_LOG_FUNCTION(this); @@ -304,7 +304,7 @@ NullMessageSimulatorImpl::RescheduleNullMessageEvent(uint32_t nodeSysId) } void -NullMessageSimulatorImpl::Run(void) +NullMessageSimulatorImpl::Run() { NS_LOG_FUNCTION(this); @@ -332,7 +332,7 @@ NullMessageSimulatorImpl::Run(void) } void -NullMessageSimulatorImpl::HandleArrivingMessagesNonBlocking(void) +NullMessageSimulatorImpl::HandleArrivingMessagesNonBlocking() { NS_LOG_FUNCTION(this); @@ -345,7 +345,7 @@ NullMessageSimulatorImpl::HandleArrivingMessagesNonBlocking(void) } void -NullMessageSimulatorImpl::HandleArrivingMessagesBlocking(void) +NullMessageSimulatorImpl::HandleArrivingMessagesBlocking() { NS_LOG_FUNCTION(this); @@ -379,7 +379,7 @@ NullMessageSimulatorImpl::GetSystemId() const } void -NullMessageSimulatorImpl::Stop(void) +NullMessageSimulatorImpl::Stop() { NS_LOG_FUNCTION(this); @@ -456,7 +456,7 @@ NullMessageSimulatorImpl::ScheduleDestroy(EventImpl* event) } Time -NullMessageSimulatorImpl::Now(void) const +NullMessageSimulatorImpl::Now() const { return TimeStep(m_currentTs); } @@ -521,7 +521,7 @@ NullMessageSimulatorImpl::IsExpired(const EventId& id) const { if (id.GetUid() == EventId::UID::DESTROY) { - if (id.PeekEventImpl() == 0 || id.PeekEventImpl()->IsCancelled()) + if (id.PeekEventImpl() == nullptr || id.PeekEventImpl()->IsCancelled()) { return true; } @@ -536,7 +536,7 @@ NullMessageSimulatorImpl::IsExpired(const EventId& id) const } return true; } - if (id.PeekEventImpl() == 0 || id.GetTs() < m_currentTs || + if (id.PeekEventImpl() == nullptr || id.GetTs() < m_currentTs || (id.GetTs() == m_currentTs && id.GetUid() <= m_currentUid) || id.PeekEventImpl()->IsCancelled()) { @@ -549,7 +549,7 @@ NullMessageSimulatorImpl::IsExpired(const EventId& id) const } Time -NullMessageSimulatorImpl::GetMaximumSimulationTime(void) const +NullMessageSimulatorImpl::GetMaximumSimulationTime() const { // XXX: I am fairly certain other compilers use other non-standard // post-fixes to indicate 64 bit constants. @@ -557,13 +557,13 @@ NullMessageSimulatorImpl::GetMaximumSimulationTime(void) const } uint32_t -NullMessageSimulatorImpl::GetContext(void) const +NullMessageSimulatorImpl::GetContext() const { return m_currentContext; } uint64_t -NullMessageSimulatorImpl::GetEventCount(void) const +NullMessageSimulatorImpl::GetEventCount() const { return m_eventCount; } @@ -589,9 +589,9 @@ NullMessageSimulatorImpl::NullMessageEventHandler(RemoteChannelBundle* bundle) } NullMessageSimulatorImpl* -NullMessageSimulatorImpl::GetInstance(void) +NullMessageSimulatorImpl::GetInstance() { - NS_ASSERT(g_instance != 0); + NS_ASSERT(g_instance != nullptr); return g_instance; } } // namespace ns3 diff --git a/src/mpi/model/null-message-simulator-impl.h b/src/mpi/model/null-message-simulator-impl.h index b17b12b87..e4c38c336 100644 --- a/src/mpi/model/null-message-simulator-impl.h +++ b/src/mpi/model/null-message-simulator-impl.h @@ -54,42 +54,42 @@ class NullMessageSimulatorImpl : public SimulatorImpl * Register this type. * \return The object TypeId. */ - static TypeId GetTypeId(void); + static TypeId GetTypeId(); /** Default constructor. */ NullMessageSimulatorImpl(); /** Destructor. */ - ~NullMessageSimulatorImpl(); + ~NullMessageSimulatorImpl() override; // virtual from SimulatorImpl - virtual void Destroy(); - virtual bool IsFinished(void) const; - virtual void Stop(void); - virtual void Stop(const Time& delay); - virtual EventId Schedule(const Time& delay, EventImpl* event); - virtual void ScheduleWithContext(uint32_t context, const Time& delay, EventImpl* event); - virtual EventId ScheduleNow(EventImpl* event); - virtual EventId ScheduleDestroy(EventImpl* event); - virtual void Remove(const EventId& id); - virtual void Cancel(const EventId& id); - virtual bool IsExpired(const EventId& id) const; - virtual void Run(void); + void Destroy() override; + bool IsFinished() const override; + void Stop() override; + void Stop(const Time& delay) override; + EventId Schedule(const Time& delay, EventImpl* event) override; + void ScheduleWithContext(uint32_t context, const Time& delay, EventImpl* event) override; + EventId ScheduleNow(EventImpl* event) override; + EventId ScheduleDestroy(EventImpl* event) override; + void Remove(const EventId& id) override; + void Cancel(const EventId& id) override; + bool IsExpired(const EventId& id) const override; + void Run() override; - virtual Time Now(void) const; - virtual Time GetDelayLeft(const EventId& id) const; - virtual Time GetMaximumSimulationTime(void) const; - virtual void SetScheduler(ObjectFactory schedulerFactory); - virtual uint32_t GetSystemId(void) const; - virtual uint32_t GetContext(void) const; - virtual uint64_t GetEventCount(void) const; + Time Now() const override; + Time GetDelayLeft(const EventId& id) const override; + Time GetMaximumSimulationTime() const override; + void SetScheduler(ObjectFactory schedulerFactory) override; + uint32_t GetSystemId() const override; + uint32_t GetContext() const override; + uint64_t GetEventCount() const override; /** * \return singleton instance * * Singleton accessor. */ - static NullMessageSimulatorImpl* GetInstance(void); + static NullMessageSimulatorImpl* GetInstance(); private: friend class NullMessageEvent; @@ -99,35 +99,35 @@ class NullMessageSimulatorImpl : public SimulatorImpl /** * Non blocking receive of pending messages. */ - void HandleArrivingMessagesNonBlocking(void); + void HandleArrivingMessagesNonBlocking(); /** * Blocking receive of arriving messages. */ - void HandleArrivingMessagesBlocking(void); + void HandleArrivingMessagesBlocking(); - virtual void DoDispose(void); + void DoDispose() override; /** * Calculate the lookahead allowable for this MPI task. Basically * the minimum latency on links to neighbor MPI tasks. */ - void CalculateLookAhead(void); + void CalculateLookAhead(); /** * Process the next event on the queue. */ - void ProcessOneEvent(void); + void ProcessOneEvent(); /** * \return next local event time. */ - Time Next(void) const; + Time Next() const; /** * Calculate the SafeTime. Should be called after message receives. */ - void CalculateSafeTime(void); + void CalculateSafeTime(); /** * Get the current SafeTime; the maximum time that events can @@ -135,7 +135,7 @@ class NullMessageSimulatorImpl : public SimulatorImpl * MPI tasks. * \return the current SafeTime */ - Time GetSafeTime(void); + Time GetSafeTime(); /** * \param bundle Bundle to schedule Null Message event for diff --git a/src/mpi/model/remote-channel-bundle-manager.cc b/src/mpi/model/remote-channel-bundle-manager.cc index 3dfcc046d..c7d094716 100644 --- a/src/mpi/model/remote-channel-bundle-manager.cc +++ b/src/mpi/model/remote-channel-bundle-manager.cc @@ -46,7 +46,7 @@ RemoteChannelBundleManager::Find(uint32_t systemId) if (kv == g_remoteChannelBundles.end()) { - return 0; + return nullptr; } else { @@ -68,13 +68,13 @@ RemoteChannelBundleManager::Add(uint32_t systemId) } std::size_t -RemoteChannelBundleManager::Size(void) +RemoteChannelBundleManager::Size() { return g_remoteChannelBundles.size(); } void -RemoteChannelBundleManager::InitializeNullMessageEvents(void) +RemoteChannelBundleManager::InitializeNullMessageEvents() { NS_ASSERT(!g_initialized); @@ -92,7 +92,7 @@ RemoteChannelBundleManager::InitializeNullMessageEvents(void) } Time -RemoteChannelBundleManager::GetSafeTime(void) +RemoteChannelBundleManager::GetSafeTime() { NS_ASSERT(g_initialized); @@ -109,7 +109,7 @@ RemoteChannelBundleManager::GetSafeTime(void) } void -RemoteChannelBundleManager::Destroy(void) +RemoteChannelBundleManager::Destroy() { NS_ASSERT(g_initialized); diff --git a/src/mpi/model/remote-channel-bundle-manager.h b/src/mpi/model/remote-channel-bundle-manager.h index e0ed85666..0c86a9af2 100644 --- a/src/mpi/model/remote-channel-bundle-manager.h +++ b/src/mpi/model/remote-channel-bundle-manager.h @@ -69,22 +69,22 @@ class RemoteChannelBundleManager * Get the number of ns-3 channels in this bundle * \return The number of channels. */ - static std::size_t Size(void); + static std::size_t Size(); /** * Setup initial Null Message events for every RemoteChannelBundle. * All RemoteChannelBundles should be added before this method is invoked. */ - static void InitializeNullMessageEvents(void); + static void InitializeNullMessageEvents(); /** * Get the safe time across all channels in this bundle. * \return The safe time. */ - static Time GetSafeTime(void); + static Time GetSafeTime(); /** Destroy the singleton. */ - static void Destroy(void); + static void Destroy(); private: /** diff --git a/src/mpi/model/remote-channel-bundle.cc b/src/mpi/model/remote-channel-bundle.cc index 0a3698724..c6612640f 100644 --- a/src/mpi/model/remote-channel-bundle.cc +++ b/src/mpi/model/remote-channel-bundle.cc @@ -35,7 +35,7 @@ namespace ns3 { TypeId -RemoteChannelBundle::GetTypeId(void) +RemoteChannelBundle::GetTypeId() { static TypeId tid = TypeId("ns3::RemoteChannelBundle") .SetParent() @@ -72,7 +72,7 @@ RemoteChannelBundle::GetSystemId() const } Time -RemoteChannelBundle::GetGuaranteeTime(void) const +RemoteChannelBundle::GetGuaranteeTime() const { return m_guaranteeTime; } @@ -86,7 +86,7 @@ RemoteChannelBundle::SetGuaranteeTime(Time time) } Time -RemoteChannelBundle::GetDelay(void) const +RemoteChannelBundle::GetDelay() const { return m_delay; } @@ -98,13 +98,13 @@ RemoteChannelBundle::SetEventId(EventId id) } EventId -RemoteChannelBundle::GetEventId(void) const +RemoteChannelBundle::GetEventId() const { return m_nullEventId; } std::size_t -RemoteChannelBundle::GetSize(void) const +RemoteChannelBundle::GetSize() const { return m_channels.size(); } @@ -122,7 +122,7 @@ operator<<(std::ostream& out, ns3::RemoteChannelBundle& bundle) << ", GuaranteeTime = " << bundle.m_guaranteeTime << ", Delay = " << bundle.m_delay << std::endl; - for (auto element : bundle.m_channels) + for (const auto& element : bundle.m_channels) { out << "\t" << element.second << std::endl; } diff --git a/src/mpi/model/remote-channel-bundle.h b/src/mpi/model/remote-channel-bundle.h index e24d7f58d..27f18695e 100644 --- a/src/mpi/model/remote-channel-bundle.h +++ b/src/mpi/model/remote-channel-bundle.h @@ -55,7 +55,7 @@ class RemoteChannelBundle : public Object * Register this type. * \return The object TypeId. */ - static TypeId GetTypeId(void); + static TypeId GetTypeId(); /** Default constructor. */ RemoteChannelBundle(); @@ -67,7 +67,7 @@ class RemoteChannelBundle : public Object RemoteChannelBundle(const uint32_t remoteSystemId); /** Destructor. */ - ~RemoteChannelBundle() + ~RemoteChannelBundle() override { } @@ -88,7 +88,7 @@ class RemoteChannelBundle : public Object * Get the current guarantee time for this bundle. * \return guarantee time */ - Time GetGuaranteeTime(void) const; + Time GetGuaranteeTime() const; /** * \param time The guarantee time. @@ -102,7 +102,7 @@ class RemoteChannelBundle : public Object * Get the minimum delay along any channel in this bundle * \return The minimum delay. */ - Time GetDelay(void) const; + Time GetDelay() const; /** * Set the event ID of the Null Message send event currently scheduled @@ -116,13 +116,13 @@ class RemoteChannelBundle : public Object * Get the event ID of the Null Message send event for this bundle * \return The null message event id. */ - EventId GetEventId(void) const; + EventId GetEventId() const; /** * Get the number of ns-3 channels in this bundle * \return The number of channels. */ - std::size_t GetSize(void) const; + std::size_t GetSize() const; /** * \param time The delay from now when the null message should be received. diff --git a/src/mpi/test/mpi-test-suite.cc b/src/mpi/test/mpi-test-suite.cc index 4efb29ad6..92ece7c0a 100644 --- a/src/mpi/test/mpi-test-suite.cc +++ b/src/mpi/test/mpi-test-suite.cc @@ -46,7 +46,9 @@ class MpiTestCase : public ExampleAsTestCase const std::string args = ""); /** Destructor */ - virtual ~MpiTestCase(void){}; + ~MpiTestCase() override + { + } /** * Produce the `--command-template` argument which will invoke @@ -54,7 +56,7 @@ class MpiTestCase : public ExampleAsTestCase * * \returns The `--command-template` string. */ - std::string GetCommandTemplate(void) const; + std::string GetCommandTemplate() const override; /** * Sort the output from parallel execution. @@ -62,7 +64,7 @@ class MpiTestCase : public ExampleAsTestCase * * \returns Sort command */ - std::string GetPostProcessingCommand(void) const; + std::string GetPostProcessingCommand() const override; private: /** The number of ranks. */ @@ -80,7 +82,7 @@ MpiTestCase::MpiTestCase(const std::string name, } std::string -MpiTestCase::GetCommandTemplate(void) const +MpiTestCase::GetCommandTemplate() const { std::stringstream ss; ss << "mpiexec -n " << m_ranks << " %s --test " << m_args; @@ -88,7 +90,7 @@ MpiTestCase::GetCommandTemplate(void) const } std::string -MpiTestCase::GetPostProcessingCommand(void) const +MpiTestCase::GetPostProcessingCommand() const { std::string command("| grep TEST | sort "); return command; diff --git a/src/network/model/address.h b/src/network/model/address.h index afe5b4dba..392c7de2d 100644 --- a/src/network/model/address.h +++ b/src/network/model/address.h @@ -48,7 +48,7 @@ namespace ns3 * - allocate a type id with Address::Register * - provide a method to convert his new address to an Address * instance. This method is typically a member method named ConvertTo: - * Address MyAddress::ConvertTo (void) const; + * Address MyAddress::ConvertTo () const; * - provide a method to convert an Address instance back to * an instance of his new address type. This method is typically * a static member method of his address class named ConvertFrom: @@ -62,13 +62,13 @@ namespace ns3 * class MyAddress * { * public: - * Address ConvertTo (void) const; - * static MyAddress ConvertFrom (void); + * Address ConvertTo () const; + * static MyAddress ConvertFrom (); * private: - * static uint8_t GetType (void); + * static uint8_t GetType (); * }; * - * Address MyAddress::ConvertTo (void) const + * Address MyAddress::ConvertTo () const * { * return Address (GetType (), m_buffer, 2); * } @@ -79,7 +79,7 @@ namespace ns3 * address.CopyTo (ad.m_buffer, 2); * return ad; * } - * uint8_t MyAddress::GetType (void) + * uint8_t MyAddress::GetType () * { * static uint8_t type = Address::Register (); * return type; diff --git a/src/network/model/buffer.h b/src/network/model/buffer.h index 1d666ce57..bf36bcbf1 100644 --- a/src/network/model/buffer.h +++ b/src/network/model/buffer.h @@ -426,7 +426,7 @@ class Buffer * read. * The data is read in network format and returned in host format. * - * \warning this is the slow version, please use ReadNtohU16 (void) + * \warning this is the slow version, please use ReadNtohU16 () */ uint16_t SlowReadNtohU16(); /** @@ -436,7 +436,7 @@ class Buffer * read. * The data is read in network format and returned in host format. * - * \warning this is the slow version, please use ReadNtohU32 (void) + * \warning this is the slow version, please use ReadNtohU32 () */ uint32_t SlowReadNtohU32(); /** diff --git a/src/network/model/tag-buffer.cc b/src/network/model/tag-buffer.cc index 22664ab90..03a7b39c8 100644 --- a/src/network/model/tag-buffer.cc +++ b/src/network/model/tag-buffer.cc @@ -58,7 +58,7 @@ TagBuffer::WriteU32(uint32_t data) } uint8_t -TagBuffer::ReadU8(void) +TagBuffer::ReadU8() { NS_LOG_FUNCTION(this); NS_ASSERT(m_current + 1 <= m_end); @@ -69,7 +69,7 @@ TagBuffer::ReadU8(void) } uint16_t -TagBuffer::ReadU16(void) +TagBuffer::ReadU16() { NS_LOG_FUNCTION(this); uint8_t byte0 = ReadU8(); @@ -81,7 +81,7 @@ TagBuffer::ReadU16(void) } uint32_t -TagBuffer::ReadU32(void) +TagBuffer::ReadU32() { NS_LOG_FUNCTION(this); uint8_t byte0 = ReadU8(); diff --git a/src/network/test/pcap-file-test-suite.cc b/src/network/test/pcap-file-test-suite.cc index ab5d7f8f1..c5a1684ba 100644 --- a/src/network/test/pcap-file-test-suite.cc +++ b/src/network/test/pcap-file-test-suite.cc @@ -336,9 +336,9 @@ public: virtual ~AppendModeCreateTestCase (); private: - virtual void DoSetup (void); - virtual void DoRun (void); - virtual void DoTeardown (void); + virtual void DoSetup (); + virtual void DoRun (); + virtual void DoTeardown (); std::string m_testFilename; }; @@ -353,7 +353,7 @@ AppendModeCreateTestCase::~AppendModeCreateTestCase () } void -AppendModeCreateTestCase::DoSetup (void) +AppendModeCreateTestCase::DoSetup () { std::stringstream filename; uint32_t n = rand (); @@ -362,7 +362,7 @@ AppendModeCreateTestCase::DoSetup (void) } void -AppendModeCreateTestCase::DoTeardown (void) +AppendModeCreateTestCase::DoTeardown () { if (remove (m_testFilename.c_str ())) { @@ -371,7 +371,7 @@ AppendModeCreateTestCase::DoTeardown (void) } void -AppendModeCreateTestCase::DoRun (void) +AppendModeCreateTestCase::DoRun () { PcapFile f; diff --git a/src/network/utils/queue.h b/src/network/utils/queue.h index 71606e983..a42a57ea9 100644 --- a/src/network/utils/queue.h +++ b/src/network/utils/queue.h @@ -197,20 +197,20 @@ class QueueBase : public Object // Hence, it is disabled by default and must be explicitly // enabled with this method which specifies the size // of the average window in time units. - void EnableRunningAverage (Time averageWindow); - void DisableRunningAverage (void); + void EnableRunningAverage(Time averageWindow); + void DisableRunningAverage(); // average - double GetQueueSizeAverage (void); - double GetReceivedBytesPerSecondAverage (void); - double GetReceivedPacketsPerSecondAverage (void); - double GetDroppedBytesPerSecondAverage (void); - double GetDroppedPacketsPerSecondAverage (void); + double GetQueueSizeAverage(); + double GetReceivedBytesPerSecondAverage(); + double GetReceivedPacketsPerSecondAverage(); + double GetDroppedBytesPerSecondAverage(); + double GetDroppedPacketsPerSecondAverage(); // variance - double GetQueueSizeVariance (void); - double GetReceivedBytesPerSecondVariance (void); - double GetReceivedPacketsPerSecondVariance (void); - double GetDroppedBytesPerSecondVariance (void); - double GetDroppedPacketsPerSecondVariance (void); + double GetQueueSizeVariance(); + double GetReceivedBytesPerSecondVariance(); + double GetReceivedPacketsPerSecondVariance(); + double GetDroppedBytesPerSecondVariance(); + double GetDroppedPacketsPerSecondVariance(); #endif protected: diff --git a/src/nix-vector-routing/model/nix-vector-routing.cc b/src/nix-vector-routing/model/nix-vector-routing.cc index ade0e3ea3..f2ac640ea 100644 --- a/src/nix-vector-routing/model/nix-vector-routing.cc +++ b/src/nix-vector-routing/model/nix-vector-routing.cc @@ -1441,8 +1441,8 @@ NixVectorRouting::CheckCacheStateAndFlush() const /* Public template function declarations */ template void NixVectorRouting::SetNode(Ptr node); template void NixVectorRouting::SetNode(Ptr node); -template void NixVectorRouting::FlushGlobalNixRoutingCache(void) const; -template void NixVectorRouting::FlushGlobalNixRoutingCache(void) const; +template void NixVectorRouting::FlushGlobalNixRoutingCache() const; +template void NixVectorRouting::FlushGlobalNixRoutingCache() const; template void NixVectorRouting::PrintRoutingPath( Ptr source, IpAddress dest, diff --git a/src/openflow/examples/openflow-switch.cc b/src/openflow/examples/openflow-switch.cc index a416f4d70..8a52359d7 100644 --- a/src/openflow/examples/openflow-switch.cc +++ b/src/openflow/examples/openflow-switch.cc @@ -148,7 +148,9 @@ main(int argc, char* argv[]) { Ptr controller = CreateObject(); if (!timeout.IsZero()) + { controller->SetAttribute("ExpirationTime", TimeValue(timeout)); + } swtch.Install(switchNode, switchDevices, controller); } @@ -220,4 +222,6 @@ main(int argc, char* argv[]) #else NS_LOG_INFO("NS-3 OpenFlow is not enabled. Cannot run simulation."); #endif // NS3_OPENFLOW + + return 0; } diff --git a/src/openflow/model/openflow-interface.cc b/src/openflow/model/openflow-interface.cc index 599a6faf7..340489386 100644 --- a/src/openflow/model/openflow-interface.cc +++ b/src/openflow/model/openflow-interface.cc @@ -673,7 +673,7 @@ EricssonAction::Execute(er_action_type type, /* static */ TypeId -Controller::GetTypeId(void) +Controller::GetTypeId() { static TypeId tid = TypeId("ns3::ofi::Controller") .SetParent() @@ -786,7 +786,7 @@ Controller::StartDump(StatsDumpCallback* cb) /* static */ TypeId -DropController::GetTypeId(void) +DropController::GetTypeId() { static TypeId tid = TypeId("ns3::ofi::DropController") .SetParent() @@ -826,7 +826,7 @@ DropController::ReceiveFromSwitch(Ptr swtch, ofpbuf* bu } TypeId -LearningController::GetTypeId(void) +LearningController::GetTypeId() { static TypeId tid = TypeId("ns3::ofi::LearningController") diff --git a/src/openflow/model/openflow-interface.h b/src/openflow/model/openflow-interface.h index 4f7e630fa..7e1df3634 100644 --- a/src/openflow/model/openflow-interface.h +++ b/src/openflow/model/openflow-interface.h @@ -397,7 +397,7 @@ class Controller : public Object * Register this type. * \return The TypeId. */ - static TypeId GetTypeId(void); + static TypeId GetTypeId(); /** Destructor. */ virtual ~Controller(); @@ -497,7 +497,7 @@ class DropController : public Controller * Register this type. * \return The TypeId. */ - static TypeId GetTypeId(void); + static TypeId GetTypeId(); void ReceiveFromSwitch(Ptr swtch, ofpbuf* buffer); }; @@ -517,7 +517,7 @@ class LearningController : public Controller * Register this type. * \return The TypeId. */ - static TypeId GetTypeId(void); + static TypeId GetTypeId(); virtual ~LearningController() { diff --git a/src/openflow/model/openflow-switch-net-device.cc b/src/openflow/model/openflow-switch-net-device.cc index fecf86536..8283eccec 100644 --- a/src/openflow/model/openflow-switch-net-device.cc +++ b/src/openflow/model/openflow-switch-net-device.cc @@ -61,7 +61,7 @@ GenerateId() } TypeId -OpenFlowSwitchNetDevice::GetTypeId(void) +OpenFlowSwitchNetDevice::GetTypeId() { static TypeId tid = TypeId("ns3::OpenFlowSwitchNetDevice") @@ -214,14 +214,14 @@ OpenFlowSwitchNetDevice::SetIfIndex(const uint32_t index) } uint32_t -OpenFlowSwitchNetDevice::GetIfIndex(void) const +OpenFlowSwitchNetDevice::GetIfIndex() const { NS_LOG_FUNCTION_NOARGS(); return m_ifIndex; } Ptr -OpenFlowSwitchNetDevice::GetChannel(void) const +OpenFlowSwitchNetDevice::GetChannel() const { NS_LOG_FUNCTION_NOARGS(); return m_channel; @@ -235,7 +235,7 @@ OpenFlowSwitchNetDevice::SetAddress(Address address) } Address -OpenFlowSwitchNetDevice::GetAddress(void) const +OpenFlowSwitchNetDevice::GetAddress() const { NS_LOG_FUNCTION_NOARGS(); return m_address; @@ -250,14 +250,14 @@ OpenFlowSwitchNetDevice::SetMtu(const uint16_t mtu) } uint16_t -OpenFlowSwitchNetDevice::GetMtu(void) const +OpenFlowSwitchNetDevice::GetMtu() const { NS_LOG_FUNCTION_NOARGS(); return m_mtu; } bool -OpenFlowSwitchNetDevice::IsLinkUp(void) const +OpenFlowSwitchNetDevice::IsLinkUp() const { NS_LOG_FUNCTION_NOARGS(); return true; @@ -269,21 +269,21 @@ OpenFlowSwitchNetDevice::AddLinkChangeCallback(Callback callback) } bool -OpenFlowSwitchNetDevice::IsBroadcast(void) const +OpenFlowSwitchNetDevice::IsBroadcast() const { NS_LOG_FUNCTION_NOARGS(); return true; } Address -OpenFlowSwitchNetDevice::GetBroadcast(void) const +OpenFlowSwitchNetDevice::GetBroadcast() const { NS_LOG_FUNCTION_NOARGS(); return Mac48Address("ff:ff:ff:ff:ff:ff"); } bool -OpenFlowSwitchNetDevice::IsMulticast(void) const +OpenFlowSwitchNetDevice::IsMulticast() const { NS_LOG_FUNCTION_NOARGS(); return true; @@ -298,14 +298,14 @@ OpenFlowSwitchNetDevice::GetMulticast(Ipv4Address multicastGroup) const } bool -OpenFlowSwitchNetDevice::IsPointToPoint(void) const +OpenFlowSwitchNetDevice::IsPointToPoint() const { NS_LOG_FUNCTION_NOARGS(); return false; } bool -OpenFlowSwitchNetDevice::IsBridge(void) const +OpenFlowSwitchNetDevice::IsBridge() const { NS_LOG_FUNCTION_NOARGS(); return true; @@ -360,7 +360,7 @@ OpenFlowSwitchNetDevice::SendFrom(Ptr packet, } Ptr -OpenFlowSwitchNetDevice::GetNode(void) const +OpenFlowSwitchNetDevice::GetNode() const { NS_LOG_FUNCTION_NOARGS(); return m_node; @@ -374,7 +374,7 @@ OpenFlowSwitchNetDevice::SetNode(Ptr node) } bool -OpenFlowSwitchNetDevice::NeedsArp(void) const +OpenFlowSwitchNetDevice::NeedsArp() const { NS_LOG_FUNCTION_NOARGS(); return true; @@ -1660,7 +1660,7 @@ OpenFlowSwitchNetDevice::GetChain() } uint32_t -OpenFlowSwitchNetDevice::GetNSwitchPorts(void) const +OpenFlowSwitchNetDevice::GetNSwitchPorts() const { NS_LOG_FUNCTION_NOARGS(); return m_ports.size(); diff --git a/src/openflow/model/openflow-switch-net-device.h b/src/openflow/model/openflow-switch-net-device.h index 911fd291a..f021748c7 100644 --- a/src/openflow/model/openflow-switch-net-device.h +++ b/src/openflow/model/openflow-switch-net-device.h @@ -94,7 +94,7 @@ class OpenFlowSwitchNetDevice : public NetDevice * Register this type. * \return The TypeId. */ - static TypeId GetTypeId(void); + static TypeId GetTypeId(); /** * \name Descriptive Data @@ -212,7 +212,7 @@ class OpenFlowSwitchNetDevice : public NetDevice /** * \return Number of switch ports attached to this switch. */ - uint32_t GetNSwitchPorts(void) const; + uint32_t GetNSwitchPorts() const; /** * \param p The Port to get the index of. @@ -233,35 +233,35 @@ class OpenFlowSwitchNetDevice : public NetDevice // From NetDevice virtual void SetIfIndex(const uint32_t index); - virtual uint32_t GetIfIndex(void) const; - virtual Ptr GetChannel(void) const; + virtual uint32_t GetIfIndex() const; + virtual Ptr GetChannel() const; virtual void SetAddress(Address address); - virtual Address GetAddress(void) const; + virtual Address GetAddress() const; virtual bool SetMtu(const uint16_t mtu); - virtual uint16_t GetMtu(void) const; - virtual bool IsLinkUp(void) const; + virtual uint16_t GetMtu() const; + virtual bool IsLinkUp() const; virtual void AddLinkChangeCallback(Callback callback); - virtual bool IsBroadcast(void) const; - virtual Address GetBroadcast(void) const; - virtual bool IsMulticast(void) const; + virtual bool IsBroadcast() const; + virtual Address GetBroadcast() const; + virtual bool IsMulticast() const; virtual Address GetMulticast(Ipv4Address multicastGroup) const; - virtual bool IsPointToPoint(void) const; - virtual bool IsBridge(void) const; + virtual bool IsPointToPoint() const; + virtual bool IsBridge() const; virtual bool Send(Ptr packet, const Address& dest, uint16_t protocolNumber); virtual bool SendFrom(Ptr packet, const Address& source, const Address& dest, uint16_t protocolNumber); - virtual Ptr GetNode(void) const; + virtual Ptr GetNode() const; virtual void SetNode(Ptr node); - virtual bool NeedsArp(void) const; + virtual bool NeedsArp() const; virtual void SetReceiveCallback(NetDevice::ReceiveCallback cb); virtual void SetPromiscReceiveCallback(NetDevice::PromiscReceiveCallback cb); virtual bool SupportsSendFrom() const; virtual Address GetMulticast(Ipv6Address addr) const; protected: - virtual void DoDispose(void); + virtual void DoDispose(); /** * Called when a packet is received on one of the switch's ports. diff --git a/src/openflow/test/openflow-switch-test-suite.cc b/src/openflow/test/openflow-switch-test-suite.cc index b546df79c..88d6700b7 100644 --- a/src/openflow/test/openflow-switch-test-suite.cc +++ b/src/openflow/test/openflow-switch-test-suite.cc @@ -47,13 +47,13 @@ class SwitchFlowTableTestCase : public TestCase } private: - virtual void DoRun(void); + void DoRun() override; sw_chain* m_chain; //!< OpenFlow service function chain }; void -SwitchFlowTableTestCase::DoRun(void) +SwitchFlowTableTestCase::DoRun() { // Flow Table implementation is used by the OpenFlowSwitchNetDevice under the chain_ methods // we should test its implementation to verify the flow table works. @@ -66,7 +66,8 @@ SwitchFlowTableTestCase::DoRun(void) Mac48Address dl_src("00:00:00:00:00:00"), dl_dst("00:00:00:00:00:01"); Ipv4Address nw_src("192.168.1.1"), nw_dst("192.168.1.2"); - int tp_src = 5000, tp_dst = 80; + int tp_src = 5000; + int tp_dst = 80; // Create an sw_flow_key; in actual usage this is generated from the received packet's headers. sw_flow_key key; diff --git a/src/point-to-point/model/point-to-point-remote-channel.cc b/src/point-to-point/model/point-to-point-remote-channel.cc index a14efd296..5b2a741e6 100644 --- a/src/point-to-point/model/point-to-point-remote-channel.cc +++ b/src/point-to-point/model/point-to-point-remote-channel.cc @@ -36,7 +36,7 @@ NS_LOG_COMPONENT_DEFINE("PointToPointRemoteChannel"); NS_OBJECT_ENSURE_REGISTERED(PointToPointRemoteChannel); TypeId -PointToPointRemoteChannel::GetTypeId(void) +PointToPointRemoteChannel::GetTypeId() { static TypeId tid = TypeId("ns3::PointToPointRemoteChannel") .SetParent() diff --git a/src/point-to-point/model/point-to-point-remote-channel.h b/src/point-to-point/model/point-to-point-remote-channel.h index 3c1394e11..a6147e94b 100644 --- a/src/point-to-point/model/point-to-point-remote-channel.h +++ b/src/point-to-point/model/point-to-point-remote-channel.h @@ -46,7 +46,7 @@ class PointToPointRemoteChannel : public PointToPointChannel * * \return The TypeId for this class */ - static TypeId GetTypeId(void); + static TypeId GetTypeId(); /** * \brief Constructor @@ -56,7 +56,7 @@ class PointToPointRemoteChannel : public PointToPointChannel /** * \brief Deconstructor */ - ~PointToPointRemoteChannel(); + ~PointToPointRemoteChannel() override; /** * \brief Transmit the packet @@ -66,7 +66,7 @@ class PointToPointRemoteChannel : public PointToPointChannel * \param txTime Transmit time to apply * \returns true if successful (currently always true) */ - virtual bool TransmitStart(Ptr p, Ptr src, Time txTime); + bool TransmitStart(Ptr p, Ptr src, Time txTime) override; }; } // namespace ns3 diff --git a/src/stats/model/sqlite-data-output.cc b/src/stats/model/sqlite-data-output.cc index 773800776..2d36baee8 100644 --- a/src/stats/model/sqlite-data-output.cc +++ b/src/stats/model/sqlite-data-output.cc @@ -48,7 +48,7 @@ SqliteDataOutput::~SqliteDataOutput() /* static */ TypeId -SqliteDataOutput::GetTypeId(void) +SqliteDataOutput::GetTypeId() { static TypeId tid = TypeId("ns3::SqliteDataOutput") .SetParent() diff --git a/src/stats/model/sqlite-data-output.h b/src/stats/model/sqlite-data-output.h index 58b33a947..e0b32b3c7 100644 --- a/src/stats/model/sqlite-data-output.h +++ b/src/stats/model/sqlite-data-output.h @@ -48,7 +48,7 @@ class SqliteDataOutput : public DataOutputInterface * Register this type. * \return The TypeId. */ - static TypeId GetTypeId(void); + static TypeId GetTypeId(); virtual void Output(DataCollector& dc) override; diff --git a/src/visualizer/model/pyviz.cc b/src/visualizer/model/pyviz.cc index 64337af38..a586e5e66 100644 --- a/src/visualizer/model/pyviz.cc +++ b/src/visualizer/model/pyviz.cc @@ -61,19 +61,19 @@ PathSplit(std::string str) namespace ns3 { -static PyViz* g_visualizer = NULL; ///< the visualizer +static PyViz* g_visualizer = nullptr; ///< the visualizer /** * PyVizPacketTag structure */ struct PyVizPacketTag : public Tag { - static TypeId GetTypeId(void); - virtual TypeId GetInstanceTypeId(void) const; - virtual uint32_t GetSerializedSize(void) const; - virtual void Serialize(TagBuffer buf) const; - virtual void Deserialize(TagBuffer buf); - virtual void Print(std::ostream& os) const; + static TypeId GetTypeId(); + TypeId GetInstanceTypeId() const override; + uint32_t GetSerializedSize() const override; + void Serialize(TagBuffer buf) const override; + void Deserialize(TagBuffer buf) override; + void Print(std::ostream& os) const override; PyVizPacketTag(); uint32_t m_packetId; ///< packet id @@ -84,7 +84,7 @@ struct PyVizPacketTag : public Tag * \return the object TypeId */ TypeId -PyVizPacketTag::GetTypeId(void) +PyVizPacketTag::GetTypeId() { static TypeId tid = TypeId("ns3::PyVizPacketTag") .SetParent() @@ -94,13 +94,13 @@ PyVizPacketTag::GetTypeId(void) } TypeId -PyVizPacketTag::GetInstanceTypeId(void) const +PyVizPacketTag::GetInstanceTypeId() const { return GetTypeId(); } uint32_t -PyVizPacketTag::GetSerializedSize(void) const +PyVizPacketTag::GetSerializedSize() const { return 4; } @@ -131,7 +131,7 @@ PyVizPacketTag::PyVizPacketTag() PyViz::PyViz() { NS_LOG_FUNCTION_NOARGS(); - NS_ASSERT(g_visualizer == NULL); + NS_ASSERT(g_visualizer == nullptr); g_visualizer = this; // WiFi @@ -247,7 +247,7 @@ PyViz::~PyViz() NS_LOG_FUNCTION_NOARGS(); NS_ASSERT(g_visualizer == this); - g_visualizer = NULL; + g_visualizer = nullptr } void @@ -1085,24 +1085,40 @@ class FastClipping uint8_t lineCode = 0; if (line.end.y < m_clipMin.y) + { lineCode |= 8; + } else if (line.end.y > m_clipMax.y) + { lineCode |= 4; + } if (line.end.x > m_clipMax.x) + { lineCode |= 2; + } else if (line.end.x < m_clipMin.x) + { lineCode |= 1; + } if (line.start.y < m_clipMin.y) + { lineCode |= 128; + } else if (line.start.y > m_clipMax.y) + { lineCode |= 64; + } if (line.start.x > m_clipMax.x) + { lineCode |= 32; + } else if (line.start.x < m_clipMin.x) + { lineCode |= 16; + } // 9 - 8 - A // | | | @@ -1130,13 +1146,17 @@ class FastClipping case 0x05: ClipEndLeft(line); if (line.end.y > m_clipMax.y) + { ClipEndBottom(line); + } return true; case 0x06: ClipEndRight(line); if (line.end.y > m_clipMax.y) + { ClipEndBottom(line); + } return true; case 0x08: @@ -1146,13 +1166,17 @@ class FastClipping case 0x09: ClipEndLeft(line); if (line.end.y < m_clipMin.y) + { ClipEndTop(line); + } return true; case 0x0A: ClipEndRight(line); if (line.end.y < m_clipMin.y) + { ClipEndTop(line); + } return true; // left @@ -1168,33 +1192,45 @@ class FastClipping case 0x14: ClipStartLeft(line); if (line.start.y > m_clipMax.y) + { return false; + } ClipEndBottom(line); return true; case 0x16: ClipStartLeft(line); if (line.start.y > m_clipMax.y) + { return false; + } ClipEndBottom(line); if (line.end.x > m_clipMax.x) + { ClipEndRight(line); + } return true; case 0x18: ClipStartLeft(line); if (line.start.y < m_clipMin.y) + { return false; + } ClipEndTop(line); return true; case 0x1A: ClipStartLeft(line); if (line.start.y < m_clipMin.y) + { return false; + } ClipEndTop(line); if (line.end.x > m_clipMax.x) + { ClipEndRight(line); + } return true; // right @@ -1210,33 +1246,45 @@ class FastClipping case 0x24: ClipStartRight(line); if (line.start.y > m_clipMax.y) + { return false; + } ClipEndBottom(line); return true; case 0x25: ClipStartRight(line); if (line.start.y > m_clipMax.y) + { return false; + } ClipEndBottom(line); if (line.end.x < m_clipMin.x) + { ClipEndLeft(line); + } return true; case 0x28: ClipStartRight(line); if (line.start.y < m_clipMin.y) + { return false; + } ClipEndTop(line); return true; case 0x29: ClipStartRight(line); if (line.start.y < m_clipMin.y) + { return false; + } ClipEndTop(line); if (line.end.x < m_clipMin.x) + { ClipEndLeft(line); + } return true; // bottom @@ -1247,16 +1295,22 @@ class FastClipping case 0x41: ClipStartBottom(line); if (line.start.x < m_clipMin.x) + { return false; + } ClipEndLeft(line); if (line.end.y > m_clipMax.y) + { ClipEndBottom(line); + } return true; case 0x42: ClipStartBottom(line); if (line.start.x > m_clipMax.x) + { return false; + } ClipEndRight(line); return true; @@ -1268,95 +1322,139 @@ class FastClipping case 0x49: ClipStartBottom(line); if (line.start.x < m_clipMin.x) + { return false; + } ClipEndLeft(line); if (line.end.y < m_clipMin.y) + { ClipEndTop(line); + } return true; case 0x4A: ClipStartBottom(line); if (line.start.x > m_clipMax.x) + { return false; + } ClipEndRight(line); if (line.end.y < m_clipMin.y) + { ClipEndTop(line); + } return true; // bottom-left case 0x50: ClipStartLeft(line); if (line.start.y > m_clipMax.y) + { ClipStartBottom(line); + } return true; case 0x52: ClipEndRight(line); if (line.end.y > m_clipMax.y) + { return false; + } ClipStartBottom(line); if (line.start.x < m_clipMin.x) + { ClipStartLeft(line); + } return true; case 0x58: ClipEndTop(line); if (line.end.x < m_clipMin.x) + { return false; + } ClipStartBottom(line); if (line.start.x < m_clipMin.x) + { ClipStartLeft(line); + } return true; case 0x5A: ClipStartLeft(line); if (line.start.y < m_clipMin.y) + { return false; + } ClipEndRight(line); if (line.end.y > m_clipMax.y) + { return false; + } if (line.start.y > m_clipMax.y) + { ClipStartBottom(line); + } if (line.end.y < m_clipMin.y) + { ClipEndTop(line); + } return true; // bottom-right case 0x60: ClipStartRight(line); if (line.start.y > m_clipMax.y) + { ClipStartBottom(line); + } return true; case 0x61: ClipEndLeft(line); if (line.end.y > m_clipMax.y) + { return false; + } ClipStartBottom(line); if (line.start.x > m_clipMax.x) + { ClipStartRight(line); + } return true; case 0x68: ClipEndTop(line); if (line.end.x > m_clipMax.x) + { return false; + } ClipStartRight(line); if (line.start.y > m_clipMax.y) + { ClipStartBottom(line); + } return true; case 0x69: ClipEndLeft(line); if (line.end.y > m_clipMax.y) + { return false; + } ClipStartRight(line); if (line.start.y < m_clipMin.y) + { return false; + } if (line.end.y < m_clipMin.y) + { ClipEndTop(line); + } if (line.start.y > m_clipMax.y) + { ClipStartBottom(line); + } return true; // top @@ -1367,14 +1465,18 @@ class FastClipping case 0x81: ClipStartTop(line); if (line.start.x < m_clipMin.x) + { return false; + } ClipEndLeft(line); return true; case 0x82: ClipStartTop(line); if (line.start.x > m_clipMax.x) + { return false; + } ClipEndRight(line); return true; @@ -1386,95 +1488,139 @@ class FastClipping case 0x85: ClipStartTop(line); if (line.start.x < m_clipMin.x) + { return false; + } ClipEndLeft(line); if (line.end.y > m_clipMax.y) + { ClipEndBottom(line); + } return true; case 0x86: ClipStartTop(line); if (line.start.x > m_clipMax.x) + { return false; + } ClipEndRight(line); if (line.end.y > m_clipMax.y) + { ClipEndBottom(line); + } return true; // top-left case 0x90: ClipStartLeft(line); if (line.start.y < m_clipMin.y) + { ClipStartTop(line); + } return true; case 0x92: ClipEndRight(line); if (line.end.y < m_clipMin.y) + { return false; + } ClipStartTop(line); if (line.start.x < m_clipMin.x) + { ClipStartLeft(line); + } return true; case 0x94: ClipEndBottom(line); if (line.end.x < m_clipMin.x) + { return false; + } ClipStartLeft(line); if (line.start.y < m_clipMin.y) + { ClipStartTop(line); + } return true; case 0x96: ClipStartLeft(line); if (line.start.y > m_clipMax.y) + { return false; + } ClipEndRight(line); if (line.end.y < m_clipMin.y) + { return false; + } if (line.start.y < m_clipMin.y) + { ClipStartTop(line); + } if (line.end.y > m_clipMax.y) + { ClipEndBottom(line); + } return true; // top-right case 0xA0: ClipStartRight(line); if (line.start.y < m_clipMin.y) + { ClipStartTop(line); + } return true; case 0xA1: ClipEndLeft(line); if (line.end.y < m_clipMin.y) + { return false; + } ClipStartTop(line); if (line.start.x > m_clipMax.x) + { ClipStartRight(line); + } return true; case 0xA4: ClipEndBottom(line); if (line.end.x > m_clipMax.x) + { return false; + } ClipStartRight(line); if (line.start.y < m_clipMin.y) + { ClipStartTop(line); + } return true; case 0xA5: ClipEndLeft(line); if (line.end.y < m_clipMin.y) + { return false; + } ClipStartRight(line); if (line.start.y > m_clipMax.y) + { return false; + } if (line.end.y > m_clipMax.y) + { ClipEndBottom(line); + } if (line.start.y < m_clipMin.y) + { ClipStartTop(line); + } return true; } @@ -1493,7 +1639,8 @@ PyViz::LineClipping(double boundsX1, double& lineX2, double& lineY2) { - FastClipping::Vector2 clipMin = {boundsX1, boundsY1}, clipMax = {boundsX2, boundsY2}; + FastClipping::Vector2 clipMin = {boundsX1, boundsY1}; + FastClipping::Vector2 clipMax = {boundsX2, boundsY2}; FastClipping::Line line = {{lineX1, lineY1}, {lineX2, lineY2}, (lineX2 - lineX1), diff --git a/src/visualizer/model/visual-simulator-impl.cc b/src/visualizer/model/visual-simulator-impl.cc index b35816c84..6445c23f1 100644 --- a/src/visualizer/model/visual-simulator-impl.cc +++ b/src/visualizer/model/visual-simulator-impl.cc @@ -48,7 +48,7 @@ GetDefaultSimulatorImplFactory() } // namespace TypeId -VisualSimulatorImpl::GetTypeId(void) +VisualSimulatorImpl::GetTypeId() { static TypeId tid = TypeId("ns3::VisualSimulatorImpl") @@ -74,12 +74,12 @@ VisualSimulatorImpl::~VisualSimulatorImpl() } void -VisualSimulatorImpl::DoDispose(void) +VisualSimulatorImpl::DoDispose() { if (m_simulator) { m_simulator->Dispose(); - m_simulator = NULL; + m_simulator = nullptr; } SimulatorImpl::DoDispose(); } @@ -104,19 +104,19 @@ VisualSimulatorImpl::SetScheduler(ObjectFactory schedulerFactory) // System ID for non-distributed simulation is always zero uint32_t -VisualSimulatorImpl::GetSystemId(void) const +VisualSimulatorImpl::GetSystemId() const { return m_simulator->GetSystemId(); } bool -VisualSimulatorImpl::IsFinished(void) const +VisualSimulatorImpl::IsFinished() const { return m_simulator->IsFinished(); } void -VisualSimulatorImpl::Run(void) +VisualSimulatorImpl::Run() { if (!Py_IsInitialized()) { @@ -138,7 +138,7 @@ VisualSimulatorImpl::Run(void) } void -VisualSimulatorImpl::Stop(void) +VisualSimulatorImpl::Stop() { m_simulator->Stop(); } @@ -177,7 +177,7 @@ VisualSimulatorImpl::ScheduleDestroy(EventImpl* event) } Time -VisualSimulatorImpl::Now(void) const +VisualSimulatorImpl::Now() const { return m_simulator->Now(); } @@ -207,25 +207,25 @@ VisualSimulatorImpl::IsExpired(const EventId& id) const } Time -VisualSimulatorImpl::GetMaximumSimulationTime(void) const +VisualSimulatorImpl::GetMaximumSimulationTime() const { return m_simulator->GetMaximumSimulationTime(); } uint32_t -VisualSimulatorImpl::GetContext(void) const +VisualSimulatorImpl::GetContext() const { return m_simulator->GetContext(); } uint64_t -VisualSimulatorImpl::GetEventCount(void) const +VisualSimulatorImpl::GetEventCount() const { return m_simulator->GetEventCount(); } void -VisualSimulatorImpl::RunRealSimulator(void) +VisualSimulatorImpl::RunRealSimulator() { m_simulator->Run(); } diff --git a/src/visualizer/model/visual-simulator-impl.h b/src/visualizer/model/visual-simulator-impl.h index ab1bba197..43d592143 100644 --- a/src/visualizer/model/visual-simulator-impl.h +++ b/src/visualizer/model/visual-simulator-impl.h @@ -47,37 +47,38 @@ class VisualSimulatorImpl : public SimulatorImpl * \brief Get the type ID. * \return the object TypeId */ - static TypeId GetTypeId(void); + static TypeId GetTypeId(); VisualSimulatorImpl(); ~VisualSimulatorImpl(); - virtual void Destroy(); - virtual bool IsFinished(void) const; - virtual void Stop(void); - virtual void Stop(const Time& delay); - virtual EventId Schedule(const Time& delay, EventImpl* event); - virtual void ScheduleWithContext(uint32_t context, const Time& delay, EventImpl* event); - virtual EventId ScheduleNow(EventImpl* event); - virtual EventId ScheduleDestroy(EventImpl* event); - virtual void Remove(const EventId& id); - virtual void Cancel(const EventId& id); - virtual bool IsExpired(const EventId& id) const; - virtual void Run(void); - virtual Time Now(void) const; - virtual Time GetDelayLeft(const EventId& id) const; - virtual Time GetMaximumSimulationTime(void) const; - virtual void SetScheduler(ObjectFactory schedulerFactory); - virtual uint32_t GetSystemId(void) const; - virtual uint32_t GetContext(void) const; - virtual uint64_t GetEventCount(void) const; + // Inherited + void Destroy() override; + bool IsFinished() const override; + void Stop() override; + void Stop(const Time& delay) override; + EventId Schedule(const Time& delay, EventImpl* event) override; + void ScheduleWithContext(uint32_t context, const Time& delay, EventImpl* event) override; + EventId ScheduleNow(EventImpl* event) override; + EventId ScheduleDestroy(EventImpl* event) override; + void Remove(const EventId& id) override; + void Cancel(const EventId& id) override; + bool IsExpired(const EventId& id) const override; + void Run() override; + Time Now() const override; + Time GetDelayLeft(const EventId& id) const override; + Time GetMaximumSimulationTime() const override; + void SetScheduler(ObjectFactory schedulerFactory) override; + uint32_t GetSystemId() const override; + uint32_t GetContext() const override; + uint64_t GetEventCount() const override; /// calls Run() in the wrapped simulator - void RunRealSimulator(void); + void RunRealSimulator(); protected: void DoDispose(); - void NotifyConstructionCompleted(void); + void NotifyConstructionCompleted(); private: /** diff --git a/src/wifi/model/eht/eht-phy.cc b/src/wifi/model/eht/eht-phy.cc index 57eab3c09..77be185bb 100644 --- a/src/wifi/model/eht/eht-phy.cc +++ b/src/wifi/model/eht/eht-phy.cc @@ -222,7 +222,7 @@ EhtPhy::GetEhtMcs(uint8_t index) } #define GET_EHT_MCS(x) \ - WifiMode EhtPhy::GetEhtMcs##x(void) \ + WifiMode EhtPhy::GetEhtMcs##x() \ { \ static WifiMode mcs = CreateEhtMcs(x); \ return mcs; \ diff --git a/src/wifi/model/he/he-phy.cc b/src/wifi/model/he/he-phy.cc index 4500afe98..515f207b3 100644 --- a/src/wifi/model/he/he-phy.cc +++ b/src/wifi/model/he/he-phy.cc @@ -1469,7 +1469,7 @@ HePhy::GetHeMcs(uint8_t index) } #define GET_HE_MCS(x) \ - WifiMode HePhy::GetHeMcs##x(void) \ + WifiMode HePhy::GetHeMcs##x() \ { \ static WifiMode mcs = CreateHeMcs(x); \ return mcs; \ diff --git a/src/wifi/model/ht/ht-phy.cc b/src/wifi/model/ht/ht-phy.cc index dbbfdd8c4..50531b98f 100644 --- a/src/wifi/model/ht/ht-phy.cc +++ b/src/wifi/model/ht/ht-phy.cc @@ -536,7 +536,7 @@ HtPhy::GetHtMcs(uint8_t index) } #define GET_HT_MCS(x) \ - WifiMode HtPhy::GetHtMcs##x(void) \ + WifiMode HtPhy::GetHtMcs##x() \ { \ static WifiMode mcs = CreateHtMcs(x); \ return mcs; \ diff --git a/src/wifi/model/non-ht/dsss-phy.cc b/src/wifi/model/non-ht/dsss-phy.cc index 0093738b9..a58363dd5 100644 --- a/src/wifi/model/non-ht/dsss-phy.cc +++ b/src/wifi/model/non-ht/dsss-phy.cc @@ -309,7 +309,7 @@ DsssPhy::GetDsssRate(uint64_t rate) } #define GET_DSSS_MODE(x, m) \ - WifiMode DsssPhy::Get##x(void) \ + WifiMode DsssPhy::Get##x() \ { \ static WifiMode mode = CreateDsssMode(#x, WIFI_MOD_CLASS_##m); \ return mode; \ diff --git a/src/wifi/model/non-ht/erp-ofdm-phy.cc b/src/wifi/model/non-ht/erp-ofdm-phy.cc index 4badcc889..800a4d4a9 100644 --- a/src/wifi/model/non-ht/erp-ofdm-phy.cc +++ b/src/wifi/model/non-ht/erp-ofdm-phy.cc @@ -158,7 +158,7 @@ ErpOfdmPhy::GetErpOfdmRate(uint64_t rate) } #define GET_ERP_OFDM_MODE(x, f) \ - WifiMode ErpOfdmPhy::Get##x(void) \ + WifiMode ErpOfdmPhy::Get##x() \ { \ static WifiMode mode = CreateErpOfdmMode(#x, f); \ return mode; \ diff --git a/src/wifi/model/non-ht/ofdm-phy.cc b/src/wifi/model/non-ht/ofdm-phy.cc index ec6560d08..a041ab757 100644 --- a/src/wifi/model/non-ht/ofdm-phy.cc +++ b/src/wifi/model/non-ht/ofdm-phy.cc @@ -476,7 +476,7 @@ OfdmPhy::GetOfdmRate(uint64_t rate, uint16_t bw) } #define GET_OFDM_MODE(x, f) \ - WifiMode OfdmPhy::Get##x(void) \ + WifiMode OfdmPhy::Get##x() \ { \ static WifiMode mode = CreateOfdmMode(#x, f); \ return mode; \ diff --git a/src/wifi/model/txop.cc b/src/wifi/model/txop.cc index c3f1d67b9..f5546c3bd 100644 --- a/src/wifi/model/txop.cc +++ b/src/wifi/model/txop.cc @@ -61,7 +61,7 @@ Txop::GetTypeId() TypeId::ATTR_GET | TypeId::ATTR_SET, // do not set at construction time UintegerValue(15), MakeUintegerAccessor((void(Txop::*)(uint32_t)) & Txop::SetMinCw, - (uint32_t(Txop::*)(void) const) & Txop::GetMinCw), + (uint32_t(Txop::*)() const) & Txop::GetMinCw), MakeUintegerChecker()) .AddAttribute( "MinCws", @@ -77,7 +77,7 @@ Txop::GetTypeId() TypeId::ATTR_GET | TypeId::ATTR_SET, // do not set at construction time UintegerValue(1023), MakeUintegerAccessor((void(Txop::*)(uint32_t)) & Txop::SetMaxCw, - (uint32_t(Txop::*)(void) const) & Txop::GetMaxCw), + (uint32_t(Txop::*)() const) & Txop::GetMaxCw), MakeUintegerChecker()) .AddAttribute( "MaxCws", @@ -94,7 +94,7 @@ Txop::GetTypeId() TypeId::ATTR_GET | TypeId::ATTR_SET, // do not set at construction time UintegerValue(2), MakeUintegerAccessor((void(Txop::*)(uint8_t)) & Txop::SetAifsn, - (uint8_t(Txop::*)(void) const) & Txop::GetAifsn), + (uint8_t(Txop::*)() const) & Txop::GetAifsn), MakeUintegerChecker()) .AddAttribute( "Aifsns", @@ -110,7 +110,7 @@ Txop::GetTypeId() TypeId::ATTR_GET | TypeId::ATTR_SET, // do not set at construction time TimeValue(MilliSeconds(0)), MakeTimeAccessor((void(Txop::*)(Time)) & Txop::SetTxopLimit, - (Time(Txop::*)(void) const) & Txop::GetTxopLimit), + (Time(Txop::*)() const) & Txop::GetTxopLimit), MakeTimeChecker()) .AddAttribute( "TxopLimits", diff --git a/src/wifi/model/vht/vht-phy.cc b/src/wifi/model/vht/vht-phy.cc index 7d92be745..c00df82d8 100644 --- a/src/wifi/model/vht/vht-phy.cc +++ b/src/wifi/model/vht/vht-phy.cc @@ -367,7 +367,7 @@ VhtPhy::GetVhtMcs(uint8_t index) } #define GET_VHT_MCS(x) \ - WifiMode VhtPhy::GetVhtMcs##x(void) \ + WifiMode VhtPhy::GetVhtMcs##x() \ { \ static WifiMode mcs = CreateVhtMcs(x); \ return mcs; \ diff --git a/src/wifi/model/wifi-net-device.cc b/src/wifi/model/wifi-net-device.cc index a43a640c6..ba6a7b46a 100644 --- a/src/wifi/model/wifi-net-device.cc +++ b/src/wifi/model/wifi-net-device.cc @@ -64,7 +64,7 @@ WifiNetDevice::GetTypeId() .AddAttribute("Phy", "The PHY layer attached to this device.", PointerValue(), - MakePointerAccessor((Ptr(WifiNetDevice::*)(void) const) & + MakePointerAccessor((Ptr(WifiNetDevice::*)() const) & WifiNetDevice::GetPhy, &WifiNetDevice::SetPhy), MakePointerChecker()) @@ -84,7 +84,7 @@ WifiNetDevice::GetTypeId() "The station manager attached to this device.", PointerValue(), MakePointerAccessor(&WifiNetDevice::SetRemoteStationManager, - (Ptr(WifiNetDevice::*)(void) const) & + (Ptr(WifiNetDevice::*)() const) & WifiNetDevice::GetRemoteStationManager), MakePointerChecker()) .AddAttribute("RemoteStationManagers", diff --git a/src/wifi/model/wifi-phy.h b/src/wifi/model/wifi-phy.h index 923361134..dc8066a8b 100644 --- a/src/wifi/model/wifi-phy.h +++ b/src/wifi/model/wifi-phy.h @@ -341,7 +341,7 @@ class WifiPhy : public Object * \param modulation the modulation class * \return the list of supported (non-MCS) modes for the given modulation class. * - * \see GetModeList (void) + * \see GetModeList () */ std::list GetModeList(WifiModulationClass modulation) const; /** @@ -452,7 +452,7 @@ class WifiPhy : public Object /** * \return the number of supported MCSs. * - * \see GetMcsList (void) + * \see GetMcsList () */ uint16_t GetNMcs() const; /** @@ -471,7 +471,7 @@ class WifiPhy : public Object * \param modulation the modulation class * \return the list of supported MCSs for the given modulation class. * - * \see GetMcsList (void) + * \see GetMcsList () */ std::list GetMcsList(WifiModulationClass modulation) const; /** diff --git a/utils/print-introspected-doxygen.cc b/utils/print-introspected-doxygen.cc index add6ea4c6..45da82495 100644 --- a/utils/print-introspected-doxygen.cc +++ b/utils/print-introspected-doxygen.cc @@ -1250,7 +1250,7 @@ PrintAttributeValueWithName(std::ostream& os, if ((name == "EmptyAttribute") || (name == "ObjectPtrContainer")) { // Just default constructors. - os << "(void)\n"; + os << "()\n"; } else { @@ -1261,8 +1261,8 @@ PrintAttributeValueWithName(std::ostream& os, } os << commentStop; - // Value::Get (void) const - os << commentStart << functionStart << type << qualClass << "::Get (void) const\n" + // Value::Get () const + os << commentStart << functionStart << type << qualClass << "::Get () const\n" << returns << "The " << name << " value.\n" << commentStop; @@ -1350,9 +1350,9 @@ PrintMakeChecker(std::ostream& os, const std::string& name, const std::string& h os << commentStop; // \ingroup attribute_Value - // MakeChecker (void) + // MakeChecker () os << commentStart << sectAttr << functionStart << "ns3::Ptr " - << make << "(void)\n" + << make << "()\n" << returns << "The AttributeChecker.\n" << seeAlso << "AttributeChecker\n" << commentStop;