When nesting if statements, use braces to avoid ambiguous else clauses.
authorNathan Binkert <nate@binkert.org>
Fri, 26 Sep 2008 15:18:57 +0000 (08:18 -0700)
committerNathan Binkert <nate@binkert.org>
Fri, 26 Sep 2008 15:18:57 +0000 (08:18 -0700)
src/arch/sparc/tlb_map.hh
src/mem/bridge.cc

index 8285db939457e033fb3e1ad39a8a453bbdced795..fa49584ba5ec41aac8627717b911e50751fe0885 100644 (file)
@@ -52,7 +52,7 @@ class TlbMap
 
         i = tree.upper_bound(r);
 
-        if (i == tree.begin())
+        if (i == tree.begin()) {
             if (r.real == i->first.real &&
                 r.partitionId == i->first.partitionId &&
                 i->first.va < r.va + r.size &&
@@ -62,6 +62,7 @@ class TlbMap
             else
                 // Nothing could match, so return end()
                 return tree.end();
+        }
 
         i--;
 
index c09cacc00c78e9247539253b5715951923ea36b7..2e668ec3279169e26598761e70f31e646a766a10 100644 (file)
@@ -130,7 +130,7 @@ Bridge::BridgePort::recvTiming(PacketPtr pkt)
         return true;
     }
 
-    if (pkt->needsResponse())
+    if (pkt->needsResponse()) {
         if (respQueueFull()) {
             DPRINTF(BusBridge, "Local queue full, no space for response, nacking\n");
             DPRINTF(BusBridge, "queue size: %d outreq: %d outstanding resp: %d\n",
@@ -141,6 +141,7 @@ Bridge::BridgePort::recvTiming(PacketPtr pkt)
             DPRINTF(BusBridge, "Request Needs response, reserving space\n");
             ++outstandingResponses;
         }
+    }
 
     otherPort->queueForSendTiming(pkt);