Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Proper fix for compilation warning
authorStéphane Castelli <stephane.castelli@loria.fr>
Thu, 17 Apr 2014 08:36:37 +0000 (10:36 +0200)
committerStéphane Castelli <stephane.castelli@loria.fr>
Thu, 17 Apr 2014 08:36:37 +0000 (10:36 +0200)
src/surf/surf_routing_cluster_fat_tree.cpp
src/surf/surf_routing_cluster_fat_tree.hpp

index ffdfc37..df02a8d 100644 (file)
@@ -10,7 +10,7 @@
 AsClusterFatTree::AsClusterFatTree() : levels(0) {}
 
 AsClusterFatTree::~AsClusterFatTree() {
 AsClusterFatTree::AsClusterFatTree() : levels(0) {}
 
 AsClusterFatTree::~AsClusterFatTree() {
-  for (int i = 0 ; i < this->nodes.size() ; i++) {
+  for (unsigned int i = 0 ; i < this->nodes.size() ; i++) {
     delete this->nodes[i];
   }
 }
     delete this->nodes[i];
   }
 }
@@ -18,7 +18,7 @@ AsClusterFatTree::~AsClusterFatTree() {
 void AsClusterFatTree::getRouteAndLatency(RoutingEdgePtr src,
                                           RoutingEdgePtr dst,
                                           sg_platf_route_cbarg_t into,
 void AsClusterFatTree::getRouteAndLatency(RoutingEdgePtr src,
                                           RoutingEdgePtr dst,
                                           sg_platf_route_cbarg_t into,
-                                          double *latency) const{
+                                          double *latency) {
   // TODO
 }
 
   // TODO
 }
 
@@ -31,17 +31,17 @@ void AsClusterFatTree::create_links(sg_platf_cluster_cbarg_t cluster) {
     return;
   }
   this->nodesByLevel.resize(this->levels, 0);
     return;
   }
   this->nodesByLevel.resize(this->levels, 0);
-  int nodesRequired = 0;
+  unsigned int nodesRequired = 0;
 
 
 
 
-    for (int i = 0 ; i < this->levels ; i++) {
+    for (unsigned int i = 0 ; i < this->levels ; i++) {
       int nodesInThisLevel = 1;
       
       int nodesInThisLevel = 1;
       
-      for (int j = 0 ;  j < i ; j++) {
+      for (unsigned int j = 0 ;  j < i ; j++) {
         nodesInThisLevel *= this->upperLevelNodesNumber[j];
       }
       
         nodesInThisLevel *= this->upperLevelNodesNumber[j];
       }
       
-      for (int j = i+1 ; j < this->levels ; j++) {
+      for (unsigned int j = i+1 ; j < this->levels ; j++) {
         nodesInThisLevel *= this->lowerLevelNodesNumber[j];
       }
 
         nodesInThisLevel *= this->lowerLevelNodesNumber[j];
       }
 
@@ -58,8 +58,8 @@ void AsClusterFatTree::create_links(sg_platf_cluster_cbarg_t cluster) {
 
     // Nodes are totally ordered, by level and then by position, in this->nodes
     int k = 0;
 
     // Nodes are totally ordered, by level and then by position, in this->nodes
     int k = 0;
-    for (int i = 0 ; i < this->levels ; i++) {
-      for (int j = 0 ; j < this->nodesByLevel[i] ; j++) {
+    for (unsigned int i = 0 ; i < this->levels ; i++) {
+      for (unsigned int j = 0 ; j < this->nodesByLevel[i] ; j++) {
         this->nodes[k]->level = i;
         this->nodes[k]->position = j;
       }
         this->nodes[k]->level = i;
         this->nodes[k]->position = j;
       }
@@ -68,7 +68,7 @@ void AsClusterFatTree::create_links(sg_platf_cluster_cbarg_t cluster) {
     
 }
 
     
 }
 
-void AsClusterFatTree::getLevelPosition(const int level, int &position, int &size) {
+void AsClusterFatTree::getLevelPosition(const unsigned  int level, int &position, int &size) {
   if (level > this->levels - 1) {
     position = -1;
     size =  -1;
   if (level > this->levels - 1) {
     position = -1;
     size =  -1;
@@ -76,7 +76,7 @@ void AsClusterFatTree::getLevelPosition(const int level, int &position, int &siz
   }
   int tempPosition = 0;
 
   }
   int tempPosition = 0;
 
-  for (int i = 0 ; i < level ; i++) {
+  for (unsigned int i = 0 ; i < level ; i++) {
     tempPosition += this->nodesByLevel[i];
   }
   position = tempPosition;
     tempPosition += this->nodesByLevel[i];
   }
   position = tempPosition;
@@ -84,7 +84,7 @@ void AsClusterFatTree::getLevelPosition(const int level, int &position, int &siz
 }
 
 void AsClusterFatTree::addNodes(std::vector<int> const& id) {
 }
 
 void AsClusterFatTree::addNodes(std::vector<int> const& id) {
-  for (int i = 0 ; i < id.size() ; i++) {
+  for (unsigned int  i = 0 ; i < id.size() ; i++) {
     this->nodes.push_back(new FatTreeNode(id[i]));
   }
 }
     this->nodes.push_back(new FatTreeNode(id[i]));
   }
 }
index 1c39826..7aaf9b1 100644 (file)
@@ -53,7 +53,7 @@ public:
   ~AsClusterFatTree();
   virtual void getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst,
                                   sg_platf_route_cbarg_t into,
   ~AsClusterFatTree();
   virtual void getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst,
                                   sg_platf_route_cbarg_t into,
-                                  double *latency) const;
+                                  double *latency);
   // virtual void getRouteAndLatency(const int src, const int dst,
   //                                 std::vector<NetworkLink> *route,
   //                                 double *latency) const;
   // virtual void getRouteAndLatency(const int src, const int dst,
   //                                 std::vector<NetworkLink> *route,
   //                                 double *latency) const;
@@ -71,9 +71,9 @@ protected:
   
   std::vector<FatTreeNode*> nodes;
   std::map<std::pair<int,int>, FatTreeLink*> links;
   
   std::vector<FatTreeNode*> nodes;
   std::map<std::pair<int,int>, FatTreeLink*> links;
-  std::vector<int> nodesByLevel;
+  std::vector<unsigned int> nodesByLevel;
 
   void addLink(FatTreeNode *parent, FatTreeNode *child);
 
   void addLink(FatTreeNode *parent, FatTreeNode *child);
-  void getLevelPosition(const int level, int &position, int &size);
+  void getLevelPosition(const unsigned int level, int &position, int &size);
 };
 #endif
 };
 #endif