misc: Remove assertions ensuring unsigned values >= 0
authorAndreas Hansson <andreas.hansson@arm.com>
Fri, 19 Sep 2014 14:35:07 +0000 (10:35 -0400)
committerAndreas Hansson <andreas.hansson@arm.com>
Fri, 19 Sep 2014 14:35:07 +0000 (10:35 -0400)
src/base/chunk_generator.hh
src/base/statistics.hh
src/base/vnc/vncserver.cc
src/mem/cache/tags/base_set_assoc.cc

index bc71a0569c0b574e63ef79170f6dd74f69492043..cf303f693dc1c2b21b5e9dceeeb7e4f236734acb 100644 (file)
@@ -83,7 +83,6 @@ class ChunkGenerator
     {
         // chunkSize must be a power of two
         assert(chunkSize == 0 || isPowerOf2(chunkSize));
-        assert(totalSize >= 0);
 
         // set up initial chunk.
         curAddr = startAddr;
index 8d6644284001b9a70615790be1be90af8912dfb4..7e5f1f5b9acffd9e2625be3296d14a98737f4b84 100644 (file)
@@ -1567,7 +1567,7 @@ class HistStor
         size_type index =
             (int64_t)std::floor((val - min_bucket) / bucket_size);
 
-        assert(index >= 0 && index < size());
+        assert(index < size());
         cvec[index] += number;
 
         sum += val * number;
index d1130887573ac755b2370f4e50471ff0ad23d453..e762ad1d40b3e848c0ae7a88eb004df4ede303a1 100644 (file)
@@ -593,8 +593,8 @@ VncServer::recvCutText()
         size_t bytes_to_read = data_len > 1024 ? 1024 : data_len;
         len = read((uint8_t*)&str, bytes_to_read);
         str[bytes_to_read] = 0;
+        assert(len >= data_len);
         data_len -= len;
-        assert(data_len >= 0);
         DPRINTF(VNC, "Buffer: %s\n", str);
     }
 
index 0d955255a94eafe8a6a617c85055cad6ad491ce6..bb0c20141e5398141d18c6a0edd82dec00233f01 100644 (file)
@@ -181,8 +181,8 @@ BaseSetAssoc::computeStats()
         if (blks[i].isValid()) {
             assert(blks[i].task_id < ContextSwitchTaskId::NumTaskId);
             occupanciesTaskId[blks[i].task_id]++;
+            assert(blks[i].tickInserted <= curTick());
             Tick age = curTick() - blks[i].tickInserted;
-            assert(age >= 0);
 
             int age_index;
             if (age / SimClock::Int::us < 10) { // <10us