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
This commit is contained in:
Thaer Razeq
2017-02-23 02:28:09 -06:00
committed by REBELLIOUSX\Rebel_X
parent 0f8c6dd382
commit f50488a361
32 changed files with 41 additions and 39 deletions

View File

@ -641,7 +641,6 @@ Error decode_variant(Variant& r_variant,const uint8_t *p_buffer, int p_len,int *
ERR_FAIL_COND_V(len<4,ERR_INVALID_DATA);
uint32_t count = decode_uint32(buf);
ERR_FAIL_COND_V(count<0,ERR_INVALID_DATA);
PoolVector<String> strings;
buf+=4;
@ -691,7 +690,6 @@ Error decode_variant(Variant& r_variant,const uint8_t *p_buffer, int p_len,int *
ERR_FAIL_COND_V(len<4,ERR_INVALID_DATA);
uint32_t count = decode_uint32(buf);
ERR_FAIL_COND_V(count<0,ERR_INVALID_DATA);
buf+=4;
len-=4;
@ -729,7 +727,6 @@ Error decode_variant(Variant& r_variant,const uint8_t *p_buffer, int p_len,int *
ERR_FAIL_COND_V(len<4,ERR_INVALID_DATA);
uint32_t count = decode_uint32(buf);
ERR_FAIL_COND_V(count<0,ERR_INVALID_DATA);
buf+=4;
len-=4;
@ -768,7 +765,6 @@ Error decode_variant(Variant& r_variant,const uint8_t *p_buffer, int p_len,int *
ERR_FAIL_COND_V(len<4,ERR_INVALID_DATA);
uint32_t count = decode_uint32(buf);
ERR_FAIL_COND_V(count<0,ERR_INVALID_DATA);
buf+=4;
len-=4;