diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2020-12-08 20:58:49 +0200 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2020-12-09 10:17:53 +0200 |
commit | 644f73966002589c36d779fa33b9524a451f56e0 (patch) | |
tree | 58b5f8b90e48771dd211a39a8aeba231d6483475 /core/io | |
parent | 90bdba576af2d5f0a8ecdbef065d6ef0075bc2f2 (diff) |
Static analyzer fixes:
Removes unused code in OS.
Fixes return types.
Fixes few typos.
Diffstat (limited to 'core/io')
-rw-r--r-- | core/io/compression.cpp | 4 | ||||
-rw-r--r-- | core/io/file_access_zip.h | 2 | ||||
-rw-r--r-- | core/io/marshalls.cpp | 5 |
3 files changed, 3 insertions, 8 deletions
diff --git a/core/io/compression.cpp b/core/io/compression.cpp index cd8793bb0a..8e613cb3ce 100644 --- a/core/io/compression.cpp +++ b/core/io/compression.cpp @@ -257,13 +257,13 @@ int Compression::decompress_dynamic(Vector<uint8_t> *p_dst_vect, int p_max_dst_s } while (ret != Z_STREAM_END); // If all done successfully, resize the output if it's larger than the actual output - if (ret == Z_STREAM_END && (unsigned long)p_dst_vect->size() > strm.total_out) { + if ((unsigned long)p_dst_vect->size() > strm.total_out) { p_dst_vect->resize(strm.total_out); } // clean up and return (void)inflateEnd(&strm); - return ret == Z_STREAM_END ? Z_OK : Z_DATA_ERROR; + return Z_OK; } int Compression::zlib_level = Z_DEFAULT_COMPRESSION; diff --git a/core/io/file_access_zip.h b/core/io/file_access_zip.h index eff07c60e2..f8e7c1e587 100644 --- a/core/io/file_access_zip.h +++ b/core/io/file_access_zip.h @@ -59,8 +59,6 @@ private: static ZipArchive *instance; - FileAccess::CreateFunc fa_create_func; - public: void close_handle(unzFile p_file) const; unzFile get_file_handle(String p_file) const; diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp index 3cf4acaf39..db12fcb7f7 100644 --- a/core/io/marshalls.cpp +++ b/core/io/marshalls.cpp @@ -1003,10 +1003,7 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo } } break; - case Variant::STRING: { - _encode_string(p_variant, buf, r_len); - - } break; + case Variant::STRING: case Variant::STRING_NAME: { _encode_string(p_variant, buf, r_len); |