From c1e77573159e9aef037ee39b70595bc95f4495f9 Mon Sep 17 00:00:00 2001 From: Eduardo Almeida Date: Thu, 6 Oct 2022 22:20:10 +0000 Subject: [PATCH] Fix clang-tidy readability-isolate-declaration warnings --- examples/tcp/dctcp-example.cc | 5 ++- examples/tcp/tcp-bbr-example.cc | 3 +- examples/tcp/tcp-linux-reno.cc | 4 +- .../traffic-control/queue-discs-benchmark.cc | 8 +++- examples/wireless/wifi-80211e-txop.cc | 9 +++- examples/wireless/wifi-aggregation.cc | 9 +++- examples/wireless/wifi-he-network.cc | 3 +- examples/wireless/wifi-multi-tos.cc | 6 ++- examples/wireless/wifi-multirate.cc | 13 +++++- examples/wireless/wifi-txop-aggregation.cc | 9 +++- src/antenna/model/angles.cc | 3 +- src/aodv/model/aodv-rtable.cc | 5 ++- .../model/bulk-send-application.cc | 6 ++- src/applications/model/onoff-application.cc | 3 +- src/config-store/model/raw-text-config.cc | 12 +++-- src/core/model/ascii-file.cc | 3 +- src/core/model/command-line.cc | 3 +- src/core/model/config.cc | 18 +++++--- src/core/model/int64x64-128.cc | 22 +++++++--- src/core/model/object-factory.cc | 3 +- src/core/model/random-variable-stream.cc | 19 +++++--- src/core/model/rng-stream.cc | 16 ++++--- src/core/model/system-path.cc | 3 +- src/core/model/test.cc | 3 +- src/core/model/vector.cc | 3 +- src/dsdv/model/dsdv-routing-protocol.cc | 9 ++-- src/dsdv/model/dsdv-rtable.cc | 6 ++- src/dsr/model/dsr-routing.cc | 3 +- src/internet-apps/model/dhcp-header.cc | 3 +- src/internet/model/ipv4-global-routing.cc | 5 ++- src/internet/model/ipv4-l3-protocol.cc | 3 +- src/internet/model/ipv4-static-routing.cc | 5 ++- src/internet/model/ipv6-static-routing.cc | 5 ++- src/internet/model/rip.cc | 5 ++- src/internet/model/ripng.cc | 5 ++- src/internet/model/tcp-bbr.cc | 3 +- src/internet/model/tcp-cubic.cc | 4 +- src/internet/model/tcp-illinois.cc | 3 +- src/internet/model/tcp-l4-protocol.cc | 9 ++-- src/internet/model/tcp-tx-buffer.cc | 3 +- src/internet/model/udp-l4-protocol.cc | 6 ++- src/internet/test/icmp-test.cc | 8 +++- src/internet/test/ipv4-forwarding-test.cc | 3 +- src/internet/test/ipv4-header-test.cc | 3 +- src/internet/test/ipv4-rip-test.cc | 21 ++++++--- src/internet/test/ipv6-ripng-test.cc | 21 ++++++--- src/internet/test/tcp-bbr-test.cc | 5 ++- src/internet/test/tcp-bic-test.cc | 7 ++- src/internet/test/tcp-header-test.cc | 14 ++++-- src/internet/test/tcp-illinois-test.cc | 3 +- src/internet/test/tcp-vegas-test.cc | 4 +- .../examples/lena-intercell-interference.cc | 3 +- src/lte/examples/lena-pathloss-traces.cc | 3 +- src/lte/model/lte-rlc-am-header.cc | 12 +++-- src/lte/model/lte-rlc-am.cc | 3 +- src/lte/model/lte-rlc-header.cc | 12 +++-- src/lte/model/lte-rlc-um.cc | 3 +- src/lte/model/lte-rrc-header.cc | 3 +- src/lte/test/lte-test-link-adaptation.cc | 3 +- src/lte/test/lte-test-pathloss-model.cc | 3 +- src/lte/test/test-asn1-encoding.cc | 3 +- src/mobility/model/box.cc | 6 ++- src/mobility/model/geographic-positions.cc | 3 +- src/mobility/model/position-allocator.cc | 10 +++-- src/mobility/model/rectangle.cc | 4 +- ...dy-state-random-waypoint-mobility-model.cc | 5 ++- src/netanim/model/animation-interface.cc | 3 +- src/network/model/address.cc | 3 +- .../test/drop-tail-queue-test-suite.cc | 5 ++- src/network/test/pcap-file-test-suite.cc | 16 +++++-- .../test/sequence-number-test-suite.cc | 7 ++- src/network/utils/dynamic-queue-limits.cc | 11 +++-- src/network/utils/packetbb.cc | 18 +++++--- src/network/utils/pcap-file.cc | 3 +- .../examples/nms-p2p-nix.cc | 21 +++++++-- .../model/nix-vector-routing.cc | 12 +++-- src/olsr/model/olsr-header.cc | 3 +- src/olsr/model/olsr-routing-protocol.cc | 15 ++++--- .../model/three-gpp-propagation-loss-model.cc | 3 +- .../model/matrix-based-channel-model.h | 3 +- src/spectrum/model/three-gpp-channel-model.cc | 44 ++++++++++++++----- ...ree-gpp-spectrum-propagation-loss-model.cc | 3 +- src/spectrum/test/spectrum-value-test.cc | 32 +++++++++++--- src/tap-bridge/model/tap-bridge.cc | 3 +- src/test/ns3tcp/ns3tcp-loss-test-suite.cc | 9 +++- src/test/ns3tcp/ns3tcp-state-test-suite.cc | 9 +++- .../ns3wifi/wifi-ac-mapping-test-suite.cc | 3 +- .../wifi-msdu-aggregator-test-suite.cc | 3 +- .../model/rocketfuel-topology-reader.cc | 3 +- .../examples/codel-vs-pfifo-basic-test.cc | 3 +- .../model/fq-cobalt-queue-disc.cc | 10 +++-- .../model/fq-codel-queue-disc.cc | 10 +++-- .../model/fq-pie-queue-disc.cc | 10 +++-- .../test/cobalt-queue-disc-test-suite.cc | 7 ++- .../test/codel-queue-disc-test-suite.cc | 11 ++++- .../test/pie-queue-disc-test-suite.cc | 9 +++- .../test/red-queue-disc-test-suite.cc | 9 +++- .../test/tbf-queue-disc-test-suite.cc | 6 ++- src/uan/model/uan-noise-model-default.cc | 11 ++++- src/uan/model/uan-phy-dual.cc | 3 +- src/wave/test/mac-extension-test-suite.cc | 3 +- src/wifi/examples/wifi-bianchi.cc | 3 +- src/wifi/examples/wifi-manager-example.cc | 4 +- src/wifi/helper/wifi-helper.cc | 3 +- src/wifi/model/error-rate-model.cc | 4 +- src/wifi/model/he/rr-multi-user-scheduler.cc | 4 +- src/wifi/model/mgt-headers.cc | 12 +++-- src/wifi/model/qos-utils.cc | 3 +- .../rate-control/minstrel-ht-wifi-manager.cc | 38 +++++++++++----- .../rate-control/minstrel-wifi-manager.cc | 3 +- .../model/rate-control/onoe-wifi-manager.cc | 3 +- .../model/table-based-error-rate-model.cc | 5 ++- src/wifi/model/wifi-information-element.cc | 3 +- src/wifi/model/wifi-remote-station-manager.cc | 3 +- src/wifi/test/block-ack-test-suite.cc | 6 ++- src/wifi/test/wifi-aggregation-test.cc | 3 +- src/wifi/test/wifi-eht-info-elems-test.cc | 4 +- src/wifi/test/wifi-mlo-test.cc | 3 +- src/wifi/test/wifi-phy-ofdma-test.cc | 4 +- src/wifi/test/wifi-test.cc | 18 +++++--- src/wimax/examples/wimax-ipv4.cc | 7 ++- src/wimax/examples/wimax-multicast.cc | 7 ++- src/wimax/examples/wimax-simple.cc | 6 ++- src/wimax/model/bs-net-device.cc | 11 +++-- .../model/snr-to-block-error-rate-manager.cc | 21 +++++++-- src/wimax/test/phy-test.cc | 3 +- src/wimax/test/qos-test.cc | 6 ++- src/wimax/test/ss-mac-test.cc | 6 ++- src/wimax/test/wimax-service-flow-test.cc | 3 +- utils/bench-scheduler.cc | 6 ++- 130 files changed, 701 insertions(+), 258 deletions(-) diff --git a/examples/tcp/dctcp-example.cc b/examples/tcp/dctcp-example.cc index 7f2b6e627..4750316a7 100644 --- a/examples/tcp/dctcp-example.cc +++ b/examples/tcp/dctcp-example.cc @@ -294,7 +294,10 @@ int main (int argc, char *argv[]) rxS2R2Bytes.reserve (20); rxS3R1Bytes.reserve (10); - NodeContainer S1, S2, S3, R2; + NodeContainer S1; + NodeContainer S2; + NodeContainer S3; + NodeContainer R2; Ptr T1 = CreateObject (); Ptr T2 = CreateObject (); Ptr R1 = CreateObject (); diff --git a/examples/tcp/tcp-bbr-example.cc b/examples/tcp/tcp-bbr-example.cc index 50f15df80..5c2e38685 100644 --- a/examples/tcp/tcp-bbr-example.cc +++ b/examples/tcp/tcp-bbr-example.cc @@ -140,7 +140,8 @@ int main (int argc, char *argv []) Config::SetDefault ("ns3::DropTailQueue::MaxSize", QueueSizeValue (QueueSize ("1p"))); Config::SetDefault (queueDisc + "::MaxSize", QueueSizeValue (QueueSize ("100p"))); - NodeContainer sender, receiver; + NodeContainer sender; + NodeContainer receiver; NodeContainer routers; sender.Create (1); receiver.Create (1); diff --git a/examples/tcp/tcp-linux-reno.cc b/examples/tcp/tcp-linux-reno.cc index 2029c2939..dade16f1b 100644 --- a/examples/tcp/tcp-linux-reno.cc +++ b/examples/tcp/tcp-linux-reno.cc @@ -151,7 +151,9 @@ int main (int argc, char *argv[]) } // Create nodes - NodeContainer leftNodes, rightNodes, routers; + NodeContainer leftNodes; + NodeContainer rightNodes; + NodeContainer routers; routers.Create (2); leftNodes.Create (1); rightNodes.Create (1); diff --git a/examples/traffic-control/queue-discs-benchmark.cc b/examples/traffic-control/queue-discs-benchmark.cc index 4bb90a936..b3a8770b4 100644 --- a/examples/traffic-control/queue-discs-benchmark.cc +++ b/examples/traffic-control/queue-discs-benchmark.cc @@ -153,7 +153,9 @@ int main (int argc, char *argv[]) float stopTime = startTime + simDuration; // Create nodes - NodeContainer n1, n2, n3; + NodeContainer n1; + NodeContainer n2; + NodeContainer n3; n1.Create (1); n2.Create (1); n3.Create (1); @@ -269,7 +271,9 @@ int main (int argc, char *argv[]) // Flows configuration // Bidirectional TCP streams with ping like flent tcp_bidirectional test. uint16_t port = 7; - ApplicationContainer uploadApp, downloadApp, sourceApps; + ApplicationContainer uploadApp; + ApplicationContainer downloadApp; + ApplicationContainer sourceApps; // Configure and install upload flow Address addUp (InetSocketAddress (Ipv4Address::GetAny (), port)); PacketSinkHelper sinkHelperUp ("ns3::TcpSocketFactory", addUp); diff --git a/examples/wireless/wifi-80211e-txop.cc b/examples/wireless/wifi-80211e-txop.cc index 2ef4b8f0e..61189d539 100644 --- a/examples/wireless/wifi-80211e-txop.cc +++ b/examples/wireless/wifi-80211e-txop.cc @@ -122,7 +122,14 @@ int main (int argc, char *argv[]) wifi.SetRemoteStationManager ("ns3::IdealWifiManager"); WifiMacHelper mac; - NetDeviceContainer staDeviceA, staDeviceB, staDeviceC, staDeviceD, apDeviceA, apDeviceB, apDeviceC, apDeviceD; + NetDeviceContainer staDeviceA; + NetDeviceContainer staDeviceB; + NetDeviceContainer staDeviceC; + NetDeviceContainer staDeviceD; + NetDeviceContainer apDeviceA; + NetDeviceContainer apDeviceB; + NetDeviceContainer apDeviceC; + NetDeviceContainer apDeviceD; Ssid ssid; //Network A diff --git a/examples/wireless/wifi-aggregation.cc b/examples/wireless/wifi-aggregation.cc index 75f50b865..a7d869f24 100644 --- a/examples/wireless/wifi-aggregation.cc +++ b/examples/wireless/wifi-aggregation.cc @@ -107,7 +107,14 @@ int main (int argc, char *argv[]) wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", "DataMode", StringValue ("HtMcs7"), "ControlMode", StringValue ("HtMcs0")); WifiMacHelper mac; - NetDeviceContainer staDeviceA, staDeviceB, staDeviceC, staDeviceD, apDeviceA, apDeviceB, apDeviceC, apDeviceD; + NetDeviceContainer staDeviceA; + NetDeviceContainer staDeviceB; + NetDeviceContainer staDeviceC; + NetDeviceContainer staDeviceD; + NetDeviceContainer apDeviceA; + NetDeviceContainer apDeviceB; + NetDeviceContainer apDeviceC; + NetDeviceContainer apDeviceD; Ssid ssid; // Network A diff --git a/examples/wireless/wifi-he-network.cc b/examples/wireless/wifi-he-network.cc index 9cd7f6bf5..db8076205 100644 --- a/examples/wireless/wifi-he-network.cc +++ b/examples/wireless/wifi-he-network.cc @@ -173,7 +173,8 @@ int main (int argc, char *argv[]) NodeContainer wifiApNode; wifiApNode.Create (1); - NetDeviceContainer apDevice, staDevices; + NetDeviceContainer apDevice; + NetDeviceContainer staDevices; WifiMacHelper mac; WifiHelper wifi; std::string channelStr ("{0, " + std::to_string (channelWidth) + ", "); diff --git a/examples/wireless/wifi-multi-tos.cc b/examples/wireless/wifi-multi-tos.cc index b50e88a0c..2e01fff1b 100644 --- a/examples/wireless/wifi-multi-tos.cc +++ b/examples/wireless/wifi-multi-tos.cc @@ -126,13 +126,15 @@ int main (int argc, char *argv[]) Ipv4AddressHelper address; address.SetBase ("192.168.1.0", "255.255.255.0"); - Ipv4InterfaceContainer staNodeInterfaces, apNodeInterface; + Ipv4InterfaceContainer staNodeInterfaces; + Ipv4InterfaceContainer apNodeInterface; staNodeInterfaces = address.Assign (staDevices); apNodeInterface = address.Assign (apDevice); // Setting applications - ApplicationContainer sourceApplications, sinkApplications; + ApplicationContainer sourceApplications; + ApplicationContainer sinkApplications; std::vector tosValues = {0x70, 0x28, 0xb8, 0xc0}; //AC_BE, AC_BK, AC_VI, AC_VO uint32_t portNumber = 9; for (uint32_t index = 0; index < nWifi; ++index) diff --git a/examples/wireless/wifi-multirate.cc b/examples/wireless/wifi-multirate.cc index fd77f6038..bfa6bace2 100644 --- a/examples/wireless/wifi-multirate.cc +++ b/examples/wireless/wifi-multirate.cc @@ -403,7 +403,8 @@ Experiment::SendMultiDestinations (Ptr sender, NodeContainer c) ev->SetAttribute ("Mean", DoubleValue (m_expMean)); ev->SetAttribute ("Bound", DoubleValue (m_totalTime)); - double start = 0.0, stop; + double start = 0.0; + double stop; uint32_t destIndex; for (uint32_t i = 0; i < c.GetN (); i++) @@ -585,7 +586,15 @@ Experiment::Run (const WifiHelper &wifi, const YansWifiPhyHelper &wifiPhy, //GenerateNeighbors(NodeContainer, uint32_t sender) //Note: these senders are hand-picked in order to ensure good coverage //you might have to change these values for other grids - NodeContainer c1, c2, c3, c4, c5, c6, c7, c8, c9; + NodeContainer c1; + NodeContainer c2; + NodeContainer c3; + NodeContainer c4; + NodeContainer c5; + NodeContainer c6; + NodeContainer c7; + NodeContainer c8; + NodeContainer c9; c1 = GenerateNeighbors (c, 22); c2 = GenerateNeighbors (c, 24); diff --git a/examples/wireless/wifi-txop-aggregation.cc b/examples/wireless/wifi-txop-aggregation.cc index 5fabc2b22..5f2b7dc9c 100644 --- a/examples/wireless/wifi-txop-aggregation.cc +++ b/examples/wireless/wifi-txop-aggregation.cc @@ -136,7 +136,14 @@ int main (int argc, char *argv[]) wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", "DataMode", StringValue ("HtMcs7"), "ControlMode", StringValue ("HtMcs0")); WifiMacHelper mac; - NetDeviceContainer staDeviceA, staDeviceB, staDeviceC, staDeviceD, apDeviceA, apDeviceB, apDeviceC, apDeviceD; + NetDeviceContainer staDeviceA; + NetDeviceContainer staDeviceB; + NetDeviceContainer staDeviceC; + NetDeviceContainer staDeviceD; + NetDeviceContainer apDeviceA; + NetDeviceContainer apDeviceB; + NetDeviceContainer apDeviceC; + NetDeviceContainer apDeviceD; Ssid ssid; // Network A diff --git a/src/antenna/model/angles.cc b/src/antenna/model/angles.cc index 54ec1588d..d7954d9da 100644 --- a/src/antenna/model/angles.cc +++ b/src/antenna/model/angles.cc @@ -138,7 +138,8 @@ WrapToPi (double a) std::ostream& operator<< (std::ostream& os, const Angles& a) { - double azim, incl; + double azim; + double incl; std::string unit; if (a.m_printDeg) diff --git a/src/aodv/model/aodv-rtable.cc b/src/aodv/model/aodv-rtable.cc index 3aac08d07..863825d77 100644 --- a/src/aodv/model/aodv-rtable.cc +++ b/src/aodv/model/aodv-rtable.cc @@ -180,7 +180,10 @@ RoutingTableEntry::Print (Ptr stream, Time::Unit unit /* = *os << std::resetiosflags (std::ios::adjustfield) << std::setiosflags (std::ios::left); - std::ostringstream dest, gw, iface, expire; + std::ostringstream dest; + std::ostringstream gw; + std::ostringstream iface; + std::ostringstream expire; dest << m_ipv4Route->GetDestination (); gw << m_ipv4Route->GetGateway (); iface << m_iface.GetLocal (); diff --git a/src/applications/model/bulk-send-application.cc b/src/applications/model/bulk-send-application.cc index 6505aed96..f1e0df3a4 100644 --- a/src/applications/model/bulk-send-application.cc +++ b/src/applications/model/bulk-send-application.cc @@ -291,7 +291,8 @@ void BulkSendApplication::ConnectionSucceeded (Ptr socket) NS_LOG_FUNCTION (this << socket); NS_LOG_LOGIC ("BulkSendApplication Connection succeeded"); m_connected = true; - Address from, to; + Address from; + Address to; socket->GetSockName (from); socket->GetPeerName (to); SendData (from, to); @@ -309,7 +310,8 @@ void BulkSendApplication::DataSend (Ptr socket, uint32_t) if (m_connected) { // Only send new data if the connection has completed - Address from, to; + Address from; + Address to; socket->GetSockName (from); socket->GetPeerName (to); SendData (from, to); diff --git a/src/applications/model/onoff-application.cc b/src/applications/model/onoff-application.cc index 006706f5b..777b8d3f7 100644 --- a/src/applications/model/onoff-application.cc +++ b/src/applications/model/onoff-application.cc @@ -332,7 +332,8 @@ void OnOffApplication::SendPacket () } else if (m_enableSeqTsSizeHeader) { - Address from, to; + Address from; + Address to; m_socket->GetSockName (from); m_socket->GetPeerName (to); SeqTsSizeHeader header; diff --git a/src/config-store/model/raw-text-config.cc b/src/config-store/model/raw-text-config.cc index 9c2a9de61..83bbea97d 100644 --- a/src/config-store/model/raw-text-config.cc +++ b/src/config-store/model/raw-text-config.cc @@ -221,7 +221,9 @@ RawTextConfigLoad::Default () NS_LOG_FUNCTION (this); m_is->clear (); m_is->seekg (0); - std::string type, name, value; + std::string type; + std::string name; + std::string value; for (std::string line; std::getline (*m_is, line);) { if (!ParseLine (line, type, name, value)) @@ -246,7 +248,9 @@ RawTextConfigLoad::Global () NS_LOG_FUNCTION (this); m_is->clear (); m_is->seekg (0); - std::string type, name, value; + std::string type; + std::string name; + std::string value; for (std::string line; std::getline (*m_is, line);) { if (!ParseLine (line, type, name, value)) @@ -271,7 +275,9 @@ RawTextConfigLoad::Attributes () NS_LOG_FUNCTION (this); m_is->clear (); m_is->seekg (0); - std::string type, name, value; + std::string type; + std::string name; + std::string value; for (std::string line; std::getline (*m_is, line);) { if (!ParseLine (line, type, name, value)) diff --git a/src/core/model/ascii-file.cc b/src/core/model/ascii-file.cc index d057e8a6c..d5896f423 100644 --- a/src/core/model/ascii-file.cc +++ b/src/core/model/ascii-file.cc @@ -85,7 +85,8 @@ AsciiFile::Diff (std::string const & f1, std::string const & f2, uint64_t & lineNumber) { - AsciiFile ascii1, ascii2; + AsciiFile ascii1; + AsciiFile ascii2; ascii1.Open (f1, std::ios::in); ascii2.Open (f2, std::ios::in); bool bad = ascii1.Fail () || ascii2.Fail (); diff --git a/src/core/model/command-line.cc b/src/core/model/command-line.cc index 6b611f740..3b9b9691d 100644 --- a/src/core/model/command-line.cc +++ b/src/core/model/command-line.cc @@ -247,7 +247,8 @@ CommandLine::HandleOption (const std::string & param) const } // find any value following '=' cur = arg.find ("="); - std::string name, value; + std::string name; + std::string value; if (cur == std::string::npos) { name = arg; diff --git a/src/core/model/config.cc b/src/core/model/config.cc index 07e472f04..aafcd7fba 100644 --- a/src/core/model/config.cc +++ b/src/core/model/config.cc @@ -679,7 +679,8 @@ ConfigImpl::Set (std::string path, const AttributeValue &value) { NS_LOG_FUNCTION (this << path << &value); - std::string root, leaf; + std::string root; + std::string leaf; ParsePath (path, &root, &leaf); MatchContainer container = LookupMatches (root); container.Set (leaf, value); @@ -689,7 +690,8 @@ ConfigImpl::SetFailSafe (std::string path, const AttributeValue &value) { NS_LOG_FUNCTION (this << path << &value); - std::string root, leaf; + std::string root; + std::string leaf; ParsePath (path, &root, &leaf); MatchContainer container = LookupMatches (root); return container.SetFailSafe (leaf, value); @@ -698,7 +700,8 @@ bool ConfigImpl::ConnectWithoutContextFailSafe (std::string path, const CallbackBase &cb) { NS_LOG_FUNCTION (this << path << &cb); - std::string root, leaf; + std::string root; + std::string leaf; ParsePath (path, &root, &leaf); MatchContainer container = LookupMatches (root); return container.ConnectWithoutContextFailSafe (leaf, cb); @@ -707,7 +710,8 @@ void ConfigImpl::DisconnectWithoutContext (std::string path, const CallbackBase &cb) { NS_LOG_FUNCTION (this << path << &cb); - std::string root, leaf; + std::string root; + std::string leaf; ParsePath (path, &root, &leaf); MatchContainer container = LookupMatches (root); if (container.GetN () == 0) @@ -724,7 +728,8 @@ ConfigImpl::ConnectFailSafe (std::string path, const CallbackBase &cb) { NS_LOG_FUNCTION (this << path << &cb); - std::string root, leaf; + std::string root; + std::string leaf; ParsePath (path, &root, &leaf); MatchContainer container = LookupMatches (root); return container.ConnectFailSafe (leaf, cb); @@ -734,7 +739,8 @@ ConfigImpl::Disconnect (std::string path, const CallbackBase &cb) { NS_LOG_FUNCTION (this << path << &cb); - std::string root, leaf; + std::string root; + std::string leaf; ParsePath (path, &root, &leaf); MatchContainer container = LookupMatches (root); if (container.GetN () == 0) diff --git a/src/core/model/int64x64-128.cc b/src/core/model/int64x64-128.cc index 9b4443733..ad4adce1a 100644 --- a/src/core/model/int64x64-128.cc +++ b/src/core/model/int64x64-128.cc @@ -63,7 +63,8 @@ output_sign (const int128_t sa, void int64x64_t::Mul (const int64x64_t & o) { - uint128_t a, b; + uint128_t a; + uint128_t b; bool negative = output_sign (_v, o._v, a, b); uint128_t result = Umul (a, b); _v = negative ? -result : result; @@ -78,8 +79,11 @@ int64x64_t::Umul (const uint128_t a, const uint128_t b) uint128_t bH = (b >> 64) & HP_MASK_LO; uint128_t result; - uint128_t hiPart, loPart, midPart; - uint128_t res1, res2; + uint128_t hiPart; + uint128_t loPart; + uint128_t midPart; + uint128_t res1; + uint128_t res2; // Multiplying (a.h 2^64 + a.l) x (b.h 2^64 + b.l) = // 2^128 a.h b.h + 2^64*(a.h b.l+b.h a.l) + a.l b.l @@ -112,7 +116,8 @@ int64x64_t::Umul (const uint128_t a, const uint128_t b) void int64x64_t::Div (const int64x64_t & o) { - uint128_t a, b; + uint128_t a; + uint128_t b; bool negative = output_sign (_v, o._v, a, b); int128_t result = Udiv (a, b); _v = negative ? -result : result; @@ -200,8 +205,13 @@ int64x64_t::MulByInvert (const int64x64_t & o) uint128_t int64x64_t::UmulByInvert (const uint128_t a, const uint128_t b) { - uint128_t result, ah, bh, al, bl; - uint128_t hi, mid; + uint128_t result; + uint128_t ah; + uint128_t bh; + uint128_t al; + uint128_t bl; + uint128_t hi; + uint128_t mid; ah = a >> 64; bh = b >> 64; al = a & HP_MASK_LO; diff --git a/src/core/model/object-factory.cc b/src/core/model/object-factory.cc index a780bff92..e2dfc09e4 100644 --- a/src/core/model/object-factory.cc +++ b/src/core/model/object-factory.cc @@ -121,7 +121,8 @@ std::istream & operator >> (std::istream &is, ObjectFactory &factory) { std::string v; is >> v; - std::string::size_type lbracket, rbracket; + std::string::size_type lbracket; + std::string::size_type rbracket; lbracket = v.find ("["); rbracket = v.find ("]"); if (lbracket == std::string::npos && rbracket == std::string::npos) diff --git a/src/core/model/random-variable-stream.cc b/src/core/model/random-variable-stream.cc index a19500823..dedb09677 100644 --- a/src/core/model/random-variable-stream.cc +++ b/src/core/model/random-variable-stream.cc @@ -830,7 +830,11 @@ LogNormalRandomVariable::GetSigma () const double LogNormalRandomVariable::GetValue (double mu, double sigma) { - double v1, v2, r2, normal, x; + double v1; + double v2; + double r2; + double normal; + double x; NS_LOG_FUNCTION (this << mu << sigma); @@ -953,7 +957,9 @@ GammaRandomVariable::GetValue (double alpha, double beta) return GetValue (1.0 + alpha, beta) * std::pow (u, 1.0 / alpha); } - double x, v, u; + double x; + double v; + double u; double d = alpha - 1.0 / 3.0; double c = (1.0 / 3.0) / std::sqrt (d); @@ -1327,7 +1333,8 @@ ZipfRandomVariable::GetValue (uint32_t n, double alpha) u = (1 - u); } - double sum_prob = 0,zipf_value = 0; + double sum_prob = 0; + double zipf_value = 0; for (uint32_t i = 1; i <= m_n; i++) { sum_prob += m_c / std::pow ((double)i,m_alpha); @@ -1395,8 +1402,10 @@ ZetaRandomVariable::GetValue (double alpha) NS_LOG_FUNCTION (this << alpha); m_b = std::pow (2.0, alpha - 1.0); - double u, v; - double X, T; + double u; + double v; + double X; + double T; double test; do diff --git a/src/core/model/rng-stream.cc b/src/core/model/rng-stream.cc index bbce131c3..6d6475fcd 100644 --- a/src/core/model/rng-stream.cc +++ b/src/core/model/rng-stream.cc @@ -181,7 +181,8 @@ void MatVecModM (const Matrix A, const double s[3], double v[3], void MatMatModM (const Matrix A, const Matrix B, Matrix C, double m) { - int i, j; + int i; + int j; double V[3]; Matrix W; @@ -218,7 +219,8 @@ void MatMatModM (const Matrix A, const Matrix B, */ void MatTwoPowModM (const Matrix src, Matrix dst, double m, int32_t e) { - int i, j; + int i; + int j; /* initialize: dst = src */ for (i = 0; i < 3; ++i) @@ -247,7 +249,8 @@ void MatTwoPowModM (const Matrix src, Matrix dst, double m, int32_t e) */ void MatPowModM (const double A[3][3], double B[3][3], double m, int32_t n) { - int i, j; + int i; + int j; double W[3][3]; // initialize: W = A; B = I @@ -335,7 +338,9 @@ using namespace MRG32k3a; double RngStream::RandU01 () { int32_t k; - double p1, p2, u; + double p1; + double p2; + double u; /* Component 1 */ p1 = a12 * m_currentState[1] - a13n * m_currentState[0]; @@ -392,7 +397,8 @@ RngStream::RngStream (const RngStream& r) void RngStream::AdvanceNthBy (uint64_t nth, int by, double state[6]) { - Matrix matrix1,matrix2; + Matrix matrix1; + Matrix matrix2; for (int i = 0; i < 64; i++) { int nbit = 63 - i; diff --git a/src/core/model/system-path.cc b/src/core/model/system-path.cc index f6c84c0f2..8be5c9631 100644 --- a/src/core/model/system-path.cc +++ b/src/core/model/system-path.cc @@ -250,7 +250,8 @@ Split (std::string path) { NS_LOG_FUNCTION (path); std::list retval; - std::string::size_type current = 0, next = 0; + std::string::size_type current = 0; + std::string::size_type next = 0; next = path.find (SYSTEM_PATH_SEP, current); while (next != std::string::npos) { diff --git a/src/core/model/test.cc b/src/core/model/test.cc index abe96a24b..5e0fcd4a8 100644 --- a/src/core/model/test.cc +++ b/src/core/model/test.cc @@ -45,7 +45,8 @@ TestDoubleIsEqual (const double x1, const double x2, const double epsilon) { NS_LOG_FUNCTION (x1 << x2 << epsilon); int exponent; - double delta, difference; + double delta; + double difference; // // Find exponent of largest absolute value diff --git a/src/core/model/vector.cc b/src/core/model/vector.cc index 8024e0cc8..f00ae0f1f 100644 --- a/src/core/model/vector.cc +++ b/src/core/model/vector.cc @@ -134,7 +134,8 @@ std::ostream &operator << (std::ostream &os, const Vector3D &vector) } std::istream &operator >> (std::istream &is, Vector3D &vector) { - char c1, c2; + char c1; + char c2; is >> vector.x >> c1 >> vector.y >> c2 >> vector.z; if (c1 != ':' || c2 != ':') diff --git a/src/dsdv/model/dsdv-routing-protocol.cc b/src/dsdv/model/dsdv-routing-protocol.cc index 80baf79d1..c3c6a8edb 100644 --- a/src/dsdv/model/dsdv-routing-protocol.cc +++ b/src/dsdv/model/dsdv-routing-protocol.cc @@ -580,7 +580,8 @@ RoutingProtocol::RecvDsdv (Ptr socket) for (; packetSize > 0; packetSize = packetSize - 12) { count = 0; - DsdvHeader dsdvHeader, tempDsdvHeader; + DsdvHeader dsdvHeader; + DsdvHeader tempDsdvHeader; packet->RemoveHeader (dsdvHeader); NS_LOG_DEBUG ("Processing new update for " << dsdvHeader.GetDst ()); /*Verifying if the packets sent by me were returned back to me. If yes, discarding them!*/ @@ -611,7 +612,8 @@ RoutingProtocol::RecvDsdv (Ptr socket) NS_LOG_DEBUG ("Received a DSDV packet from " << sender << " to " << receiver << ". Details are: Destination: " << dsdvHeader.GetDst () << ", Seq No: " << dsdvHeader.GetDstSeqno () << ", HopCount: " << dsdvHeader.GetHopCount ()); - RoutingTableEntry fwdTableEntry, advTableEntry; + RoutingTableEntry fwdTableEntry; + RoutingTableEntry advTableEntry; EventId event; bool permanentTableVerifier = m_routingTable.LookupRoute (dsdvHeader.GetDst (),fwdTableEntry); if (permanentTableVerifier == false) @@ -884,7 +886,8 @@ RoutingProtocol::SendTriggeredUpdate () void RoutingProtocol::SendPeriodicUpdate () { - std::map removedAddresses, allRoutes; + std::map removedAddresses; + std::map allRoutes; m_routingTable.Purge (removedAddresses); MergeTriggerPeriodicUpdates (); m_routingTable.GetListOfAllRoutes (allRoutes); diff --git a/src/dsdv/model/dsdv-rtable.cc b/src/dsdv/model/dsdv-rtable.cc index 8d92c5b67..7970be817 100644 --- a/src/dsdv/model/dsdv-rtable.cc +++ b/src/dsdv/model/dsdv-rtable.cc @@ -204,7 +204,11 @@ RoutingTableEntry::Print (Ptr stream, Time::Unit unit /*= T *os << std::resetiosflags (std::ios::adjustfield) << std::setiosflags (std::ios::left); - std::ostringstream dest, gw, iface, ltime, stime; + std::ostringstream dest; + std::ostringstream gw; + std::ostringstream iface; + std::ostringstream ltime; + std::ostringstream stime; dest << m_ipv4Route->GetDestination (); gw << m_ipv4Route->GetGateway (); iface << m_iface.GetLocal (); diff --git a/src/dsr/model/dsr-routing.cc b/src/dsr/model/dsr-routing.cc index dc164c6aa..9f8ed3fe2 100644 --- a/src/dsr/model/dsr-routing.cc +++ b/src/dsr/model/dsr-routing.cc @@ -534,7 +534,8 @@ std::vector DsrRouting::GetElementsFromContext (std::string context) { std::vector elements; - size_t pos1 = 0, pos2; + size_t pos1 = 0; + size_t pos2; while (pos1 != context.npos) { pos1 = context.find ("/",pos1); diff --git a/src/internet-apps/model/dhcp-header.cc b/src/internet-apps/model/dhcp-header.cc index c41f4d9d6..d26ecb41a 100644 --- a/src/internet-apps/model/dhcp-header.cc +++ b/src/internet-apps/model/dhcp-header.cc @@ -351,7 +351,8 @@ DhcpHeader::Serialize (Buffer::Iterator start) const uint32_t DhcpHeader::Deserialize (Buffer::Iterator start) { - uint32_t len, clen = start.GetSize (); + uint32_t len; + uint32_t clen = start.GetSize (); if (clen < 240) { NS_LOG_WARN ("Malformed Packet"); diff --git a/src/internet/model/ipv4-global-routing.cc b/src/internet/model/ipv4-global-routing.cc index b839d0a16..78a4c006f 100644 --- a/src/internet/model/ipv4-global-routing.cc +++ b/src/internet/model/ipv4-global-routing.cc @@ -418,7 +418,10 @@ Ipv4GlobalRouting::PrintRoutingTable (Ptr stream, Time::Uni *os << "Destination Gateway Genmask Flags Metric Ref Use Iface" << std::endl; for (uint32_t j = 0; j < GetNRoutes (); j++) { - std::ostringstream dest, gw, mask, flags; + std::ostringstream dest; + std::ostringstream gw; + std::ostringstream mask; + std::ostringstream flags; Ipv4RoutingTableEntry route = GetRoute (j); dest << route.GetDest (); *os << std::setw (16) << dest.str (); diff --git a/src/internet/model/ipv4-l3-protocol.cc b/src/internet/model/ipv4-l3-protocol.cc index f7213aa1b..03aec8bf0 100644 --- a/src/internet/model/ipv4-l3-protocol.cc +++ b/src/internet/model/ipv4-l3-protocol.cc @@ -1804,7 +1804,8 @@ Ipv4L3Protocol::UpdateDuplicate (Ptr p, const Ipv4Header &header) // place a new entry, on collision the existing entry iterator is returned DupMap_t::iterator iter; - bool inserted, isDup; + bool inserted; + bool isDup; std::tie (iter, inserted) = m_dups.emplace (key, Seconds (0)); isDup = !inserted && iter->second > Simulator::Now (); diff --git a/src/internet/model/ipv4-static-routing.cc b/src/internet/model/ipv4-static-routing.cc index 02b0d6c5e..84768c69d 100644 --- a/src/internet/model/ipv4-static-routing.cc +++ b/src/internet/model/ipv4-static-routing.cc @@ -739,7 +739,10 @@ Ipv4StaticRouting::PrintRoutingTable (Ptr stream, Time::Uni *os << "Destination Gateway Genmask Flags Metric Ref Use Iface" << std::endl; for (uint32_t j = 0; j < GetNRoutes (); j++) { - std::ostringstream dest, gw, mask, flags; + std::ostringstream dest; + std::ostringstream gw; + std::ostringstream mask; + std::ostringstream flags; Ipv4RoutingTableEntry route = GetRoute (j); dest << route.GetDest (); *os << std::setw (16) << dest.str (); diff --git a/src/internet/model/ipv6-static-routing.cc b/src/internet/model/ipv6-static-routing.cc index 713054d69..0663b7698 100644 --- a/src/internet/model/ipv6-static-routing.cc +++ b/src/internet/model/ipv6-static-routing.cc @@ -99,7 +99,10 @@ Ipv6StaticRouting::PrintRoutingTable (Ptr stream, Time::Uni *os << "Destination Next Hop Flag Met Ref Use If" << std::endl; for (uint32_t j = 0; j < GetNRoutes (); j++) { - std::ostringstream dest, gw, mask, flags; + std::ostringstream dest; + std::ostringstream gw; + std::ostringstream mask; + std::ostringstream flags; Ipv6RoutingTableEntry route = GetRoute (j); dest << route.GetDest () << "/" << int(route.GetDestNetworkPrefix ().GetPrefixLength ()); *os << std::setw (31) << dest.str (); diff --git a/src/internet/model/rip.cc b/src/internet/model/rip.cc index 989a31737..044feb0ee 100644 --- a/src/internet/model/rip.cc +++ b/src/internet/model/rip.cc @@ -513,7 +513,10 @@ void Rip::PrintRoutingTable (Ptr stream, Time::Unit unit) c if (status == RipRoutingTableEntry::RIP_VALID) { - std::ostringstream dest, gw, mask, flags; + std::ostringstream dest; + std::ostringstream gw; + std::ostringstream mask; + std::ostringstream flags; dest << route->GetDest (); *os << std::setw (16) << dest.str (); gw << route->GetGateway (); diff --git a/src/internet/model/ripng.cc b/src/internet/model/ripng.cc index 32e024c23..08f99fac2 100644 --- a/src/internet/model/ripng.cc +++ b/src/internet/model/ripng.cc @@ -489,7 +489,10 @@ void RipNg::PrintRoutingTable (Ptr stream, Time::Unit unit) if (status == RipNgRoutingTableEntry::RIPNG_VALID) { - std::ostringstream dest, gw, mask, flags; + std::ostringstream dest; + std::ostringstream gw; + std::ostringstream mask; + std::ostringstream flags; dest << route->GetDest () << "/" << int(route->GetDestNetworkPrefix ().GetPrefixLength ()); *os << std::setw (31) << dest.str (); diff --git a/src/internet/model/tcp-bbr.cc b/src/internet/model/tcp-bbr.cc index c1d0a86f6..6bfb4ffbb 100644 --- a/src/internet/model/tcp-bbr.cc +++ b/src/internet/model/tcp-bbr.cc @@ -485,7 +485,8 @@ TcpBbr::AckAggregationCwnd () void TcpBbr::UpdateAckAggregation (Ptr tcb, const TcpRateOps::TcpRateSample &rs) { - uint32_t expectedAcked, extraAck; + uint32_t expectedAcked; + uint32_t extraAck; uint32_t epochProp; if (!m_extraAckedGain || rs.m_ackedSacked <= 0 || rs.m_delivered < 0) diff --git a/src/internet/model/tcp-cubic.cc b/src/internet/model/tcp-cubic.cc index 4c20ef1d0..50a1d2e9f 100644 --- a/src/internet/model/tcp-cubic.cc +++ b/src/internet/model/tcp-cubic.cc @@ -216,7 +216,9 @@ TcpCubic::Update (Ptr tcb) { NS_LOG_FUNCTION (this); Time t; - uint32_t delta, bicTarget, cnt = 0; + uint32_t delta; + uint32_t bicTarget; + uint32_t cnt = 0; double offs; uint32_t segCwnd = tcb->GetCwndInSegments (); diff --git a/src/internet/model/tcp-illinois.cc b/src/internet/model/tcp-illinois.cc index 698e88a16..7941e679a 100644 --- a/src/internet/model/tcp-illinois.cc +++ b/src/internet/model/tcp-illinois.cc @@ -303,7 +303,8 @@ TcpIllinois::CalculateBeta (double da, double dm) { NS_LOG_FUNCTION (this << da << dm); - double d2, d3; + double d2; + double d3; d2 = dm / 10; d3 = (8 * dm) / 10; diff --git a/src/internet/model/tcp-l4-protocol.cc b/src/internet/model/tcp-l4-protocol.cc index cf9c3fa8d..8208456d0 100644 --- a/src/internet/model/tcp-l4-protocol.cc +++ b/src/internet/model/tcp-l4-protocol.cc @@ -319,7 +319,8 @@ TcpL4Protocol::ReceiveIcmp (Ipv4Address icmpSource, uint8_t icmpTtl, { NS_LOG_FUNCTION (this << icmpSource << (uint16_t) icmpTtl << (uint16_t) icmpType << (uint16_t) icmpCode << icmpInfo << payloadSource << payloadDestination); - uint16_t src, dst; + uint16_t src; + uint16_t dst; src = payload[0] << 8; src |= payload[1]; dst = payload[2] << 8; @@ -346,7 +347,8 @@ TcpL4Protocol::ReceiveIcmp (Ipv6Address icmpSource, uint8_t icmpTtl, { NS_LOG_FUNCTION (this << icmpSource << (uint16_t) icmpTtl << (uint16_t) icmpType << (uint16_t) icmpCode << icmpInfo << payloadSource << payloadDestination); - uint16_t src, dst; + uint16_t src; + uint16_t dst; src = payload[0] << 8; src |= payload[1]; dst = payload[2] << 8; @@ -464,7 +466,8 @@ TcpL4Protocol::Receive (Ptr packet, NS_LOG_LOGIC (" No Ipv4 endpoints matched on TcpL4Protocol, trying Ipv6 " << this); Ptr fakeInterface; Ipv6Header ipv6Header; - Ipv6Address src, dst; + Ipv6Address src; + Ipv6Address dst; src = Ipv6Address::MakeIpv4MappedAddress (incomingIpHeader.GetSource ()); dst = Ipv6Address::MakeIpv4MappedAddress (incomingIpHeader.GetDestination ()); diff --git a/src/internet/model/tcp-tx-buffer.cc b/src/internet/model/tcp-tx-buffer.cc index 73494a7b5..cff8ce227 100644 --- a/src/internet/model/tcp-tx-buffer.cc +++ b/src/internet/model/tcp-tx-buffer.cc @@ -1477,7 +1477,8 @@ operator<< (std::ostream& os, const TcpTxBuffer& tcpTxBuf) TcpTxBuffer::PacketList::const_iterator it; std::stringstream ss; SequenceNumber32 beginOfCurrentPacket = tcpTxBuf.m_firstByteSeq; - uint32_t sentSize = 0, appSize = 0; + uint32_t sentSize = 0; + uint32_t appSize = 0; Ptr p; for (it = tcpTxBuf.m_sentList.begin (); it != tcpTxBuf.m_sentList.end (); ++it) diff --git a/src/internet/model/udp-l4-protocol.cc b/src/internet/model/udp-l4-protocol.cc index 9c6fbb10b..b7af34b43 100644 --- a/src/internet/model/udp-l4-protocol.cc +++ b/src/internet/model/udp-l4-protocol.cc @@ -268,7 +268,8 @@ UdpL4Protocol::ReceiveIcmp (Ipv4Address icmpSource, uint8_t icmpTtl, { NS_LOG_FUNCTION (this << icmpSource << icmpTtl << icmpType << icmpCode << icmpInfo << payloadSource << payloadDestination); - uint16_t src, dst; + uint16_t src; + uint16_t dst; src = payload[0] << 8; src |= payload[1]; dst = payload[2] << 8; @@ -295,7 +296,8 @@ UdpL4Protocol::ReceiveIcmp (Ipv6Address icmpSource, uint8_t icmpTtl, { NS_LOG_FUNCTION (this << icmpSource << icmpTtl << icmpType << icmpCode << icmpInfo << payloadSource << payloadDestination); - uint16_t src, dst; + uint16_t src; + uint16_t dst; src = payload[0] << 8; src |= payload[1]; dst = payload[2] << 8; diff --git a/src/internet/test/icmp-test.cc b/src/internet/test/icmp-test.cc index a09a0c4cb..2618c055c 100644 --- a/src/internet/test/icmp-test.cc +++ b/src/internet/test/icmp-test.cc @@ -310,7 +310,9 @@ IcmpTimeExceedTestCase::ReceivePkt (Ptr socket) void IcmpTimeExceedTestCase::DoRun () { - NodeContainer n, n0n1,n1n2; + NodeContainer n; + NodeContainer n0n1; + NodeContainer n1n2; n.Create (3); n0n1.Add (n.Get (0)); n0n1.Add (n.Get (1)); @@ -603,7 +605,9 @@ IcmpV6TimeExceedTestCase::ReceivePkt (Ptr socket) void IcmpV6TimeExceedTestCase::DoRun () { - NodeContainer n, n0n1,n1n2; + NodeContainer n; + NodeContainer n0n1; + NodeContainer n1n2; n.Create (3); n0n1.Add (n.Get (0)); n0n1.Add (n.Get (1)); diff --git a/src/internet/test/ipv4-forwarding-test.cc b/src/internet/test/ipv4-forwarding-test.cc index b408ead5f..f738721ea 100644 --- a/src/internet/test/ipv4-forwarding-test.cc +++ b/src/internet/test/ipv4-forwarding-test.cc @@ -139,7 +139,8 @@ Ipv4ForwardingTest::DoRun () Ptr fwNode = CreateObject (); internet.Install (fwNode); - Ptr fwDev1, fwDev2; + Ptr fwDev1; + Ptr fwDev2; { // first interface fwDev1 = CreateObject (); fwDev1->SetAddress (Mac48Address::ConvertFrom (Mac48Address::Allocate ())); diff --git a/src/internet/test/ipv4-header-test.cc b/src/internet/test/ipv4-header-test.cc index 97694c5cd..30f47cdd5 100644 --- a/src/internet/test/ipv4-header-test.cc +++ b/src/internet/test/ipv4-header-test.cc @@ -161,7 +161,8 @@ Ipv4HeaderTest::DoRun () Ptr rxNode = CreateObject (); internet.Install (rxNode); - Ptr rxDev1, rxDev2; + Ptr rxDev1; + Ptr rxDev2; { // first interface rxDev1 = CreateObject (); rxDev1->SetAddress (Mac48Address::ConvertFrom (Mac48Address::Allocate ())); diff --git a/src/internet/test/ipv4-rip-test.cc b/src/internet/test/ipv4-rip-test.cc index f1cf185eb..8f7324445 100644 --- a/src/internet/test/ipv4-rip-test.cc +++ b/src/internet/test/ipv4-rip-test.cc @@ -153,7 +153,8 @@ Ipv4RipTest::DoRun () net1.Add (txDev); // Router A - Ptr fwDev1routerA, fwDev2routerA; + Ptr fwDev1routerA; + Ptr fwDev2routerA; { // first interface fwDev1routerA = CreateObject (); fwDev1routerA->SetAddress (Mac48Address ("00:00:00:00:00:02")); @@ -169,7 +170,8 @@ Ipv4RipTest::DoRun () net2.Add (fwDev2routerA); // Router B - Ptr fwDev1routerB, fwDev2routerB; + Ptr fwDev1routerB; + Ptr fwDev2routerB; { // first interface fwDev1routerB = CreateObject (); fwDev1routerB->SetAddress (Mac48Address ("00:00:00:00:00:04")); @@ -185,7 +187,8 @@ Ipv4RipTest::DoRun () net3.Add (fwDev2routerB); // Router C - Ptr fwDev1routerC, fwDev2routerC; + Ptr fwDev1routerC; + Ptr fwDev2routerC; { // first interface fwDev1routerC = CreateObject (); fwDev1routerC->SetAddress (Mac48Address ("00:00:00:00:00:06")); @@ -382,7 +385,8 @@ Ipv4RipCountToInfinityTest::DoRun () net1.Add (txDev); // Router A - Ptr fwDev1routerA, fwDev2routerA; + Ptr fwDev1routerA; + Ptr fwDev2routerA; { // first interface fwDev1routerA = CreateObject (); fwDev1routerA->SetAddress (Mac48Address ("00:00:00:00:00:02")); @@ -398,7 +402,8 @@ Ipv4RipCountToInfinityTest::DoRun () net2.Add (fwDev2routerA); // Router B - Ptr fwDev1routerB, fwDev2routerB; + Ptr fwDev1routerB; + Ptr fwDev2routerB; { // first interface fwDev1routerB = CreateObject (); fwDev1routerB->SetAddress (Mac48Address ("00:00:00:00:00:04")); @@ -414,7 +419,8 @@ Ipv4RipCountToInfinityTest::DoRun () net3.Add (fwDev2routerB); // Router C - Ptr fwDev1routerC, fwDev2routerC; + Ptr fwDev1routerC; + Ptr fwDev2routerC; { // first interface fwDev1routerC = CreateObject (); fwDev1routerC->SetAddress (Mac48Address ("00:00:00:00:00:06")); @@ -610,7 +616,8 @@ Ipv4RipSplitHorizonStrategyTest::DoRun () net0.Add (silentDev); // Router A - Ptr silentDevRouterA, fwDevRouterA; + Ptr silentDevRouterA; + Ptr fwDevRouterA; { // silent interface silentDevRouterA = CreateObject (); silentDevRouterA->SetAddress (Mac48Address ("00:00:00:00:00:02")); diff --git a/src/internet/test/ipv6-ripng-test.cc b/src/internet/test/ipv6-ripng-test.cc index 54eab3562..3b2e3e507 100644 --- a/src/internet/test/ipv6-ripng-test.cc +++ b/src/internet/test/ipv6-ripng-test.cc @@ -152,7 +152,8 @@ Ipv6RipngTest::DoRun () net1.Add (txDev); // Router A - Ptr fwDev1routerA, fwDev2routerA; + Ptr fwDev1routerA; + Ptr fwDev2routerA; { // first interface fwDev1routerA = CreateObject (); fwDev1routerA->SetAddress (Mac48Address ("00:00:00:00:00:02")); @@ -168,7 +169,8 @@ Ipv6RipngTest::DoRun () net2.Add (fwDev2routerA); // Router B - Ptr fwDev1routerB, fwDev2routerB; + Ptr fwDev1routerB; + Ptr fwDev2routerB; { // first interface fwDev1routerB = CreateObject (); fwDev1routerB->SetAddress (Mac48Address ("00:00:00:00:00:04")); @@ -184,7 +186,8 @@ Ipv6RipngTest::DoRun () net3.Add (fwDev2routerB); // Router C - Ptr fwDev1routerC, fwDev2routerC; + Ptr fwDev1routerC; + Ptr fwDev2routerC; { // first interface fwDev1routerC = CreateObject (); fwDev1routerC->SetAddress (Mac48Address ("00:00:00:00:00:06")); @@ -382,7 +385,8 @@ Ipv6RipngCountToInfinityTest::DoRun () net1.Add (txDev); // Router A - Ptr fwDev1routerA, fwDev2routerA; + Ptr fwDev1routerA; + Ptr fwDev2routerA; { // first interface fwDev1routerA = CreateObject (); fwDev1routerA->SetAddress (Mac48Address ("00:00:00:00:00:02")); @@ -398,7 +402,8 @@ Ipv6RipngCountToInfinityTest::DoRun () net2.Add (fwDev2routerA); // Router B - Ptr fwDev1routerB, fwDev2routerB; + Ptr fwDev1routerB; + Ptr fwDev2routerB; { // first interface fwDev1routerB = CreateObject (); fwDev1routerB->SetAddress (Mac48Address ("00:00:00:00:00:04")); @@ -414,7 +419,8 @@ Ipv6RipngCountToInfinityTest::DoRun () net3.Add (fwDev2routerB); // Router C - Ptr fwDev1routerC, fwDev2routerC; + Ptr fwDev1routerC; + Ptr fwDev2routerC; { // first interface fwDev1routerC = CreateObject (); fwDev1routerC->SetAddress (Mac48Address ("00:00:00:00:00:06")); @@ -606,7 +612,8 @@ Ipv6RipngSplitHorizonStrategyTest::DoRun () net0.Add (silentDev); // Router A - Ptr silentDevRouterA, fwDevRouterA; + Ptr silentDevRouterA; + Ptr fwDevRouterA; { // silent interface silentDevRouterA = CreateObject (); silentDevRouterA->SetAddress (Mac48Address ("00:00:00:00:00:02")); diff --git a/src/internet/test/tcp-bbr-test.cc b/src/internet/test/tcp-bbr-test.cc index fada0652c..be2f607de 100644 --- a/src/internet/test/tcp-bbr-test.cc +++ b/src/internet/test/tcp-bbr-test.cc @@ -124,7 +124,10 @@ TcpBbrCheckGainValuesTest::ExecuteTest () { Ptr cong = CreateObject (); cong->SetAttribute ("HighGain", DoubleValue (m_highGain)); - double actualPacingGain, actualCwndGain, desiredPacingGain = m_highGain, desiredCwndGain = m_highGain; + double actualPacingGain; + double actualCwndGain; + double desiredPacingGain = m_highGain; + double desiredCwndGain = m_highGain; TcpBbr::BbrMode_t desiredMode = TcpBbr::BBR_STARTUP; switch (m_mode) { diff --git a/src/internet/test/tcp-bic-test.cc b/src/internet/test/tcp-bic-test.cc index c9a014ee3..6b489777a 100644 --- a/src/internet/test/tcp-bic-test.cc +++ b/src/internet/test/tcp-bic-test.cc @@ -131,7 +131,9 @@ TcpBicIncrementTest::Update (Ptr tcb) uint32_t segCwnd = tcb->m_cWnd / tcb->m_segmentSize; Ptr cong = CreateObject (); cong->m_lastMaxCwnd = m_lastMaxCwnd; - UintegerValue lowWindow, bsCoeff, wMax; + UintegerValue lowWindow; + UintegerValue bsCoeff; + UintegerValue wMax; UintegerValue smoothPart; cong->GetAttribute ("LowWnd", lowWindow); cong->GetAttribute ("BinarySearchCoefficient", bsCoeff); @@ -268,7 +270,8 @@ TcpBicDecrementTest::ExecuteTest () cong->GetAttribute ("Beta", beta); cong->GetAttribute ("LowWnd", lowWindow); - uint32_t lastMaxCwnd, ssThresh; + uint32_t lastMaxCwnd; + uint32_t ssThresh; if (segCwnd < m_lastMaxCwnd && m_fastConvergence.Get ()) { diff --git a/src/internet/test/tcp-header-test.cc b/src/internet/test/tcp-header-test.cc index c67840f51..394e00cef 100644 --- a/src/internet/test/tcp-header-test.cc +++ b/src/internet/test/tcp-header-test.cc @@ -197,7 +197,8 @@ TcpHeaderWithRFC793OptionTestCase::DoRun () void TcpHeaderWithRFC793OptionTestCase::CheckCorrectDeserialize () { - TcpHeader source, destination; + TcpHeader source; + TcpHeader destination; TcpOptionNOP temp; Buffer buffer; buffer.AddAtStart (40); @@ -220,7 +221,10 @@ void TcpHeaderWithRFC793OptionTestCase::CheckNoPadding () { { - TcpOptionNOP oNop1, oNop2, oNop3, oNop4; + TcpOptionNOP oNop1; + TcpOptionNOP oNop2; + TcpOptionNOP oNop3; + TcpOptionNOP oNop4; TcpHeader header; Buffer buffer; @@ -317,7 +321,8 @@ TcpHeaderWithRFC793OptionTestCase::OneOptionAtTime () { TcpOptionMSS oMSS; oMSS.SetMSS (50); - TcpHeader header, dest; + TcpHeader header; + TcpHeader dest; Buffer buffer; NS_TEST_ASSERT_MSG_EQ (header.GetLength (), 5, "TcpHeader without option is" @@ -378,7 +383,8 @@ TcpHeaderFlagsToString::TcpHeaderFlagsToString (std::string name) void TcpHeaderFlagsToString::DoRun () { - std::string str, target; + std::string str; + std::string target; str = TcpHeader::FlagsToString (0x0); target = ""; NS_TEST_ASSERT_MSG_EQ (str, target, "str " << str << " does not equal target " << target); diff --git a/src/internet/test/tcp-illinois-test.cc b/src/internet/test/tcp-illinois-test.cc index 53e9c2219..25cee17be 100644 --- a/src/internet/test/tcp-illinois-test.cc +++ b/src/internet/test/tcp-illinois-test.cc @@ -318,7 +318,8 @@ TcpIllinoisTest::CalculateBeta (Ptr cong, double da, double dm) DoubleValue betaMax; cong->GetAttribute ("BetaMax", betaMax); - double d2, d3; + double d2; + double d3; d2 = dm / 10; d3 = (8 * dm) / 10; diff --git a/src/internet/test/tcp-vegas-test.cc b/src/internet/test/tcp-vegas-test.cc index 6207b17e6..b37fabde8 100644 --- a/src/internet/test/tcp-vegas-test.cc +++ b/src/internet/test/tcp-vegas-test.cc @@ -155,7 +155,9 @@ TcpVegasTest::IncreaseWindow (Ptr cong) diff = segCwnd - expectedCwnd; // Get the alpha,beta, and gamma attributes - UintegerValue alpha, beta, gamma; + UintegerValue alpha; + UintegerValue beta; + UintegerValue gamma; cong->GetAttribute ("Alpha", alpha); cong->GetAttribute ("Beta", beta); cong->GetAttribute ("Gamma", gamma); diff --git a/src/lte/examples/lena-intercell-interference.cc b/src/lte/examples/lena-intercell-interference.cc index 8d0fbbee9..9675389df 100644 --- a/src/lte/examples/lena-intercell-interference.cc +++ b/src/lte/examples/lena-intercell-interference.cc @@ -75,7 +75,8 @@ int main (int argc, char *argv[]) // Create Nodes: eNodeB and UE NodeContainer enbNodes; - NodeContainer ueNodes1, ueNodes2; + NodeContainer ueNodes1; + NodeContainer ueNodes2; enbNodes.Create (2); ueNodes1.Create (numUes); ueNodes2.Create (numUes); diff --git a/src/lte/examples/lena-pathloss-traces.cc b/src/lte/examples/lena-pathloss-traces.cc index 04d43d5f6..1d2112f3f 100644 --- a/src/lte/examples/lena-pathloss-traces.cc +++ b/src/lte/examples/lena-pathloss-traces.cc @@ -90,7 +90,8 @@ int main (int argc, char *argv[]) // Create Nodes: eNodeB and UE NodeContainer enbNodes; - NodeContainer ueNodes1, ueNodes2; + NodeContainer ueNodes1; + NodeContainer ueNodes2; enbNodes.Create (2); ueNodes1.Create (numUes); ueNodes2.Create (numUes); diff --git a/src/lte/model/lte-rlc-am-header.cc b/src/lte/model/lte-rlc-am-header.cc index 574852cee..5d79e4b42 100644 --- a/src/lte/model/lte-rlc-am-header.cc +++ b/src/lte/model/lte-rlc-am-header.cc @@ -391,8 +391,10 @@ void LteRlcAmHeader::Serialize (Buffer::Iterator start) const while ( it1 != m_extensionBits.end () && it2 != m_lengthIndicators.end () ) { - uint16_t oddLi, evenLi; - uint8_t oddE, evenE; + uint16_t oddLi; + uint16_t evenLi; + uint8_t oddE; + uint8_t evenE; oddE = *it1; oddLi = *it2; @@ -535,8 +537,10 @@ uint32_t LteRlcAmHeader::Deserialize (Buffer::Iterator start) return GetSerializedSize (); } - uint16_t oddLi, evenLi; - uint8_t oddE, evenE; + uint16_t oddLi; + uint16_t evenLi; + uint8_t oddE; + uint8_t evenE; bool moreLiFields = (extensionBit == E_LI_FIELDS_FOLLOWS); while (moreLiFields) diff --git a/src/lte/model/lte-rlc-am.cc b/src/lte/model/lte-rlc-am.cc index a7ba990ec..17ae305d8 100644 --- a/src/lte/model/lte-rlc-am.cc +++ b/src/lte/model/lte-rlc-am.cc @@ -489,7 +489,8 @@ LteRlcAm::DoNotifyTxOpportunity (LteMacSapUser::TxOpportunityParameters txOpPara // Status tag of the new and remaining segments // Note: This is the only place where a PDU is segmented and // therefore its status can change - LteRlcSduStatusTag oldTag, newTag; + LteRlcSduStatusTag oldTag; + LteRlcSduStatusTag newTag; firstSegment->RemovePacketTag (oldTag); newSegment->RemovePacketTag (newTag); if (oldTag.GetStatus () == LteRlcSduStatusTag::FULL_SDU) diff --git a/src/lte/model/lte-rlc-header.cc b/src/lte/model/lte-rlc-header.cc index 678ddab71..6760bfc2a 100644 --- a/src/lte/model/lte-rlc-header.cc +++ b/src/lte/model/lte-rlc-header.cc @@ -181,8 +181,10 @@ void LteRlcHeader::Serialize (Buffer::Iterator start) const while ( it1 != m_extensionBits.end () && it2 != m_lengthIndicators.end () ) { - uint16_t oddLi, evenLi; - uint8_t oddE, evenE; + uint16_t oddLi; + uint16_t evenLi; + uint8_t oddE; + uint8_t evenE; oddE = *it1; oddLi = *it2; @@ -233,8 +235,10 @@ uint32_t LteRlcHeader::Deserialize (Buffer::Iterator start) return GetSerializedSize (); } - uint16_t oddLi, evenLi; - uint8_t oddE, evenE; + uint16_t oddLi; + uint16_t evenLi; + uint8_t oddE; + uint8_t evenE; bool moreLiFields = (extensionBit == E_LI_FIELDS_FOLLOWS); while (moreLiFields) diff --git a/src/lte/model/lte-rlc-um.cc b/src/lte/model/lte-rlc-um.cc index 3a18b1930..e84fea736 100644 --- a/src/lte/model/lte-rlc-um.cc +++ b/src/lte/model/lte-rlc-um.cc @@ -190,7 +190,8 @@ LteRlcUm::DoNotifyTxOpportunity (LteMacSapUser::TxOpportunityParameters txOpPara // Status tag of the new and remaining segments // Note: This is the only place where a PDU is segmented and // therefore its status can change - LteRlcSduStatusTag oldTag, newTag; + LteRlcSduStatusTag oldTag; + LteRlcSduStatusTag newTag; firstSegment->RemovePacketTag (oldTag); newSegment->RemovePacketTag (newTag); if (oldTag.GetStatus () == LteRlcSduStatusTag::FULL_SDU) diff --git a/src/lte/model/lte-rrc-header.cc b/src/lte/model/lte-rrc-header.cc index 465a89d96..f55b9923e 100644 --- a/src/lte/model/lte-rrc-header.cc +++ b/src/lte/model/lte-rrc-header.cc @@ -2016,7 +2016,8 @@ RrcAsn1Header::SerializeMeasConfig (LteRrcSap::MeasConfig measConfig) const Buffer::Iterator RrcAsn1Header::DeserializeThresholdEutra (LteRrcSap::ThresholdEutra * thresholdEutra, Buffer::Iterator bIterator) { - int thresholdEutraChoice, range; + int thresholdEutraChoice; + int range; bIterator = DeserializeChoice (2, false, &thresholdEutraChoice, bIterator); switch (thresholdEutraChoice) diff --git a/src/lte/test/lte-test-link-adaptation.cc b/src/lte/test/lte-test-link-adaptation.cc index d0d6c8972..f5b4a9602 100644 --- a/src/lte/test/lte-test-link-adaptation.cc +++ b/src/lte/test/lte-test-link-adaptation.cc @@ -141,7 +141,8 @@ LteLinkAdaptationTestCase::LteLinkAdaptationTestCase (std::string name, double s m_loss (loss), m_mcsIndex (mcsIndex) { - std::ostringstream sstream1, sstream2; + std::ostringstream sstream1; + std::ostringstream sstream2; sstream1 << " snr=" << snrDb << " mcs=" << mcsIndex; diff --git a/src/lte/test/lte-test-pathloss-model.cc b/src/lte/test/lte-test-pathloss-model.cc index a010a3ad0..0c87856d4 100644 --- a/src/lte/test/lte-test-pathloss-model.cc +++ b/src/lte/test/lte-test-pathloss-model.cc @@ -179,7 +179,8 @@ m_snrDb (snrDb), m_distance (dist), m_mcsIndex (mcsIndex) { - std::ostringstream sstream1, sstream2; + std::ostringstream sstream1; + std::ostringstream sstream2; sstream1 << " snr=" << snrDb << " mcs=" << mcsIndex << " distance=" << dist; diff --git a/src/lte/test/test-asn1-encoding.cc b/src/lte/test/test-asn1-encoding.cc index bbe16bd9f..f365a7f00 100644 --- a/src/lte/test/test-asn1-encoding.cc +++ b/src/lte/test/test-asn1-encoding.cc @@ -607,7 +607,8 @@ RrcConnectionReconfigurationTestCase::DoRun () msg.measConfig.reportConfigToAddModList.push_back (reportConfigToAddMod); // Set measIdToAddModList - LteRrcSap::MeasIdToAddMod measIdToAddMod,measIdToAddMod2; + LteRrcSap::MeasIdToAddMod measIdToAddMod; + LteRrcSap::MeasIdToAddMod measIdToAddMod2; measIdToAddMod.measId = 7; measIdToAddMod.measObjectId = 6; measIdToAddMod.reportConfigId = 5; diff --git a/src/mobility/model/box.cc b/src/mobility/model/box.cc index 716d0889e..b7328a0f1 100644 --- a/src/mobility/model/box.cc +++ b/src/mobility/model/box.cc @@ -229,7 +229,11 @@ operator << (std::ostream &os, const Box &box) std::istream & operator >> (std::istream &is, Box &box) { - char c1, c2, c3, c4, c5; + char c1; + char c2; + char c3; + char c4; + char c5; is >> box.xMin >> c1 >> box.xMax >> c2 >> box.yMin >> c3 >> box.yMax >> c4 >> box.zMin >> c5 >> box.zMax; if (c1 != '|' || c2 != '|' || diff --git a/src/mobility/model/geographic-positions.cc b/src/mobility/model/geographic-positions.cc index 93b08aada..d8a4d6352 100644 --- a/src/mobility/model/geographic-positions.cc +++ b/src/mobility/model/geographic-positions.cc @@ -114,7 +114,8 @@ GeographicPositions::CartesianToGeographicCoordinates (Vector pos, EarthSpheroid e = EARTH_WGS84_ECCENTRICITY; } - Vector lla, tmp; + Vector lla; + Vector tmp; lla.y = atan2 (pos.y, pos.x); // longitude (rad), in +/- pi double e2 = e * e; diff --git a/src/mobility/model/position-allocator.cc b/src/mobility/model/position-allocator.cc index 8c1bd0af1..747ce686a 100644 --- a/src/mobility/model/position-allocator.cc +++ b/src/mobility/model/position-allocator.cc @@ -89,7 +89,9 @@ ListPositionAllocator::Add (const std::string filePath, continue; } - double x, y, z; + double x; + double y; + double z; bool ok = csv.GetValue (0, x); NS_LOG_INFO ("read x: " << x << (ok ? " ok" : " FAIL")); NS_ASSERT_MSG (ok, "failed reading x"); @@ -268,7 +270,8 @@ GridPositionAllocator::GetLayoutType () const Vector GridPositionAllocator::GetNext () const { - double x = 0.0, y = 0.0; + double x = 0.0; + double y = 0.0; switch (m_layoutType) { case ROW_FIRST: @@ -593,7 +596,8 @@ UniformDiscPositionAllocator::SetZ (double z) Vector UniformDiscPositionAllocator::GetNext () const { - double x,y; + double x; + double y; do { x = m_rv->GetValue (-m_rho, m_rho); diff --git a/src/mobility/model/rectangle.cc b/src/mobility/model/rectangle.cc index e652b6e0c..2532b4c30 100644 --- a/src/mobility/model/rectangle.cc +++ b/src/mobility/model/rectangle.cc @@ -235,7 +235,9 @@ operator << (std::ostream &os, const Rectangle &rectangle) std::istream & operator >> (std::istream &is, Rectangle &rectangle) { - char c1, c2, c3; + char c1; + char c2; + char c3; is >> rectangle.xMin >> c1 >> rectangle.xMax >> c2 >> rectangle.yMin >> c3 >> rectangle.yMax; if (c1 != '|' || c2 != '|' || diff --git a/src/mobility/model/steady-state-random-waypoint-mobility-model.cc b/src/mobility/model/steady-state-random-waypoint-mobility-model.cc index af567d5d3..ec125656f 100644 --- a/src/mobility/model/steady-state-random-waypoint-mobility-model.cc +++ b/src/mobility/model/steady-state-random-waypoint-mobility-model.cc @@ -183,7 +183,10 @@ SteadyStateRandomWaypointMobilityModel::DoInitializePrivate () } else // node initially moving { - double x1, x2, y1, y2; + double x1; + double x2; + double y1; + double y2; x1 = x2 = y1 = y2 = 0; double r = 0; double u1 = 1; diff --git a/src/netanim/model/animation-interface.cc b/src/netanim/model/animation-interface.cc index 38b36db46..f6ce839da 100644 --- a/src/netanim/model/animation-interface.cc +++ b/src/netanim/model/animation-interface.cc @@ -590,7 +590,8 @@ const std::vector AnimationInterface::GetElementsFromContext (const std::string& context) const { std::vector elements; - std::size_t pos1 = 0, pos2; + std::size_t pos1 = 0; + std::size_t pos2; while (pos1 != context.npos) { pos1 = context.find ("/",pos1); diff --git a/src/network/model/address.cc b/src/network/model/address.cc index e4d994158..8c2e6bdb2 100644 --- a/src/network/model/address.cc +++ b/src/network/model/address.cc @@ -252,7 +252,8 @@ std::istream& operator>> (std::istream& is, Address & address) { std::string v; is >> v; - std::string::size_type firstDash, secondDash; + std::string::size_type firstDash; + std::string::size_type secondDash; firstDash = v.find ("-"); secondDash = v.find ("-", firstDash+1); std::string type = v.substr (0, firstDash-0); diff --git a/src/network/test/drop-tail-queue-test-suite.cc b/src/network/test/drop-tail-queue-test-suite.cc index eb34bbe0d..996d6c284 100644 --- a/src/network/test/drop-tail-queue-test-suite.cc +++ b/src/network/test/drop-tail-queue-test-suite.cc @@ -46,7 +46,10 @@ DropTailQueueTestCase::DoRun () NS_TEST_EXPECT_MSG_EQ (queue->SetAttributeFailSafe ("MaxSize", StringValue ("3p")), true, "Verify that we can actually set the attribute"); - Ptr p1, p2, p3, p4; + Ptr p1; + Ptr p2; + Ptr p3; + Ptr p4; p1 = Create (); p2 = Create (); p3 = Create (); diff --git a/src/network/test/pcap-file-test-suite.cc b/src/network/test/pcap-file-test-suite.cc index eb83ec593..18efc9449 100644 --- a/src/network/test/pcap-file-test-suite.cc +++ b/src/network/test/pcap-file-test-suite.cc @@ -873,7 +873,11 @@ RecordHeaderTestCase::DoRun () NS_TEST_ASSERT_MSG_EQ (f.Fail (), false, "Open (" << m_testFilename << ", \"std::ios::in\") of existing good file returns error"); - uint32_t tsSec, tsUsec, inclLen, origLen, readLen; + uint32_t tsSec; + uint32_t tsUsec; + uint32_t inclLen; + uint32_t origLen; + uint32_t readLen; f.Read (bufferIn, sizeof(bufferIn), tsSec, tsUsec, inclLen, origLen, readLen); NS_TEST_ASSERT_MSG_EQ (f.Fail (), false, "Read() of known good packet returns error"); @@ -1094,7 +1098,11 @@ ReadFileTestCase::DoRun () // duplicated in the structure above. // uint8_t data[N_PACKET_BYTES]; - uint32_t tsSec, tsUsec, inclLen, origLen, readLen; + uint32_t tsSec; + uint32_t tsUsec; + uint32_t inclLen; + uint32_t origLen; + uint32_t readLen; for (uint32_t i = 0; i < N_KNOWN_PACKETS; ++i) { @@ -1146,7 +1154,9 @@ DiffTestCase::DoRun () // Check that PcapDiff(file, file) is false // std::string filename = CreateDataDirFilename ("known.pcap"); - uint32_t sec (0), usec (0), packets (0); + uint32_t sec (0); + uint32_t usec (0); + uint32_t packets (0); bool diff = PcapFile::Diff (filename, filename, sec, usec, packets); NS_TEST_EXPECT_MSG_EQ (diff, false, "PcapDiff(file, file) must always be false"); diff --git a/src/network/test/sequence-number-test-suite.cc b/src/network/test/sequence-number-test-suite.cc index f4245c1ac..0acefff3d 100644 --- a/src/network/test/sequence-number-test-suite.cc +++ b/src/network/test/sequence-number-test-suite.cc @@ -129,7 +129,8 @@ void SequenceNumberTestCase::DoRun () #define SEQ_TEST_ASSERT(a) NS_TEST_ASSERT_MSG_EQ (bool(a), true, "foo") { - SequenceNumber32 num1 (3), num2 (5); + SequenceNumber32 num1 (3); + SequenceNumber32 num2 (5); uint32_t value; value = (num1 + num2).GetValue (); @@ -153,7 +154,9 @@ void SequenceNumberTestCase::DoRun () } { - SequenceNumber16 num1 (60900), num2 (5), num3 (10000); + SequenceNumber16 num1 (60900); + SequenceNumber16 num2 (5); + SequenceNumber16 num3 (10000); SEQ_TEST_ASSERT (num1 == num1); diff --git a/src/network/utils/dynamic-queue-limits.cc b/src/network/utils/dynamic-queue-limits.cc index 890287ef6..0940fcb81 100644 --- a/src/network/utils/dynamic-queue-limits.cc +++ b/src/network/utils/dynamic-queue-limits.cc @@ -102,8 +102,12 @@ void DynamicQueueLimits::Completed (uint32_t count) { NS_LOG_FUNCTION (this << count); - uint32_t inprogress, prevInprogress, limit; - uint32_t ovlimit, completed, numQueued; + uint32_t inprogress; + uint32_t prevInprogress; + uint32_t limit; + uint32_t ovlimit; + uint32_t completed; + uint32_t numQueued; bool allPrevCompleted; numQueued = m_numQueued; @@ -154,7 +158,8 @@ DynamicQueueLimits::Completed (uint32_t count) * minimum amount of slack found over several iterations of the * completion routine. */ - uint32_t slack, slackLastObjs; + uint32_t slack; + uint32_t slackLastObjs; /* * Slack is the maximum of diff --git a/src/network/utils/packetbb.cc b/src/network/utils/packetbb.cc index 9ccb2ce36..1031b5927 100644 --- a/src/network/utils/packetbb.cc +++ b/src/network/utils/packetbb.cc @@ -279,7 +279,8 @@ PbbTlvBlock::operator== (const PbbTlvBlock &other) const return false; } - ConstIterator ti, oi; + ConstIterator ti; + ConstIterator oi; for (ti = Begin (), oi = other.Begin (); ti != End () && oi != other.End (); ti++, oi++) @@ -519,7 +520,8 @@ PbbAddressTlvBlock::operator== (const PbbAddressTlvBlock &other) const return false; } - ConstIterator it, ot; + ConstIterator it; + ConstIterator ot; for (it = Begin (), ot = other.Begin (); it != End () && ot != other.End (); it++, ot++) @@ -1001,7 +1003,8 @@ PbbPacket::operator== (const PbbPacket &other) const return false; } - ConstMessageIterator tmi, omi; + ConstMessageIterator tmi; + ConstMessageIterator omi; for (tmi = MessageBegin (), omi = other.MessageBegin (); tmi != MessageEnd () && omi != other.MessageEnd (); tmi++, omi++) @@ -1702,7 +1705,8 @@ PbbMessage::operator== (const PbbMessage &other) const return false; } - ConstAddressBlockIterator tai, oai; + ConstAddressBlockIterator tai; + ConstAddressBlockIterator oai; for (tai = AddressBlockBegin (), oai = other.AddressBlockBegin (); tai != AddressBlockEnd () && oai != other.AddressBlockEnd (); tai++, oai++) @@ -2411,7 +2415,8 @@ PbbAddressBlock::operator== (const PbbAddressBlock &other) const return false; } - ConstAddressIterator tai, oai; + ConstAddressIterator tai; + ConstAddressIterator oai; for (tai = AddressBegin (), oai = other.AddressBegin (); tai != AddressEnd () && oai != other.AddressEnd (); tai++, oai++) @@ -2427,7 +2432,8 @@ PbbAddressBlock::operator== (const PbbAddressBlock &other) const return false; } - ConstPrefixIterator tpi, opi; + ConstPrefixIterator tpi; + ConstPrefixIterator opi; for (tpi = PrefixBegin (), opi = other.PrefixBegin (); tpi != PrefixEnd () && opi != other.PrefixEnd (); tpi++, opi++) diff --git a/src/network/utils/pcap-file.cc b/src/network/utils/pcap-file.cc index 9fbaeeb1e..4b09c577a 100644 --- a/src/network/utils/pcap-file.cc +++ b/src/network/utils/pcap-file.cc @@ -530,7 +530,8 @@ PcapFile::Diff (std::string const & f1, std::string const & f2, uint32_t snapLen) { NS_LOG_FUNCTION (f1 << f2 << sec << usec << snapLen); - PcapFile pcap1, pcap2; + PcapFile pcap1; + PcapFile pcap2; pcap1.Open (f1, std::ios::in); pcap2.Open (f2, std::ios::in); bool bad = pcap1.Fail () || pcap2.Fail (); diff --git a/src/nix-vector-routing/examples/nms-p2p-nix.cc b/src/nix-vector-routing/examples/nms-p2p-nix.cc index c9ea74cfc..2136dd287 100644 --- a/src/nix-vector-routing/examples/nms-p2p-nix.cc +++ b/src/nix-vector-routing/examples/nms-p2p-nix.cc @@ -161,7 +161,8 @@ main (int argc, char *argv[]) std::cout << " ==== DARPA NMS CAMPUS NETWORK SIMULATION ====" << std::endl; // LogComponentEnable ("OnOffApplication", LOG_LEVEL_INFO); - int nCN = 2, nLANClients = 42; + int nCN = 2; + int nLANClients = 42; bool nix = true; bool useIpv6 = false; @@ -195,7 +196,9 @@ main (int argc, char *argv[]) Array2D nodes_net3(nCN, 9); Array3D nodes_net3LAN(nCN, 5, nLANClients); - PointToPointHelper p2p_2gb200ms, p2p_1gb5ms, p2p_100mb1ms; + PointToPointHelper p2p_2gb200ms; + PointToPointHelper p2p_1gb5ms; + PointToPointHelper p2p_100mb1ms; InternetStackHelper stack; Array3D
ifs2LanRemoteAddress(nCN, 7, nLANClients); Array3D
ifs3LanRemoteAddress(nCN, 5, nLANClients); @@ -399,7 +402,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)); @@ -412,7 +420,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); ndc0_5 = p2p_1gb5ms.Install (net0_5); ndc2_4a = p2p_1gb5ms.Install (net2_4a); diff --git a/src/nix-vector-routing/model/nix-vector-routing.cc b/src/nix-vector-routing/model/nix-vector-routing.cc index 59b898cd3..2860e395a 100644 --- a/src/nix-vector-routing/model/nix-vector-routing.cc +++ b/src/nix-vector-routing/model/nix-vector-routing.cc @@ -1017,7 +1017,9 @@ NixVectorRouting::PrintRoutingTable (Ptr stream, Time::U *os << "OutputDevice" << std::endl; for (typename IpRouteMap_t::const_iterator it = m_ipRouteCache.begin (); it != m_ipRouteCache.end (); it++) { - std::ostringstream dest, gw, src; + std::ostringstream dest; + std::ostringstream gw; + std::ostringstream src; dest << it->second->GetDestination (); *os << std::setw (30) << dest.str (); gw << it->second->GetGateway (); @@ -1301,7 +1303,8 @@ NixVectorRouting::PrintRoutingPath (Ptr source, IpAddress dest, if (source == destNode) { - std::ostringstream addr, node; + std::ostringstream addr; + std::ostringstream node; addr << dest; node << "(Node " << destNode->GetId () << ")"; *os << std::setw (25) << addr.str (); @@ -1342,7 +1345,10 @@ NixVectorRouting::PrintRoutingPath (Ptr source, IpAddress dest, sourceIPAddr = ip->GetAddress (interfaceIndex, 0).GetAddress (); } - std::ostringstream currAddr, currNode, nextAddr, nextNode; + std::ostringstream currAddr; + std::ostringstream currNode; + std::ostringstream nextAddr; + std::ostringstream nextNode; currAddr << sourceIPAddr; currNode << "(Node " << curr->GetId () << ")"; *os << std::setw (25) << currAddr.str (); diff --git a/src/olsr/model/olsr-header.cc b/src/olsr/model/olsr-header.cc index be1d442fc..04657bc48 100644 --- a/src/olsr/model/olsr-header.cc +++ b/src/olsr/model/olsr-header.cc @@ -48,7 +48,8 @@ namespace olsr { uint8_t SecondsToEmf (double seconds) { - int a, b = 0; + int a; + int b = 0; NS_ASSERT_MSG (seconds >= OLSR_C, "SecondsToEmf - Can not convert a value less than OLSR_C"); diff --git a/src/olsr/model/olsr-routing-protocol.cc b/src/olsr/model/olsr-routing-protocol.cc index 9281d75a3..ba31a14fb 100644 --- a/src/olsr/model/olsr-routing-protocol.cc +++ b/src/olsr/model/olsr-routing-protocol.cc @@ -1140,7 +1140,8 @@ RoutingProtocol::RoutingTableComputation () const TopologyTuple &topology_tuple = *it; NS_LOG_LOGIC ("Looking at topology tuple: " << topology_tuple); - RoutingTableEntry destAddrEntry, lastAddrEntry; + RoutingTableEntry destAddrEntry; + RoutingTableEntry lastAddrEntry; bool have_destAddrEntry = Lookup (topology_tuple.destAddr, destAddrEntry); bool have_lastAddrEntry = Lookup (topology_tuple.lastAddr, lastAddrEntry); if (!have_destAddrEntry && have_lastAddrEntry && lastAddrEntry.distance == h) @@ -1188,7 +1189,8 @@ RoutingProtocol::RoutingTableComputation () it != ifaceAssocSet.end (); it++) { IfaceAssocTuple const &tuple = *it; - RoutingTableEntry entry1, entry2; + RoutingTableEntry entry1; + RoutingTableEntry entry2; bool have_entry1 = Lookup (tuple.mainAddr, entry1); bool have_entry2 = Lookup (tuple.ifaceAddr, entry2); if (have_entry1 && !have_entry2) @@ -1733,7 +1735,8 @@ RoutingProtocol::SendHello () continue; } - uint8_t link_type, nb_type = 0xff; + uint8_t link_type; + uint8_t nb_type = 0xff; // Establishes link type if (link_tuple->symTime >= now) @@ -2885,7 +2888,8 @@ RoutingProtocol::RouteOutput (Ptr p, const Ipv4Header &header, PtrGetObject ()->GetId () << " " << header.GetDestination () << " " << oif); Ptr rtentry; - RoutingTableEntry entry1, entry2; + RoutingTableEntry entry1; + RoutingTableEntry entry2; bool found = false; if (Lookup (header.GetDestination (), entry1) != 0) @@ -3001,7 +3005,8 @@ bool RoutingProtocol::RouteInput (Ptr p, NS_LOG_LOGIC ("Forward packet"); // Forwarding Ptr rtentry; - RoutingTableEntry entry1, entry2; + RoutingTableEntry entry1; + RoutingTableEntry entry2; if (Lookup (header.GetDestination (), entry1)) { bool foundSendEntry = FindSendEntry (entry1, entry2); diff --git a/src/propagation/model/three-gpp-propagation-loss-model.cc b/src/propagation/model/three-gpp-propagation-loss-model.cc index 95c3045de..a27d5b60b 100644 --- a/src/propagation/model/three-gpp-propagation-loss-model.cc +++ b/src/propagation/model/three-gpp-propagation-loss-model.cc @@ -1070,7 +1070,8 @@ ThreeGppUmiStreetCanyonPropagationLossModel::GetUtAndBsHeights (double za, doubl { NS_LOG_FUNCTION (this); // TR 38.901 specifies hBS = 10 m and 1.5 <= hUT <= 22.5 - double hBs, hUt; + double hBs; + double hUt; if (za == 10.0) { // node A is the BS and node B is the UT diff --git a/src/spectrum/model/matrix-based-channel-model.h b/src/spectrum/model/matrix-based-channel-model.h index c7664838d..35e078558 100644 --- a/src/spectrum/model/matrix-based-channel-model.h +++ b/src/spectrum/model/matrix-based-channel-model.h @@ -78,7 +78,8 @@ public: */ bool IsReverse (uint32_t aAntennaId, uint32_t bAntennaId) const { - uint32_t sAntennaId, uAntennaId; + uint32_t sAntennaId; + uint32_t uAntennaId; std::tie (sAntennaId, uAntennaId) = m_antennaPair; NS_ASSERT_MSG ((sAntennaId == aAntennaId && uAntennaId == bAntennaId) || (sAntennaId == bAntennaId && uAntennaId == aAntennaId), "This channel matrix does not represent the channel among the antenna arrays for which are provided IDs."); diff --git a/src/spectrum/model/three-gpp-channel-model.cc b/src/spectrum/model/three-gpp-channel-model.cc index 373d52e34..ecd621c55 100644 --- a/src/spectrum/model/three-gpp-channel-model.cc +++ b/src/spectrum/model/three-gpp-channel-model.cc @@ -1208,7 +1208,8 @@ ThreeGppChannelModel::GenerateChannelParameters (const Ptrm_o2iCondition = channelCondition->GetO2iCondition (); //Step 4: Generate large scale parameters. All LSPS are uncorrelated. - DoubleVector LSPsIndep, LSPs; + DoubleVector LSPsIndep; + DoubleVector LSPs; uint8_t paramNum = 6; if (channelParams->m_losCondition == ChannelCondition::LOS) { @@ -1231,7 +1232,12 @@ ThreeGppChannelModel::GenerateChannelParameters (const Ptrm_losCondition == ChannelCondition::LOS) { kFactor = LSPs[1] * table3gpp->m_sigK + table3gpp->m_uK; @@ -1446,7 +1452,10 @@ ThreeGppChannelModel::GenerateChannelParameters (const Ptrm_reducedClusterNumber; cIndex++) { double logCalc = -1 * log (clusterPowerForAngles[cIndex] / powerMax); @@ -1639,7 +1648,8 @@ ThreeGppChannelModel::GenerateChannelParameters (const Ptrm_clusterPhase = clusterPhase; channelParams->m_crossPolarizationPowerRatios = crossPolarizationPowerRatios; - uint8_t cluster1st = 0, cluster2nd = 0; // first and second strongest cluster; + uint8_t cluster1st = 0; + uint8_t cluster2nd = 0; // first and second strongest cluster; double maxPower = 0; for (uint8_t cIndex = 0; cIndex < channelParams->m_reducedClusterNumber; cIndex++) { @@ -1684,7 +1694,8 @@ ThreeGppChannelModel::GenerateChannelParameters (const Ptrm_reducedClusterNumber == 1) ? channelParams->m_reducedClusterNumber + 2 : channelParams->m_reducedClusterNumber + 4; @@ -1887,7 +1899,10 @@ ThreeGppChannelModel::GetNewChannel (Ptr channelPar + cos (rayZodRadian[nIndex][mIndex]) * sLoc.z); // NOTE Doppler is computed in the CalcBeamformingGain function and is simplified to only account for the center angle of each cluster. - double rxFieldPatternPhi, rxFieldPatternTheta, txFieldPatternPhi, txFieldPatternTheta; + double rxFieldPatternPhi; + double rxFieldPatternTheta; + double txFieldPatternPhi; + double txFieldPatternTheta; std::tie (rxFieldPatternPhi, rxFieldPatternTheta) = uAntenna->GetElementFieldPattern (Angles (channelParams->m_rayAoaRadian[nIndex][mIndex], channelParams->m_rayZoaRadian[nIndex][mIndex])); std::tie (txFieldPatternPhi, txFieldPatternTheta) = sAntenna->GetElementFieldPattern (Angles (channelParams->m_rayAodRadian[nIndex][mIndex], channelParams->m_rayZodRadian[nIndex][mIndex])); NS_ASSERT (4 <= initialPhase.size ()); @@ -1922,7 +1937,10 @@ ThreeGppChannelModel::GetNewChannel (Ptr channelPar + sin (rayZodRadian[nIndex][mIndex]) * sin (rayAodRadian[nIndex][mIndex]) * sLoc.y + cos (rayZodRadian[nIndex][mIndex]) * sLoc.z); - double rxFieldPatternPhi, rxFieldPatternTheta, txFieldPatternPhi, txFieldPatternTheta; + double rxFieldPatternPhi; + double rxFieldPatternTheta; + double txFieldPatternPhi; + double txFieldPatternTheta; std::tie (rxFieldPatternPhi, rxFieldPatternTheta) = uAntenna->GetElementFieldPattern (Angles (rayAoaRadian[nIndex][mIndex], rayZoaRadian[nIndex][mIndex])); std::tie (txFieldPatternPhi, txFieldPatternTheta) = sAntenna->GetElementFieldPattern (Angles (rayAodRadian[nIndex][mIndex], rayZodRadian[nIndex][mIndex])); @@ -1973,7 +1991,10 @@ ThreeGppChannelModel::GetNewChannel (Ptr channelPar + sin (sAngle.GetInclination ()) * sin (sAngle.GetAzimuth ()) * sLoc.y + cos (sAngle.GetInclination ()) * sLoc.z); - double rxFieldPatternPhi, rxFieldPatternTheta, txFieldPatternPhi, txFieldPatternTheta; + double rxFieldPatternPhi; + double rxFieldPatternTheta; + double txFieldPatternPhi; + double txFieldPatternTheta; std::tie (rxFieldPatternPhi, rxFieldPatternTheta) = uAntenna->GetElementFieldPattern (Angles (uAngle.GetAzimuth (), uAngle.GetInclination ())); std::tie (txFieldPatternPhi, txFieldPatternTheta) = sAntenna->GetElementFieldPattern (Angles (sAngle.GetAzimuth (), sAngle.GetInclination ())); @@ -2198,7 +2219,10 @@ ThreeGppChannelModel::CalcAttenuationOfBlockage (const PtrIsReverse (aPhasedArrayModel->GetId (), bPhasedArrayModel->GetId ())) { sW = aPhasedArrayModel->GetBeamformingVector (); diff --git a/src/spectrum/test/spectrum-value-test.cc b/src/spectrum/test/spectrum-value-test.cc index 2c1793777..e8cc79b7a 100644 --- a/src/spectrum/test/spectrum-value-test.cc +++ b/src/spectrum/test/spectrum-value-test.cc @@ -123,7 +123,16 @@ SpectrumValueTestSuite::SpectrumValueTestSuite () Ptr f = Create (freqs); - SpectrumValue v1 (f), v2 (f), v3 (f), v4 (f), v5 (f), v6 (f), v7 (f), v8 (f), v9 (f), v10 (f); + SpectrumValue v1 (f); + SpectrumValue v2 (f); + SpectrumValue v3 (f); + SpectrumValue v4 (f); + SpectrumValue v5 (f); + SpectrumValue v6 (f); + SpectrumValue v7 (f); + SpectrumValue v8 (f); + SpectrumValue v9 (f); + SpectrumValue v10 (f); double doubleValue; @@ -190,7 +199,10 @@ SpectrumValueTestSuite::SpectrumValueTestSuite () v10[3] = -0.794244913190; v10[4] = 0.878579343459; - SpectrumValue tv3 (f), tv4 (f), tv5 (f), tv6 (f); + SpectrumValue tv3 (f); + SpectrumValue tv4 (f); + SpectrumValue tv5 (f); + SpectrumValue tv6 (f); tv3 = v1 + v2; tv4 = v1 - v2; @@ -222,7 +234,10 @@ SpectrumValueTestSuite::SpectrumValueTestSuite () AddTestCase (new SpectrumValueTestCase (tv5, v5, "tv5 *= v2"), TestCase::QUICK); AddTestCase (new SpectrumValueTestCase (tv6, v6, "tv6 div= v2"), TestCase::QUICK); - SpectrumValue tv7a (f), tv8a (f), tv9a (f), tv10a (f); + SpectrumValue tv7a (f); + SpectrumValue tv8a (f); + SpectrumValue tv9a (f); + SpectrumValue tv10a (f); tv7a = v1 + doubleValue; tv8a = v1 - doubleValue; tv9a = v1 * doubleValue; @@ -232,7 +247,10 @@ SpectrumValueTestSuite::SpectrumValueTestSuite () AddTestCase (new SpectrumValueTestCase (tv9a, v9, "tv9a = v1 * doubleValue"), TestCase::QUICK); AddTestCase (new SpectrumValueTestCase (tv10a, v10, "tv10a = v1 div doubleValue"), TestCase::QUICK); - SpectrumValue tv7b (f), tv8b (f), tv9b (f), tv10b (f); + SpectrumValue tv7b (f); + SpectrumValue tv8b (f); + SpectrumValue tv9b (f); + SpectrumValue tv10b (f); tv7b = doubleValue + v1; tv8b = doubleValue - v1; tv9b = doubleValue * v1; @@ -246,8 +264,10 @@ SpectrumValueTestSuite::SpectrumValueTestSuite () - SpectrumValue v1ls3 (f), v1rs3 (f); - SpectrumValue tv1ls3 (f), tv1rs3 (f); + SpectrumValue v1ls3 (f); + SpectrumValue v1rs3 (f); + SpectrumValue tv1ls3 (f); + SpectrumValue tv1rs3 (f); v1ls3[0] = v1[3]; v1ls3[1] = v1[4]; diff --git a/src/tap-bridge/model/tap-bridge.cc b/src/tap-bridge/model/tap-bridge.cc index 0f3b0e07b..625eb4afe 100644 --- a/src/tap-bridge/model/tap-bridge.cc +++ b/src/tap-bridge/model/tap-bridge.cc @@ -759,7 +759,8 @@ TapBridge::ForwardToBridgedDevice (uint8_t *buf, ssize_t len) // device. What should come back is a packet with the Ethernet header // (and possibly an LLC header as well) stripped off. // - Address src, dst; + Address src; + Address dst; uint16_t type; NS_LOG_LOGIC ("Received packet from tap device"); diff --git a/src/test/ns3tcp/ns3tcp-loss-test-suite.cc b/src/test/ns3tcp/ns3tcp-loss-test-suite.cc index 9d663c42a..a48b66cb7 100644 --- a/src/test/ns3tcp/ns3tcp-loss-test-suite.cc +++ b/src/test/ns3tcp/ns3tcp-loss-test-suite.cc @@ -233,7 +233,11 @@ Ns3TcpLossTestCase::Ipv4L3Tx (std::string, Ptr packet, Ptr, // file and see if it still does the right thing. // uint8_t expectedBuffer[PCAP_SNAPLEN]; - uint32_t tsSec, tsUsec, inclLen, origLen, readLen; + uint32_t tsSec; + uint32_t tsUsec; + uint32_t inclLen; + uint32_t origLen; + uint32_t readLen; m_pcapFile.Read (expectedBuffer, sizeof(expectedBuffer), tsSec, tsUsec, inclLen, origLen, readLen); NS_LOG_INFO ("read " << readLen << " bytes"); @@ -243,7 +247,8 @@ Ns3TcpLossTestCase::Ipv4L3Tx (std::string, Ptr packet, Ptr, int result = memcmp (actual, expectedBuffer, readLen); - TcpHeader expectedHeader, receivedHeader; + TcpHeader expectedHeader; + TcpHeader receivedHeader; Ptr expected = Create (expectedBuffer, readLen); expected->RemoveHeader (expectedHeader); diff --git a/src/test/ns3tcp/ns3tcp-state-test-suite.cc b/src/test/ns3tcp/ns3tcp-state-test-suite.cc index 478f27b8f..9416ea572 100644 --- a/src/test/ns3tcp/ns3tcp-state-test-suite.cc +++ b/src/test/ns3tcp/ns3tcp-state-test-suite.cc @@ -239,7 +239,11 @@ Ns3TcpStateTestCase::Ipv4L3Tx (std::string, Ptr packet, Ptr, // file and see if it still does the right thing. // uint8_t expectedBuffer[PCAP_SNAPLEN]; - uint32_t tsSec, tsUsec, inclLen, origLen, readLen; + uint32_t tsSec; + uint32_t tsUsec; + uint32_t inclLen; + uint32_t origLen; + uint32_t readLen; m_pcapFile.Read (expectedBuffer, sizeof(expectedBuffer), tsSec, tsUsec, inclLen, origLen, readLen); NS_LOG_INFO ("read " << readLen << " bytes"); @@ -249,7 +253,8 @@ Ns3TcpStateTestCase::Ipv4L3Tx (std::string, Ptr packet, Ptr, int result = memcmp (actual, expectedBuffer, readLen); - TcpHeader expectedHeader, receivedHeader; + TcpHeader expectedHeader; + TcpHeader receivedHeader; Ptr expected = Create (expectedBuffer, readLen); expected->RemoveHeader (expectedHeader); diff --git a/src/test/ns3wifi/wifi-ac-mapping-test-suite.cc b/src/test/ns3wifi/wifi-ac-mapping-test-suite.cc index df48aa3b9..29fa07cb2 100644 --- a/src/test/ns3wifi/wifi-ac-mapping-test-suite.cc +++ b/src/test/ns3wifi/wifi-ac-mapping-test-suite.cc @@ -181,7 +181,8 @@ WifiAcMappingTest::DoRun () Ipv4AddressHelper address; address.SetBase ("192.168.0.0", "255.255.255.0"); - Ipv4InterfaceContainer staNodeInterface, apNodeInterface; + Ipv4InterfaceContainer staNodeInterface; + Ipv4InterfaceContainer apNodeInterface; staNodeInterface = address.Assign (staDev); apNodeInterface = address.Assign (apDev); diff --git a/src/test/ns3wifi/wifi-msdu-aggregator-test-suite.cc b/src/test/ns3wifi/wifi-msdu-aggregator-test-suite.cc index 1b16f7956..892364e6e 100644 --- a/src/test/ns3wifi/wifi-msdu-aggregator-test-suite.cc +++ b/src/test/ns3wifi/wifi-msdu-aggregator-test-suite.cc @@ -118,7 +118,8 @@ WifiMsduAggregatorThroughputTest::DoRun () Ipv4AddressHelper address; address.SetBase ("192.168.0.0", "255.255.255.0"); - Ipv4InterfaceContainer staNodeInterface, apNodeInterface; + Ipv4InterfaceContainer staNodeInterface; + Ipv4InterfaceContainer apNodeInterface; staNodeInterface = address.Assign (staDev); apNodeInterface = address.Assign (apDev); diff --git a/src/topology-read/model/rocketfuel-topology-reader.cc b/src/topology-read/model/rocketfuel-topology-reader.cc index fa7f7b2a4..0f97c90e8 100644 --- a/src/topology-read/model/rocketfuel-topology-reader.cc +++ b/src/topology-read/model/rocketfuel-topology-reader.cc @@ -171,7 +171,8 @@ RocketfuelTopologyReader::GenerateFromMapsFile (const std::vector & // Then split list std::regex split_regex ("[ |\t]"); - std::sregex_token_iterator first{temp.begin (), temp.end (), split_regex, -1}, last; + std::sregex_token_iterator first{temp.begin (), temp.end (), split_regex, -1}; + std::sregex_token_iterator last; neigh_list = std::vector{first, last}; } if (num_neigh != neigh_list.size ()) diff --git a/src/traffic-control/examples/codel-vs-pfifo-basic-test.cc b/src/traffic-control/examples/codel-vs-pfifo-basic-test.cc index cfa7bc28f..8200991ef 100644 --- a/src/traffic-control/examples/codel-vs-pfifo-basic-test.cc +++ b/src/traffic-control/examples/codel-vs-pfifo-basic-test.cc @@ -186,7 +186,8 @@ int main (int argc, char *argv[]) // and the channels between the source/sink and the gateway Ipv4InterfaceContainer sinkInterface; - NetDeviceContainer devicesAccessLink, devicesBottleneckLink; + NetDeviceContainer devicesAccessLink; + NetDeviceContainer devicesBottleneckLink; devicesAccessLink = accessLink.Install (source.Get (0), gateway.Get (0)); tchPfifoFastAccess.Install (devicesAccessLink); diff --git a/src/traffic-control/model/fq-cobalt-queue-disc.cc b/src/traffic-control/model/fq-cobalt-queue-disc.cc index 5089768a4..675216456 100644 --- a/src/traffic-control/model/fq-cobalt-queue-disc.cc +++ b/src/traffic-control/model/fq-cobalt-queue-disc.cc @@ -257,7 +257,8 @@ FqCobaltQueueDisc::DoEnqueue (Ptr item) { NS_LOG_FUNCTION (this << item); - uint32_t flowHash, h; + uint32_t flowHash; + uint32_t h; if (GetNPacketFilters () == 0) { @@ -495,7 +496,8 @@ FqCobaltQueueDisc::FqCobaltDrop () { NS_LOG_FUNCTION (this); - uint32_t maxBacklog = 0, index = 0; + uint32_t maxBacklog = 0; + uint32_t index = 0; Ptr qd; /* Queue is full! Find the fat flow and drop packet(s) from it */ @@ -511,7 +513,9 @@ FqCobaltQueueDisc::FqCobaltDrop () } /* Our goal is to drop half of this fat flow backlog */ - uint32_t len = 0, count = 0, threshold = maxBacklog >> 1; + uint32_t len = 0; + uint32_t count = 0; + uint32_t threshold = maxBacklog >> 1; qd = GetQueueDiscClass (index)->GetQueueDisc (); Ptr item; diff --git a/src/traffic-control/model/fq-codel-queue-disc.cc b/src/traffic-control/model/fq-codel-queue-disc.cc index 6aa13c677..a641679c6 100644 --- a/src/traffic-control/model/fq-codel-queue-disc.cc +++ b/src/traffic-control/model/fq-codel-queue-disc.cc @@ -231,7 +231,8 @@ FqCoDelQueueDisc::DoEnqueue (Ptr item) { NS_LOG_FUNCTION (this << item); - uint32_t flowHash, h; + uint32_t flowHash; + uint32_t h; if (GetNPacketFilters () == 0) { @@ -462,7 +463,8 @@ FqCoDelQueueDisc::FqCoDelDrop () { NS_LOG_FUNCTION (this); - uint32_t maxBacklog = 0, index = 0; + uint32_t maxBacklog = 0; + uint32_t index = 0; Ptr qd; /* Queue is full! Find the fat flow and drop packet(s) from it */ @@ -478,7 +480,9 @@ FqCoDelQueueDisc::FqCoDelDrop () } /* Our goal is to drop half of this fat flow backlog */ - uint32_t len = 0, count = 0, threshold = maxBacklog >> 1; + uint32_t len = 0; + uint32_t count = 0; + uint32_t threshold = maxBacklog >> 1; qd = GetQueueDiscClass (index)->GetQueueDisc (); Ptr item; diff --git a/src/traffic-control/model/fq-pie-queue-disc.cc b/src/traffic-control/model/fq-pie-queue-disc.cc index a974e3823..f5154ef87 100644 --- a/src/traffic-control/model/fq-pie-queue-disc.cc +++ b/src/traffic-control/model/fq-pie-queue-disc.cc @@ -287,7 +287,8 @@ FqPieQueueDisc::DoEnqueue (Ptr item) { NS_LOG_FUNCTION (this << item); - uint32_t flowHash, h; + uint32_t flowHash; + uint32_t h; if (GetNPacketFilters () == 0) { @@ -530,7 +531,8 @@ FqPieQueueDisc::FqPieDrop () { NS_LOG_FUNCTION (this); - uint32_t maxBacklog = 0, index = 0; + uint32_t maxBacklog = 0; + uint32_t index = 0; Ptr qd; /* Queue is full! Find the fat flow and drop packet(s) from it */ @@ -546,7 +548,9 @@ FqPieQueueDisc::FqPieDrop () } /* Our goal is to drop half of this fat flow backlog */ - uint32_t len = 0, count = 0, threshold = maxBacklog >> 1; + uint32_t len = 0; + uint32_t count = 0; + uint32_t threshold = maxBacklog >> 1; qd = GetQueueDiscClass (index)->GetQueueDisc (); Ptr item; diff --git a/src/traffic-control/test/cobalt-queue-disc-test-suite.cc b/src/traffic-control/test/cobalt-queue-disc-test-suite.cc index 826aeffce..882c6030f 100644 --- a/src/traffic-control/test/cobalt-queue-disc-test-suite.cc +++ b/src/traffic-control/test/cobalt-queue-disc-test-suite.cc @@ -153,7 +153,12 @@ CobaltQueueDiscBasicEnqueueDequeue::DoRun () true, "Verify that we can actually set the attribute MaxSize"); queue->Initialize (); - Ptr p1, p2, p3, p4, p5, p6; + Ptr p1; + Ptr p2; + Ptr p3; + Ptr p4; + Ptr p5; + Ptr p6; p1 = Create (pktSize); p2 = Create (pktSize); p3 = Create (pktSize); diff --git a/src/traffic-control/test/codel-queue-disc-test-suite.cc b/src/traffic-control/test/codel-queue-disc-test-suite.cc index de95a8427..8c610286d 100644 --- a/src/traffic-control/test/codel-queue-disc-test-suite.cc +++ b/src/traffic-control/test/codel-queue-disc-test-suite.cc @@ -165,7 +165,12 @@ CoDelQueueDiscBasicEnqueueDequeue::DoRun () true, "Verify that we can actually set the attribute MaxSize"); queue->Initialize (); - Ptr p1, p2, p3, p4, p5, p6; + Ptr p1; + Ptr p2; + Ptr p3; + Ptr p4; + Ptr p5; + Ptr p6; p1 = Create (pktSize); p2 = Create (pktSize); p3 = Create (pktSize); @@ -281,7 +286,9 @@ CoDelQueueDiscBasicOverflow::DoRun () modeSize = 1; } - Ptr p1, p2, p3; + Ptr p1; + Ptr p2; + Ptr p3; p1 = Create (pktSize); p2 = Create (pktSize); p3 = Create (pktSize); diff --git a/src/traffic-control/test/pie-queue-disc-test-suite.cc b/src/traffic-control/test/pie-queue-disc-test-suite.cc index fc961ab28..ae1eace6b 100644 --- a/src/traffic-control/test/pie-queue-disc-test-suite.cc +++ b/src/traffic-control/test/pie-queue-disc-test-suite.cc @@ -199,7 +199,14 @@ PieQueueDiscTestCase::RunPieTest (QueueSizeUnit mode) NS_TEST_ASSERT_MSG_EQ (queue->SetAttributeFailSafe ("MaxSize", QueueSizeValue (QueueSize (mode, qSize))), true, "Verify that we can actually set the attribute MaxSize"); - Ptr p1, p2, p3, p4, p5, p6, p7, p8; + Ptr p1; + Ptr p2; + Ptr p3; + Ptr p4; + Ptr p5; + Ptr p6; + Ptr p7; + Ptr p8; p1 = Create (pktSize); p2 = Create (pktSize); p3 = Create (pktSize); diff --git a/src/traffic-control/test/red-queue-disc-test-suite.cc b/src/traffic-control/test/red-queue-disc-test-suite.cc index 36c008e8e..03d9192db 100644 --- a/src/traffic-control/test/red-queue-disc-test-suite.cc +++ b/src/traffic-control/test/red-queue-disc-test-suite.cc @@ -145,7 +145,14 @@ RedQueueDiscTestCase::RunRedTest (QueueSizeUnit mode) queue->SetMaxSize (QueueSize (mode, qSize * modeSize)); } - Ptr p1, p2, p3, p4, p5, p6, p7, p8; + Ptr p1; + Ptr p2; + Ptr p3; + Ptr p4; + Ptr p5; + Ptr p6; + Ptr p7; + Ptr p8; p1 = Create (pktSize); p2 = Create (pktSize); p3 = Create (pktSize); diff --git a/src/traffic-control/test/tbf-queue-disc-test-suite.cc b/src/traffic-control/test/tbf-queue-disc-test-suite.cc index 0777f9921..c1e677a4f 100644 --- a/src/traffic-control/test/tbf-queue-disc-test-suite.cc +++ b/src/traffic-control/test/tbf-queue-disc-test-suite.cc @@ -163,7 +163,11 @@ TbfQueueDiscTestCase::RunTbfTest (QueueSizeUnit mode) Address dest; - Ptr p1, p2, p3, p4, p5; + Ptr p1; + Ptr p2; + Ptr p3; + Ptr p4; + Ptr p5; p1 = Create (pktSize); p2 = Create (pktSize); p3 = Create (pktSize); diff --git a/src/uan/model/uan-noise-model-default.cc b/src/uan/model/uan-noise-model-default.cc index 18a57f2b8..14794a537 100644 --- a/src/uan/model/uan-noise-model-default.cc +++ b/src/uan/model/uan-noise-model-default.cc @@ -60,8 +60,15 @@ UanNoiseModelDefault::GetTypeId () double UanNoiseModelDefault::GetNoiseDbHz (double fKhz) const { - double turb, wind, ship, thermal; - double turbDb, windDb, shipDb, thermalDb, noiseDb; + double turb; + double wind; + double ship; + double thermal; + double turbDb; + double windDb; + double shipDb; + double thermalDb; + double noiseDb; turbDb = 17.0 - 30.0 * std::log10 (fKhz); turb = std::pow (10.0, turbDb * 0.1); diff --git a/src/uan/model/uan-phy-dual.cc b/src/uan/model/uan-phy-dual.cc index e58b889d3..31eb9a4cb 100644 --- a/src/uan/model/uan-phy-dual.cc +++ b/src/uan/model/uan-phy-dual.cc @@ -88,7 +88,8 @@ UanPhyCalcSinrDual::CalcSinrDb (Ptr pkt, if (std::abs ( (double) it->GetTxMode ().GetCenterFreqHz () - (double) mode.GetCenterFreqHz ()) < (double)(it->GetTxMode ().GetBandwidthHz () / 2 + mode.GetBandwidthHz () / 2) - 0.5) { - UanHeaderCommon ch, ch2; + UanHeaderCommon ch; + UanHeaderCommon ch2; if (pkt) { pkt->PeekHeader (ch); diff --git a/src/wave/test/mac-extension-test-suite.cc b/src/wave/test/mac-extension-test-suite.cc index cd47829b0..a1ffc2016 100644 --- a/src/wave/test/mac-extension-test-suite.cc +++ b/src/wave/test/mac-extension-test-suite.cc @@ -446,7 +446,8 @@ ChannelRoutingTestCase::DoRun () NetDeviceContainer devices = TestCaseHelper::CreatWaveDevice (1); m_sender = DynamicCast (devices.Get (0)); - bool ipv6 = true, ipv4 = false; + bool ipv6 = true; + bool ipv4 = false; Simulator::Schedule (Seconds (0.1), &ChannelRoutingTestCase::SendIp, this, false, ipv6); Simulator::Schedule (Seconds (0.1), &ChannelRoutingTestCase::SendIp, this, false, ipv4); diff --git a/src/wifi/examples/wifi-bianchi.cc b/src/wifi/examples/wifi-bianchi.cc index db915b2ce..751d64cdd 100644 --- a/src/wifi/examples/wifi-bianchi.cc +++ b/src/wifi/examples/wifi-bianchi.cc @@ -1447,7 +1447,8 @@ int main (int argc, char *argv[]) Experiment experiment; WifiMacHelper wifiMac; - double averageThroughput, throughputArray[trials]; + double averageThroughput; + double throughputArray[trials]; for (uint32_t n = nMinStas; n <= nMaxStas; n += nStepSize) { averageThroughput = 0; diff --git a/src/wifi/examples/wifi-manager-example.cc b/src/wifi/examples/wifi-manager-example.cc index 6f227826b..93a486832 100644 --- a/src/wifi/examples/wifi-manager-example.cc +++ b/src/wifi/examples/wifi-manager-example.cc @@ -571,7 +571,9 @@ int main (int argc, char *argv[]) gnuplot.AddDataset (rateDataset); gnuplot.AddDataset (actualDataset); - std::ostringstream xMinStr, xMaxStr, yMaxStr; + std::ostringstream xMinStr; + std::ostringstream xMaxStr; + std::ostringstream yMaxStr; std::string xRangeStr ("set xrange ["); xMinStr << clientSelectedStandard.m_xMin; xRangeStr.append (xMinStr.str ()); diff --git a/src/wifi/helper/wifi-helper.cc b/src/wifi/helper/wifi-helper.cc index 1aa3f8d77..cef262a39 100644 --- a/src/wifi/helper/wifi-helper.cc +++ b/src/wifi/helper/wifi-helper.cc @@ -528,7 +528,8 @@ WifiPhyHelper::GetRadiotapHeader ( if (preamble == WIFI_PREAMBLE_HE_MU) { //TODO: fill in fields (everything is set to 0 so far) - std::array ruChannel1, ruChannel2; + std::array ruChannel1; + std::array ruChannel2; header.SetHeMuFields (0, 0, ruChannel1, ruChannel2); header.SetHeMuPerUserFields (0, 0, 0, 0); } diff --git a/src/wifi/model/error-rate-model.cc b/src/wifi/model/error-rate-model.cc index 83f463e82..99af05b2c 100644 --- a/src/wifi/model/error-rate-model.cc +++ b/src/wifi/model/error-rate-model.cc @@ -39,7 +39,9 @@ double ErrorRateModel::CalculateSnr (const WifiTxVector& txVector, double ber) const { //This is a very simple binary search. - double low, high, precision; + double low; + double high; + double precision; low = 1e-25; high = 1e25; precision = 2e-12; diff --git a/src/wifi/model/he/rr-multi-user-scheduler.cc b/src/wifi/model/he/rr-multi-user-scheduler.cc index 4378280e4..845d5c914 100644 --- a/src/wifi/model/he/rr-multi-user-scheduler.cc +++ b/src/wifi/model/he/rr-multi-user-scheduler.cc @@ -615,8 +615,8 @@ RrMultiUserScheduler::TrySendingDlMuPpdu () // candidate station to check if the MPDU meets the size and time limits. // An RU of the computed size is tentatively assigned to the candidate // station, so that the TX duration can be correctly computed. - WifiTxVector suTxVector = GetWifiRemoteStationManager ()->GetDataTxVector (mpdu->GetHeader (), m_allowedWidth), - txVectorCopy = m_txParams.m_txVector; + WifiTxVector suTxVector = GetWifiRemoteStationManager ()->GetDataTxVector (mpdu->GetHeader (), m_allowedWidth); + WifiTxVector txVectorCopy = m_txParams.m_txVector; m_txParams.m_txVector.SetHeMuUserInfo (staIt->aid, {{currRuType, 1, false}, diff --git a/src/wifi/model/mgt-headers.cc b/src/wifi/model/mgt-headers.cc index a69106425..ada00907d 100644 --- a/src/wifi/model/mgt-headers.cc +++ b/src/wifi/model/mgt-headers.cc @@ -831,7 +831,8 @@ MgtProbeResponseHeader::Serialize (Buffer::Iterator start) const uint32_t MgtProbeResponseHeader::Deserialize (Buffer::Iterator start) { - Buffer::Iterator tmp, i = start; + Buffer::Iterator tmp; + Buffer::Iterator i = start; m_timestamp = i.ReadLsbtohU64 (); m_beaconInterval = i.ReadLsbtohU16 (); m_beaconInterval *= 1024; @@ -1190,7 +1191,8 @@ MgtAssocRequestHeader::Serialize (Buffer::Iterator start) const uint32_t MgtAssocRequestHeader::Deserialize (Buffer::Iterator start) { - Buffer::Iterator tmp, i = start; + Buffer::Iterator tmp; + Buffer::Iterator i = start; i = m_capability.Deserialize (i); m_listenInterval = i.ReadLsbtohU16 (); i = m_ssid.Deserialize (i); @@ -1529,7 +1531,8 @@ MgtReassocRequestHeader::Serialize (Buffer::Iterator start) const uint32_t MgtReassocRequestHeader::Deserialize (Buffer::Iterator start) { - Buffer::Iterator tmp, i = start; + Buffer::Iterator tmp; + Buffer::Iterator i = start; i = m_capability.Deserialize (i); m_listenInterval = i.ReadLsbtohU16 (); ReadFrom (i, m_currentApAddr); @@ -2027,7 +2030,8 @@ MgtAssocResponseHeader::Serialize (Buffer::Iterator start) const uint32_t MgtAssocResponseHeader::Deserialize (Buffer::Iterator start) { - Buffer::Iterator tmp, i = start; + Buffer::Iterator tmp; + Buffer::Iterator i = start; i = m_capability.Deserialize (i); i = m_code.Deserialize (i); m_aid = i.ReadLsbtohU16 (); diff --git a/src/wifi/model/qos-utils.cc b/src/wifi/model/qos-utils.cc index 8724668b3..7360dd248 100644 --- a/src/wifi/model/qos-utils.cc +++ b/src/wifi/model/qos-utils.cc @@ -252,7 +252,8 @@ GetTid (Ptr packet, const WifiMacHeader hdr) uint8_t SelectQueueByDSField (Ptr item) { - uint8_t dscp, priority = 0; + uint8_t dscp; + uint8_t priority = 0; if (item->GetUint8Value (QueueItem::IP_DSFIELD, dscp)) { // if the QoS map element is implemented, it should be used here diff --git a/src/wifi/model/rate-control/minstrel-ht-wifi-manager.cc b/src/wifi/model/rate-control/minstrel-ht-wifi-manager.cc index 7632c1aa8..94db1e324 100644 --- a/src/wifi/model/rate-control/minstrel-ht-wifi-manager.cc +++ b/src/wifi/model/rate-control/minstrel-ht-wifi-manager.cc @@ -1413,12 +1413,16 @@ MinstrelHtWifiManager::SetBestProbabilityRate (MinstrelHtWifiRemoteStation *stat { GroupInfo *group; MinstrelHtRateInfo rate; - uint8_t tmpGroupId, tmpRateId; - double tmpTh, tmpProb; - uint8_t groupId, rateId; + uint8_t tmpGroupId; + uint8_t tmpRateId; + double tmpTh; + double tmpProb; + uint8_t groupId; + uint8_t rateId; double currentTh; // maximum group probability (GP) variables - uint8_t maxGPGroupId, maxGPRateId; + uint8_t maxGPGroupId; + uint8_t maxGPRateId; double maxGPTh; groupId = GetGroupId (index); @@ -1472,12 +1476,18 @@ MinstrelHtWifiManager::SetBestProbabilityRate (MinstrelHtWifiRemoteStation *stat void MinstrelHtWifiManager::SetBestStationThRates (MinstrelHtWifiRemoteStation *station, uint16_t index) { - uint8_t groupId, rateId; - double th, prob; - uint8_t maxTpGroupId, maxTpRateId; - uint8_t maxTp2GroupId, maxTp2RateId; - double maxTpTh, maxTpProb; - double maxTp2Th, maxTp2Prob; + uint8_t groupId; + uint8_t rateId; + double th; + double prob; + uint8_t maxTpGroupId; + uint8_t maxTpRateId; + uint8_t maxTp2GroupId; + uint8_t maxTp2RateId; + double maxTpTh; + double maxTpProb; + double maxTp2Th; + double maxTp2Prob; groupId = GetGroupId (index); rateId = GetRateId (index); @@ -1680,7 +1690,9 @@ MinstrelHtWifiManager::CalculateRetransmits (MinstrelHtWifiRemoteStation *statio uint32_t cw = 15; // Is an approximation. uint32_t cwMax = 1023; - Time cwTime, txTime, dataTxTime; + Time cwTime; + Time txTime; + Time dataTxTime; Time slotTime = GetPhy ()->GetSlot (); Time ackTime = GetPhy ()->GetSifs () + GetPhy ()->GetBlockAckTxTime (); @@ -1723,7 +1735,9 @@ MinstrelHtWifiManager::CalculateRetransmits (MinstrelHtWifiRemoteStation *statio double MinstrelHtWifiManager::CalculateEwmsd (double oldEwmsd, double currentProb, double ewmaProb, double weight) { - double diff, incr, tmp; + double diff; + double incr; + double tmp; /* calculate exponential weighted moving variance */ diff = currentProb - ewmaProb; diff --git a/src/wifi/model/rate-control/minstrel-wifi-manager.cc b/src/wifi/model/rate-control/minstrel-wifi-manager.cc index cb421de60..9152064e5 100644 --- a/src/wifi/model/rate-control/minstrel-wifi-manager.cc +++ b/src/wifi/model/rate-control/minstrel-wifi-manager.cc @@ -640,7 +640,8 @@ MinstrelWifiManager::UpdateStats (MinstrelWifiRemoteStation *station) NS_LOG_DEBUG ("Attempt/success reset to 0"); uint32_t max_tp = 0; - uint8_t index_max_tp = 0, index_max_tp2 = 0; + uint8_t index_max_tp = 0; + uint8_t index_max_tp2 = 0; //go find max throughput, second maximum throughput, high probability of success NS_LOG_DEBUG ("Finding the maximum throughput, second maximum throughput, and highest probability"); diff --git a/src/wifi/model/rate-control/onoe-wifi-manager.cc b/src/wifi/model/rate-control/onoe-wifi-manager.cc index d561a8ff5..47ea8277d 100644 --- a/src/wifi/model/rate-control/onoe-wifi-manager.cc +++ b/src/wifi/model/rate-control/onoe-wifi-manager.cc @@ -211,7 +211,8 @@ OnoeWifiManager::UpdateMode (OnoeWifiRemoteStation *station) * rate control kernel module used in the madwifi driver. */ - int dir = 0, enough; + int dir = 0; + int enough; uint8_t nrate; enough = (station->m_tx_ok + station->m_tx_err >= 10); diff --git a/src/wifi/model/table-based-error-rate-model.cc b/src/wifi/model/table-based-error-rate-model.cc index af6541286..b3599f009 100644 --- a/src/wifi/model/table-based-error-rate-model.cc +++ b/src/wifi/model/table-based-error-rate-model.cc @@ -195,7 +195,10 @@ TableBasedErrorRateModel::DoGetChunkSuccessRate (WifiMode mode, const WifiTxVect } else { - double a = 0.0, b = 0.0, previousSnr = 0.0, nextSnr = 0.0; + double a = 0.0; + double b = 0.0; + double previousSnr = 0.0; + double nextSnr = 0.0; for (auto i = itVector.cbegin (); i != itVector.cend (); ++i) { if (i->first < roundedSnr) diff --git a/src/wifi/model/wifi-information-element.cc b/src/wifi/model/wifi-information-element.cc index 10285df79..3d302a5d0 100644 --- a/src/wifi/model/wifi-information-element.cc +++ b/src/wifi/model/wifi-information-element.cc @@ -250,7 +250,8 @@ WifiInformationElement::operator== (WifiInformationElement const & a) const uint32_t ieSize = GetInformationFieldSize (); - Buffer myIe, hisIe; + Buffer myIe; + Buffer hisIe; myIe.AddAtEnd (ieSize); hisIe.AddAtEnd (ieSize); diff --git a/src/wifi/model/wifi-remote-station-manager.cc b/src/wifi/model/wifi-remote-station-manager.cc index c3a866f4e..490a4ced0 100644 --- a/src/wifi/model/wifi-remote-station-manager.cc +++ b/src/wifi/model/wifi-remote-station-manager.cc @@ -1126,7 +1126,8 @@ WifiRemoteStationManager::NeedRetransmission (Ptr mpdu) NS_ASSERT (!mpdu->GetHeader ().GetAddr1 ().IsGroup ()); AcIndex ac = QosUtilsMapTidToAc ((mpdu->GetHeader ().IsQosData ()) ? mpdu->GetHeader ().GetQosTid () : 0); bool longMpdu = (mpdu->GetSize () > m_rtsCtsThreshold); - uint32_t retryCount, maxRetryCount; + uint32_t retryCount; + uint32_t maxRetryCount; if (longMpdu) { retryCount = m_slrc[ac]; diff --git a/src/wifi/test/block-ack-test-suite.cc b/src/wifi/test/block-ack-test-suite.cc index a6bb31027..7542de571 100644 --- a/src/wifi/test/block-ack-test-suite.cc +++ b/src/wifi/test/block-ack-test-suite.cc @@ -109,7 +109,8 @@ void PacketBufferingCaseA::DoRun () { std::list m_buffer; - std::list::iterator i,j; + std::list::iterator i; + std::list::iterator j; m_buffer.push_back (0); m_buffer.push_back (16); m_buffer.push_back (56000); @@ -207,7 +208,8 @@ void PacketBufferingCaseB::DoRun () { std::list m_buffer; - std::list::iterator i,j; + std::list::iterator i; + std::list::iterator j; m_buffer.push_back (256); m_buffer.push_back (64000); m_buffer.push_back (16); diff --git a/src/wifi/test/wifi-aggregation-test.cc b/src/wifi/test/wifi-aggregation-test.cc index 888fb6abb..4347ea249 100644 --- a/src/wifi/test/wifi-aggregation-test.cc +++ b/src/wifi/test/wifi-aggregation-test.cc @@ -215,7 +215,8 @@ AmpduAggregationTest::DoRun () */ Ptr pkt1 = Create (1500); Ptr pkt2 = Create (1500); - WifiMacHeader hdr1, hdr2; + WifiMacHeader hdr1; + WifiMacHeader hdr2; hdr1.SetAddr1 (Mac48Address ("00:00:00:00:00:02")); hdr1.SetAddr2 (Mac48Address ("00:00:00:00:00:01")); diff --git a/src/wifi/test/wifi-eht-info-elems-test.cc b/src/wifi/test/wifi-eht-info-elems-test.cc index fb3af1031..9117b7464 100644 --- a/src/wifi/test/wifi-eht-info-elems-test.cc +++ b/src/wifi/test/wifi-eht-info-elems-test.cc @@ -281,7 +281,9 @@ ReducedNeighborReportTest::GetReducedNeighborReport (PhyOpChannelIt channel2_4It void ReducedNeighborReportTest::DoRun () { - PhyOpChannelIt channel2_4It, channel5It, channel6It; + PhyOpChannelIt channel2_4It; + PhyOpChannelIt channel5It; + PhyOpChannelIt channel6It; channel2_4It = channel5It = channel6It = WifiPhyOperatingChannel::m_frequencyChannels.cbegin (); // Test all available frequency channels diff --git a/src/wifi/test/wifi-mlo-test.cc b/src/wifi/test/wifi-mlo-test.cc index 5beee7bf1..1437d1894 100644 --- a/src/wifi/test/wifi-mlo-test.cc +++ b/src/wifi/test/wifi-mlo-test.cc @@ -380,7 +380,8 @@ MultiLinkSetupTest::DoRun () {WIFI_PHY_BAND_5GHZ, CreateObject ()}, {WIFI_PHY_BAND_6GHZ, CreateObject ()}}; - SpectrumWifiPhyHelper staPhyHelper, apPhyHelper; + SpectrumWifiPhyHelper staPhyHelper; + SpectrumWifiPhyHelper apPhyHelper; SetChannels (staPhyHelper, m_staChannels, channelMap); SetChannels (apPhyHelper, m_apChannels, channelMap); diff --git a/src/wifi/test/wifi-phy-ofdma-test.cc b/src/wifi/test/wifi-phy-ofdma-test.cc index aa55137a7..89ba7630a 100644 --- a/src/wifi/test/wifi-phy-ofdma-test.cc +++ b/src/wifi/test/wifi-phy-ofdma-test.cc @@ -3421,7 +3421,9 @@ TestUlOfdmaPhyTransmission::RunOne () //Another HE TB PPDU arrives at AP on the same RU as STA 1 during PSDU reception Simulator::Schedule (delay + MicroSeconds (50), &TestUlOfdmaPhyTransmission::SendHeTbPpdu, this, 3, 1, 1002, 1, 0, false); //Expected figures from STA 2 - uint32_t succ, fail, bytes; + uint32_t succ; + uint32_t fail; + uint32_t bytes; if (m_channelWidth > 20) { //One PSDU of 1001 bytes should have been successfully received from STA 2 (since interference from STA 3 on distinct 20 MHz channel) diff --git a/src/wifi/test/wifi-test.cc b/src/wifi/test/wifi-test.cc index 4083dfd89..5e4208934 100644 --- a/src/wifi/test/wifi-test.cc +++ b/src/wifi/test/wifi-test.cc @@ -1939,7 +1939,8 @@ StaWifiMacScanningTestCase::Setup (bool nearestApBeaconGeneration, bool staActiv wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager"); WifiMacHelper mac; - NetDeviceContainer apDevice, apDeviceNearest; + NetDeviceContainer apDevice; + NetDeviceContainer apDeviceNearest; mac.SetType ("ns3::ApWifiMac", "BeaconGeneration", BooleanValue (true)); apDevice = wifi.Install (phy, mac, apNodes); @@ -2191,7 +2192,8 @@ Bug2470TestCase::RunSubtest (PointerValue apErrorModel, PointerValue staErrorMod RngSeedManager::SetRun (1); int64_t streamNumber = 200; - NodeContainer wifiApNode, wifiStaNode; + NodeContainer wifiApNode; + NodeContainer wifiStaNode; wifiApNode.Create (1); wifiStaNode.Create (1); @@ -2416,7 +2418,8 @@ Issue40TestCase::RunOne (bool useAmpdu) RngSeedManager::SetRun (1); int64_t streamNumber = 100; - NodeContainer wifiApNode, wifiStaNode; + NodeContainer wifiApNode; + NodeContainer wifiStaNode; wifiApNode.Create (1); wifiStaNode.Create (1); @@ -2580,7 +2583,8 @@ Issue169TestCase::DoRun () RngSeedManager::SetRun (1); int64_t streamNumber = 100; - NodeContainer wifiApNode, wifiStaNode; + NodeContainer wifiApNode; + NodeContainer wifiStaNode; wifiApNode.Create (1); wifiStaNode.Create (1); @@ -2729,7 +2733,8 @@ IdealRateManagerChannelWidthTest::DoRun () RngSeedManager::SetRun (1); int64_t streamNumber = 100; - NodeContainer wifiApNode, wifiStaNode; + NodeContainer wifiApNode; + NodeContainer wifiStaNode; wifiApNode.Create (1); wifiStaNode.Create (1); @@ -2909,7 +2914,8 @@ IdealRateManagerMimoTest::DoRun () RngSeedManager::SetRun (1); int64_t streamNumber = 100; - NodeContainer wifiApNode, wifiStaNode; + NodeContainer wifiApNode; + NodeContainer wifiStaNode; wifiApNode.Create (1); wifiStaNode.Create (1); diff --git a/src/wimax/examples/wimax-ipv4.cc b/src/wimax/examples/wimax-ipv4.cc index eaafcf951..73114f45c 100644 --- a/src/wimax/examples/wimax-ipv4.cc +++ b/src/wimax/examples/wimax-ipv4.cc @@ -67,7 +67,9 @@ NS_LOG_COMPONENT_DEFINE ("wimaxIpV4Simulation"); int main (int argc, char *argv[]) { // default values - int nbSS = 4, duration = 7, schedType = 0; + int nbSS = 4; + int duration = 7; + int schedType = 0; bool verbose = false; WimaxHelper::SchedulerType scheduler = WimaxHelper::SCHED_TYPE_SIMPLE; LogComponentEnable ("UdpClient", LOG_LEVEL_INFO); @@ -104,7 +106,8 @@ int main (int argc, char *argv[]) WimaxHelper wimax; - NetDeviceContainer ssDevs, bsDevs; + NetDeviceContainer ssDevs; + NetDeviceContainer bsDevs; ssDevs = wimax.Install (ssNodes, WimaxHelper::DEVICE_TYPE_SUBSCRIBER_STATION, diff --git a/src/wimax/examples/wimax-multicast.cc b/src/wimax/examples/wimax-multicast.cc index 1f1496eed..8679a565c 100644 --- a/src/wimax/examples/wimax-multicast.cc +++ b/src/wimax/examples/wimax-multicast.cc @@ -78,7 +78,8 @@ int main (int argc, char *argv[]) NodeContainer bsNodes; Ptr bs; - NetDeviceContainer bsDevs, bsDevsOne; + NetDeviceContainer bsDevs; + NetDeviceContainer bsDevsOne; Ipv4InterfaceContainer BSinterfaces; UdpTraceClientHelper udpClient; @@ -93,7 +94,9 @@ int main (int argc, char *argv[]) std::vector > SSPosAllocator; // default values - int nbSS = 10, duration = 7, schedType = 0; + int nbSS = 10; + int duration = 7; + int schedType = 0; WimaxHelper::SchedulerType scheduler = WimaxHelper::SCHED_TYPE_SIMPLE; CommandLine cmd (__FILE__); diff --git a/src/wimax/examples/wimax-simple.cc b/src/wimax/examples/wimax-simple.cc index e72be808f..0943e9ea8 100644 --- a/src/wimax/examples/wimax-simple.cc +++ b/src/wimax/examples/wimax-simple.cc @@ -62,7 +62,8 @@ int main (int argc, char *argv[]) { bool verbose = false; - int duration = 7, schedType = 0; + int duration = 7; + int schedType = 0; WimaxHelper::SchedulerType scheduler = WimaxHelper::SCHED_TYPE_SIMPLE; CommandLine cmd (__FILE__); @@ -95,7 +96,8 @@ int main (int argc, char *argv[]) WimaxHelper wimax; - NetDeviceContainer ssDevs, bsDevs; + NetDeviceContainer ssDevs; + NetDeviceContainer bsDevs; ssDevs = wimax.Install (ssNodes, WimaxHelper::DEVICE_TYPE_SUBSCRIBER_STATION, diff --git a/src/wimax/model/bs-net-device.cc b/src/wimax/model/bs-net-device.cc index 0c4b298c4..ce88899d9 100644 --- a/src/wimax/model/bs-net-device.cc +++ b/src/wimax/model/bs-net-device.cc @@ -880,8 +880,12 @@ BaseStationNetDevice::DoReceive (Ptr packet) void BaseStationNetDevice::CreateMapMessages () { - Ptr dlmap, ulmap; - bool sendDcd = false, sendUcd = false, updateDcd = false, updateUcd = false; + Ptr dlmap; + Ptr ulmap; + bool sendDcd = false; + bool sendUcd = false; + bool updateDcd = false; + bool updateUcd = false; uint16_t currentNrSsRegistered = m_ssManager->GetNRegisteredSSs (); @@ -924,7 +928,8 @@ BaseStationNetDevice::CreateMapMessages () void BaseStationNetDevice::CreateDescriptorMessages (bool sendDcd, bool sendUcd) { - Ptr dcd, ucd; + Ptr dcd; + Ptr ucd; if (sendDcd) { diff --git a/src/wimax/model/snr-to-block-error-rate-manager.cc b/src/wimax/model/snr-to-block-error-rate-manager.cc index 17a835d24..a7706c9fb 100644 --- a/src/wimax/model/snr-to-block-error-rate-manager.cc +++ b/src/wimax/model/snr-to-block-error-rate-manager.cc @@ -82,7 +82,12 @@ SNRToBlockErrorRateManager::LoadTraces () { std::ifstream traceFile; ClearRecords (); - double snrValue, bitErrorRate, burstErrorRate, sigma2, I1, I2; + double snrValue; + double bitErrorRate; + double burstErrorRate; + double sigma2; + double I1; + double I2; for (int i = 0; i < 7; i++) { @@ -116,7 +121,12 @@ SNRToBlockErrorRateManager::LoadTraces () void SNRToBlockErrorRateManager::LoadDefaultTraces () { - double snrValue, bitErrorRate, burstErrorRate, sigma2, I1, I2; + double snrValue; + double bitErrorRate; + double burstErrorRate; + double sigma2; + double I1; + double I2; ClearRecords (); for (unsigned int j = 0; j < sizeof(modulation0[0]) / sizeof(double); j++) { @@ -236,7 +246,12 @@ SNRToBlockErrorRateManager::LoadDefaultTraces () void SNRToBlockErrorRateManager::ReLoadTraces () { - double snrValue, bitErrorRate, burstErrorRate, sigma2, I1, I2; + double snrValue; + double bitErrorRate; + double burstErrorRate; + double sigma2; + double I1; + double I2; ClearRecords (); diff --git a/src/wimax/test/phy-test.cc b/src/wimax/test/phy-test.cc index e053afb98..4c9c1c3d1 100644 --- a/src/wimax/test/phy-test.cc +++ b/src/wimax/test/phy-test.cc @@ -80,7 +80,8 @@ Ns3WimaxSimpleOFDMTestCase::DoRunOnce (double FrameDuration) WimaxHelper wimax; - NetDeviceContainer ssDevs, bsDevs; + NetDeviceContainer ssDevs; + NetDeviceContainer bsDevs; ssDevs = wimax.Install (ssNodes, WimaxHelper::DEVICE_TYPE_SUBSCRIBER_STATION, WimaxHelper::SIMPLE_PHY_TYPE_OFDM, scheduler, FrameDuration); diff --git a/src/wimax/test/qos-test.cc b/src/wimax/test/qos-test.cc index dbb9d125c..2dafda878 100644 --- a/src/wimax/test/qos-test.cc +++ b/src/wimax/test/qos-test.cc @@ -73,7 +73,8 @@ Ns3WimaxSchedulingTestCase::DoRunOnce (WimaxHelper::SchedulerType scheduler) ssNodes.Create (2); bsNodes.Create (1); WimaxHelper wimax; - NetDeviceContainer ssDevs, bsDevs; + NetDeviceContainer ssDevs; + NetDeviceContainer bsDevs; ssDevs = wimax.Install (ssNodes, WimaxHelper::DEVICE_TYPE_SUBSCRIBER_STATION, WimaxHelper::SIMPLE_PHY_TYPE_OFDM, @@ -202,7 +203,8 @@ Ns3WimaxSFTypeTestCase::DoRunOnce (ServiceFlow::SchedulingType schedulingType) ssNodes.Create (2); bsNodes.Create (1); WimaxHelper wimax; - NetDeviceContainer ssDevs, bsDevs; + NetDeviceContainer ssDevs; + NetDeviceContainer bsDevs; ssDevs = wimax.Install (ssNodes, WimaxHelper::DEVICE_TYPE_SUBSCRIBER_STATION, WimaxHelper::SIMPLE_PHY_TYPE_OFDM, diff --git a/src/wimax/test/ss-mac-test.cc b/src/wimax/test/ss-mac-test.cc index 461520432..0a8e2d959 100644 --- a/src/wimax/test/ss-mac-test.cc +++ b/src/wimax/test/ss-mac-test.cc @@ -68,7 +68,8 @@ Ns3WimaxNetworkEntryTestCase::DoRun () WimaxHelper wimax; - NetDeviceContainer ssDevs, bsDevs; + NetDeviceContainer ssDevs; + NetDeviceContainer bsDevs; ssDevs = wimax.Install (ssNodes, WimaxHelper::DEVICE_TYPE_SUBSCRIBER_STATION, @@ -129,7 +130,8 @@ Ns3WimaxManagementConnectionsTestCase::DoRun () WimaxHelper wimax; - NetDeviceContainer ssDevs, bsDevs; + NetDeviceContainer ssDevs; + NetDeviceContainer bsDevs; ssDevs = wimax.Install (ssNodes, WimaxHelper::DEVICE_TYPE_SUBSCRIBER_STATION, diff --git a/src/wimax/test/wimax-service-flow-test.cc b/src/wimax/test/wimax-service-flow-test.cc index e80c89a49..853b0a5e7 100644 --- a/src/wimax/test/wimax-service-flow-test.cc +++ b/src/wimax/test/wimax-service-flow-test.cc @@ -74,7 +74,8 @@ Ns3WimaxSfCreationTestCase::DoRun () WimaxHelper wimax; - NetDeviceContainer ssDevs, bsDevs; + NetDeviceContainer ssDevs; + NetDeviceContainer bsDevs; ssDevs = wimax.Install (ssNodes, WimaxHelper::DEVICE_TYPE_SUBSCRIBER_STATION, diff --git a/utils/bench-scheduler.cc b/utils/bench-scheduler.cc index 479903f40..401ebe064 100644 --- a/utils/bench-scheduler.cc +++ b/utils/bench-scheduler.cc @@ -131,7 +131,8 @@ Bench::Result Bench::Run () { SystemWallClockMs timer; - double init, simu; + double init; + double simu; DEB ("initializing"); m_count = 0; @@ -362,7 +363,8 @@ BenchSuite::Log () const for ( ; n < m_results.size (); ++n) { - double deltaPre, deltaPost; + double deltaPre; + double deltaPost; const auto & run = m_results[n]; uint64_t count = n + 1;