summaryrefslogtreecommitdiffstats
path: root/core/pool_allocator.cpp
diff options
context:
space:
mode:
authorThaer Razeq <RebelliousX@gmail.com>2017-02-23 02:28:09 -0600
committerREBELLIOUSX\Rebel_X <RebelliousX@gmail.com>2017-02-28 07:52:02 -0600
commitf50488a36188d5975bfa8554687a1acdd394d6a9 (patch)
tree3b8712b9162aeb30e8eaaeeca63e6d04c7b9e3b5 /core/pool_allocator.cpp
parent0f8c6dd3822c38b8145f08265abb9eba479f4d15 (diff)
downloadredot-engine-f50488a36188d5975bfa8554687a1acdd394d6a9.tar.gz
Various fixes detected using PVS-Studio static analyzer.
- Add FIXME tags comments to some unfixed potential bugs - Remove some checks (always false: unsigned never < 0) - Fix some if statements based on reviews. - Bunch of missing `else` statements
Diffstat (limited to 'core/pool_allocator.cpp')
-rw-r--r--core/pool_allocator.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/pool_allocator.cpp b/core/pool_allocator.cpp
index b1417dd107..3260225ac3 100644
--- a/core/pool_allocator.cpp
+++ b/core/pool_allocator.cpp
@@ -504,7 +504,7 @@ const void *PoolAllocator::get(ID p_mem) const {
return NULL;
}
- if (e->pos<0 || (int)e->pos>=pool_size) {
+ if ((int)e->pos>=pool_size) {
mt_unlock();
ERR_PRINT("e->pos<0 || e->pos>=pool_size");
@@ -546,7 +546,7 @@ void *PoolAllocator::get(ID p_mem) {
return NULL;
}
- if (e->pos<0 || (int)e->pos>=pool_size) {
+ if ((int)e->pos>=pool_size) {
mt_unlock();
ERR_PRINT("e->pos<0 || e->pos>=pool_size");