Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(411)

Unified Diff: examples/matrix-topology/matrix-topology.cc

Issue 341750043: Eliminate Visual Studio compiler warnings (Closed)
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: examples/matrix-topology/matrix-topology.cc
===================================================================
--- a/examples/matrix-topology/matrix-topology.cc
+++ b/examples/matrix-topology/matrix-topology.cc
@@ -122,8 +122,8 @@
// Optionally display node co-ordinates file
// printCoordinateArray (node_coordinates_file_name.c_str (),coord_array);
- int n_nodes = coord_array.size ();
- int matrixDimension = Adj_Matrix.size ();
+ size_t n_nodes = coord_array.size ();
+ size_t matrixDimension = Adj_Matrix.size ();
if (matrixDimension != n_nodes)
{
@@ -137,7 +137,7 @@
NS_LOG_INFO ("Create Nodes.");
NodeContainer nodes; // Declare nodes objects
- nodes.Create (n_nodes);
+ nodes.Create (static_cast<uint32_t>(n_nodes));
NS_LOG_INFO ("Create P2P Link Attributes.");
@@ -159,9 +159,9 @@
uint32_t linkCount = 0;
- for (size_t i = 0; i < Adj_Matrix.size (); i++)
+ for (uint32_t i = 0; i < static_cast<uint32_t>(Adj_Matrix.size ()); i++)
{
- for (size_t j = 0; j < Adj_Matrix[i].size (); j++)
+ for (uint32_t j = 0; j < static_cast<uint32_t>(Adj_Matrix[i].size ()); j++)
{
if (Adj_Matrix[i][j] == 1)
@@ -194,7 +194,7 @@
MobilityHelper mobility_n;
Ptr<ListPositionAllocator> positionAlloc_n = CreateObject<ListPositionAllocator> ();
- for (size_t m = 0; m < coord_array.size (); m++)
+ for (uint32_t m = 0; m < static_cast<uint32_t>(coord_array.size ()); m++)
{
positionAlloc_n->Add (Vector (coord_array[m][0], coord_array[m][1], 0));
Ptr<Node> n0 = nodes.Get (m);
@@ -223,7 +223,7 @@
uint16_t port = 9;
- for (int i = 0; i < n_nodes; i++)
+ for (unsigned int i = 0; i < n_nodes; i++)
{
PacketSinkHelper sink ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), port));
ApplicationContainer apps_sink = sink.Install (nodes.Get (i)); // sink is installed on all nodes
@@ -233,9 +233,9 @@
NS_LOG_INFO ("Setup CBR Traffic Sources.");
- for (int i = 0; i < n_nodes; i++)
+ for (unsigned int i = 0; i < n_nodes; i++)
{
- for (int j = 0; j < n_nodes; j++)
+ for (unsigned int j = 0; j < n_nodes; j++)
{
if (i != j)
{
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b