This patch fixes a build error in networktest.cc that occurs with gcc4.2
authorTushar Krishna <tushar@csail.mit.edu>
Wed, 23 Mar 2011 03:38:09 +0000 (23:38 -0400)
committerTushar Krishna <tushar@csail.mit.edu>
Wed, 23 Mar 2011 03:38:09 +0000 (23:38 -0400)
src/cpu/testers/networktest/networktest.cc

index 4f4c30931bb3a2595628463abe6cbc94d592a690..73d9364b79c42c08930db97afd85c52c1c4ff97f 100644 (file)
@@ -165,7 +165,7 @@ NetworkTest::completeRequest(PacketPtr pkt)
 
     assert(pkt->isResponse());
     noResponseCycles = 0;
-    delete pkt->req;
+    delete req;
     delete pkt;
 }
 
@@ -191,8 +191,8 @@ NetworkTest::tick()
     // - generate a random number between 0 and 10^precision
     // - send pkt if this number is < injRate*(10^precision)
     bool send_this_cycle;
-    int injRange = pow(10, precision);
-    unsigned trySending = random() % injRange;
+    double injRange = pow((double) 10, (double) precision);
+    unsigned trySending = random() % (int) injRange;
     if (trySending < injRate*injRange)
         send_this_cycle = true;
     else