diff options
author | Andreas Hansson <andreas.hansson@arm.com> | 2014-09-19 10:35:07 -0400 |
---|---|---|
committer | Andreas Hansson <andreas.hansson@arm.com> | 2014-09-19 10:35:07 -0400 |
commit | f615c4aeb097010eb782a1ee556f990b84757175 (patch) | |
tree | ada605ce248d17307def35b768bb8d55063d5ac0 /src/base | |
parent | 377f081251540e33743a8d8bc59d05e68d4e2782 (diff) | |
download | gem5-f615c4aeb097010eb782a1ee556f990b84757175.tar.xz |
misc: Remove assertions ensuring unsigned values >= 0
Diffstat (limited to 'src/base')
-rw-r--r-- | src/base/chunk_generator.hh | 1 | ||||
-rw-r--r-- | src/base/statistics.hh | 2 | ||||
-rw-r--r-- | src/base/vnc/vncserver.cc | 2 |
3 files changed, 2 insertions, 3 deletions
diff --git a/src/base/chunk_generator.hh b/src/base/chunk_generator.hh index bc71a0569..cf303f693 100644 --- a/src/base/chunk_generator.hh +++ b/src/base/chunk_generator.hh @@ -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; diff --git a/src/base/statistics.hh b/src/base/statistics.hh index 8d6644284..7e5f1f5b9 100644 --- a/src/base/statistics.hh +++ b/src/base/statistics.hh @@ -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; diff --git a/src/base/vnc/vncserver.cc b/src/base/vnc/vncserver.cc index d11308875..e762ad1d4 100644 --- a/src/base/vnc/vncserver.cc +++ b/src/base/vnc/vncserver.cc @@ -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); } |