diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/io/http_client.cpp | 2 | ||||
-rw-r--r-- | core/io/marshalls.cpp | 4 | ||||
-rw-r--r-- | core/io/stream_peer.cpp | 2 | ||||
-rw-r--r-- | core/pool_allocator.cpp | 4 | ||||
-rw-r--r-- | core/variant.cpp | 4 | ||||
-rw-r--r-- | core/variant_op.cpp | 4 | ||||
-rw-r--r-- | core/variant_parser.cpp | 2 |
7 files changed, 10 insertions, 12 deletions
diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp index 5c54f16f13..ae14f8fa38 100644 --- a/core/io/http_client.cpp +++ b/core/io/http_client.cpp @@ -340,7 +340,7 @@ Error HTTPClient::poll(){ int rs = response_str.size(); if ( (rs>=2 && response_str[rs-2]=='\n' && response_str[rs-1]=='\n') || - (rs>=4 && response_str[rs-4]=='\r' && response_str[rs-3]=='\n' && rs>=4 && response_str[rs-2]=='\r' && response_str[rs-1]=='\n') + (rs>=4 && response_str[rs-4]=='\r' && response_str[rs-3]=='\n' && response_str[rs-2]=='\r' && response_str[rs-1]=='\n') ) { diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp index e958edc93e..a8c1cd0a10 100644 --- a/core/io/marshalls.cpp +++ b/core/io/marshalls.cpp @@ -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; diff --git a/core/io/stream_peer.cpp b/core/io/stream_peer.cpp index a64ebf21fb..3c4719269f 100644 --- a/core/io/stream_peer.cpp +++ b/core/io/stream_peer.cpp @@ -492,6 +492,8 @@ Error StreamPeerBuffer::get_partial_data(uint8_t* p_buffer, int p_bytes,int &r_r PoolVector<uint8_t>::Read r = data.read(); copymem(p_buffer,r.ptr(),r_received); + + // FIXME: return what? OK or ERR_* } int StreamPeerBuffer::get_available_bytes() const { 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"); diff --git a/core/variant.cpp b/core/variant.cpp index 132d7a1c88..f45c3fd55d 100644 --- a/core/variant.cpp +++ b/core/variant.cpp @@ -2953,7 +2953,7 @@ uint32_t Variant::hash() const { PoolVector<p_type>::Read rr = r.read(); \ \ for(int i = 0; i < l.size(); ++i) { \ - if(! p_compare_func((lr[0]), (rr[0]))) \ + if(! p_compare_func((lr[i]), (rr[i]))) \ return false; \ }\ \ @@ -3065,7 +3065,7 @@ bool Variant::hash_compare(const Variant& p_variant) const { return false; for(int i = 0; i < l.size(); ++i) { - if(! l[0].hash_compare(r[0])) + if(! l[i].hash_compare(r[i])) return false; } diff --git a/core/variant_op.cpp b/core/variant_op.cpp index 6ed8a3dd85..28e804b5bf 100644 --- a/core/variant_op.cpp +++ b/core/variant_op.cpp @@ -1393,7 +1393,7 @@ void Variant::set(const Variant& p_index, const Variant& p_value, bool *r_valid) v->basis.set_axis(index,p_value); return; } - } if (p_index.get_type()==Variant::STRING) { + } else if (p_index.get_type()==Variant::STRING) { Transform *v=_data._transform; const String *str=reinterpret_cast<const String*>(p_index._data._mem); @@ -2150,7 +2150,7 @@ Variant Variant::get(const Variant& p_index, bool *r_valid) const { valid=true; return index==3?v->origin:v->basis.get_axis(index); } - } if (p_index.get_type()==Variant::STRING) { + } else if (p_index.get_type()==Variant::STRING) { const Transform *v=_data._transform; const String *str=reinterpret_cast<const String*>(p_index._data._mem); diff --git a/core/variant_parser.cpp b/core/variant_parser.cpp index 3507501f27..a2ecb1516d 100644 --- a/core/variant_parser.cpp +++ b/core/variant_parser.cpp @@ -1414,7 +1414,7 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in return OK; } else if (id=="img") { // compatibility with godot.cfg - Token token; + Token token; // FIXME: no need for this declaration? the first argument in line 509 is a Token& token. get_token(p_stream,token,line,r_err_str); if (token.type!=TK_PARENTHESIS_OPEN) { r_err_str="Expected '(' in old-style godot.cfg construct"; |