Commit 1a81c5fe authored by Tarun Prabhu's avatar Tarun Prabhu

Fixed minor type mismatches which were giving out warnings during make. I...

Fixed minor type mismatches which were giving out warnings during make. I don't think any were particularly harmful.
parent 2a174bdc
...@@ -710,7 +710,10 @@ bool populate_link (DOMElement* elt, ...@@ -710,7 +710,10 @@ bool populate_link (DOMElement* elt,
/* /*
* Pull the links from the vtop file, and populate assign's own data sturctures * Pull the links from the vtop file, and populate assign's own data sturctures
*/ */
bool populate_links(DOMElement *root, tb_vgraph &vg, map< pair<string, string>, pair<string, string> >* fixed_interfaces) { bool
populate_links(DOMElement *root,
tb_vgraph &vg,
map< pair<string, string>, pair<string, string> >*fixed_interfaces) {
bool is_ok = true; bool is_ok = true;
/* /*
...@@ -720,7 +723,7 @@ bool populate_links(DOMElement *root, tb_vgraph &vg, map< pair<string, string>, ...@@ -720,7 +723,7 @@ bool populate_links(DOMElement *root, tb_vgraph &vg, map< pair<string, string>,
DOMNodeList *links = root->getElementsByTagName(XStr("link").x()); DOMNodeList *links = root->getElementsByTagName(XStr("link").x());
int linkCount = links->getLength(); int linkCount = links->getLength();
XMLDEBUG("Found " << links->getLength() << " links in rspec" << endl); XMLDEBUG("Found " << links->getLength() << " links in rspec" << endl);
for (size_t i = 0; i < linkCount; i++) { for (int i = 0; i < linkCount; i++) {
DOMNode *link = links->item(i); DOMNode *link = links->item(i);
DOMElement *elt = dynamic_cast<DOMElement*>(link); DOMElement *elt = dynamic_cast<DOMElement*>(link);
is_ok &= populate_link(elt, vg, fixed_interfaces); is_ok &= populate_link(elt, vg, fixed_interfaces);
...@@ -742,7 +745,7 @@ bool populate_vclass (struct vclass vclass, tb_vgraph& vg) ...@@ -742,7 +745,7 @@ bool populate_vclass (struct vclass vclass, tb_vgraph& vg)
vclass_map[name] = v; vclass_map[name] = v;
} }
for (int i = 0; i < vclass.physicalTypes.size(); i++) { for (unsigned int i = 0; i < vclass.physicalTypes.size(); i++) {
fstring physType = XStr(vclass.physicalTypes[i].c_str()).f(); fstring physType = XStr(vclass.physicalTypes[i].c_str()).f();
v->add_type(physType); v->add_type(physType);
vclasses[name].push_back(physType); vclasses[name].push_back(physType);
...@@ -758,7 +761,7 @@ bool populate_vclasses (DOMElement* root, tb_vgraph& vg) ...@@ -758,7 +761,7 @@ bool populate_vclasses (DOMElement* root, tb_vgraph& vg)
bool isOk = true; bool isOk = true;
vector<struct vclass> vclasses = rspecParser->readVClasses(root); vector<struct vclass> vclasses = rspecParser->readVClasses(root);
cerr << "Found " << vclasses.size() << " vclasses." << endl; cerr << "Found " << vclasses.size() << " vclasses." << endl;
for (int i = 0; i < vclasses.size(); i++) { for (unsigned int i = 0; i < vclasses.size(); i++) {
isOk &= populate_vclass(vclasses[i], vg); isOk &= populate_vclass(vclasses[i], vg);
} }
return isOk; return isOk;
...@@ -777,7 +780,7 @@ DOMElement* appendChildTagWithData (DOMElement* parent, ...@@ -777,7 +780,7 @@ DOMElement* appendChildTagWithData (DOMElement* parent,
string generate_virtualNodeId (string virtual_id) string generate_virtualNodeId (string virtual_id)
{ {
std:ostringstream oss; std::ostringstream oss;
struct timeval tv; struct timeval tv;
struct timezone tz; struct timezone tz;
gettimeofday(&tv, &tz); gettimeofday(&tv, &tz);
...@@ -787,7 +790,7 @@ string generate_virtualNodeId (string virtual_id) ...@@ -787,7 +790,7 @@ string generate_virtualNodeId (string virtual_id)
string generate_virtualIfaceId (string lan_name, int interface_number) string generate_virtualIfaceId (string lan_name, int interface_number)
{ {
std:ostringstream oss; std::ostringstream oss;
oss << lan_name << ":" << interface_number; oss << lan_name << ":" << interface_number;
return oss.str(); return oss.str();
} }
......
...@@ -99,12 +99,11 @@ rspec_parser_v2 :: readLinkCharacteristics (const DOMElement* link, ...@@ -99,12 +99,11 @@ rspec_parser_v2 :: readLinkCharacteristics (const DOMElement* link,
bool hasBandwidth, hasLatency, hasPacketLoss; bool hasBandwidth, hasLatency, hasPacketLoss;
count = properties->getLength(); count = properties->getLength();
// if (count == 1) { // Read only from the first property and ignore the rest
DOMElement* property = dynamic_cast<DOMElement*>(properties->item(0)); DOMElement* property = dynamic_cast<DOMElement*>(properties->item(0));
strBw = this->getAttribute(property, "capacity", hasBandwidth); strBw = this->getAttribute(property, "capacity", hasBandwidth);
strLat = this->getAttribute(property, "latency", hasLatency); strLat = this->getAttribute(property, "latency", hasLatency);
strLoss = this->getAttribute(property, "packet_loss", hasPacketLoss); strLoss = this->getAttribute(property, "packet_loss", hasPacketLoss);
// }
int bandwidth = 0, latency = 0; int bandwidth = 0, latency = 0;
float packetLoss = 0.0; float packetLoss = 0.0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment