diff options
Diffstat (limited to 'core/io')
-rw-r--r-- | core/io/file_access_buffered_fa.h | 20 | ||||
-rw-r--r-- | core/io/file_access_memory.cpp | 2 | ||||
-rw-r--r-- | core/io/file_access_pack.cpp | 14 | ||||
-rw-r--r-- | core/io/file_access_pack.h | 2 | ||||
-rw-r--r-- | core/io/ip.cpp | 2 | ||||
-rw-r--r-- | core/io/ip_address.cpp | 40 | ||||
-rw-r--r-- | core/io/json.cpp | 18 | ||||
-rw-r--r-- | core/io/marshalls.h | 2 | ||||
-rw-r--r-- | core/io/packet_peer.cpp | 4 | ||||
-rw-r--r-- | core/io/pck_packer.cpp | 32 | ||||
-rw-r--r-- | core/io/xml_parser.cpp | 6 | ||||
-rw-r--r-- | core/io/zip_io.cpp | 2 |
12 files changed, 72 insertions, 72 deletions
diff --git a/core/io/file_access_buffered_fa.h b/core/io/file_access_buffered_fa.h index 3ea98584a4..f22e54e154 100644 --- a/core/io/file_access_buffered_fa.h +++ b/core/io/file_access_buffered_fa.h @@ -58,35 +58,35 @@ class FileAccessBufferedFA : public FileAccessBuffered { f.get_buffer(cache.buffer.ptrw(), p_size); return p_size; - }; - }; + } + } static FileAccess *create() { return memnew(FileAccessBufferedFA<T>()); - }; + } protected: virtual void _set_access_type(AccessType p_access) { f._set_access_type(p_access); FileAccessBuffered::_set_access_type(p_access); - }; + } public: void flush() { f.flush(); - }; + } void store_8(uint8_t p_dest) { f.store_8(p_dest); - }; + } void store_buffer(const uint8_t *p_src, int p_length) { f.store_buffer(p_src, p_length); - }; + } bool file_exists(const String &p_name) { return f.file_exists(p_name); - }; + } Error _open(const String &p_path, int p_mode_flags) { close(); @@ -106,7 +106,7 @@ public: cache.offset = 0; return set_error(OK); - }; + } void close() { f.close(); @@ -119,7 +119,7 @@ public: cache.buffer.resize(0); cache.offset = 0; set_error(OK); - }; + } virtual uint64_t _get_modified_time(const String &p_file) { return f._get_modified_time(p_file); diff --git a/core/io/file_access_memory.cpp b/core/io/file_access_memory.cpp index 3c5f846941..a65ff92a89 100644 --- a/core/io/file_access_memory.cpp +++ b/core/io/file_access_memory.cpp @@ -145,7 +145,7 @@ int FileAccessMemory::get_buffer(uint8_t *p_dst, int p_length) const { if (read < p_length) { WARN_PRINT("Reading less data than requested"); - }; + } copymem(p_dst, &data[pos], read); pos += p_length; diff --git a/core/io/file_access_pack.cpp b/core/io/file_access_pack.cpp index 00c4e76efe..37240f234a 100644 --- a/core/io/file_access_pack.cpp +++ b/core/io/file_access_pack.cpp @@ -38,11 +38,11 @@ Error PackedData::add_pack(const String &p_path, bool p_replace_files) { for (int i = 0; i < sources.size(); i++) { if (sources[i]->try_open_pack(p_path, p_replace_files)) { return OK; - }; - }; + } + } return ERR_FILE_UNRECOGNIZED; -}; +} void PackedData::add_path(const String &pkg_path, const String &path, uint64_t ofs, uint64_t size, const uint8_t *p_md5, PackSource *p_src, bool p_replace_files) { PathMD5 pmd5(path.md5_buffer()); @@ -96,7 +96,7 @@ void PackedData::add_pack_source(PackSource *p_source) { if (p_source != nullptr) { sources.push_back(p_source); } -}; +} PackedData *PackedData::singleton = nullptr; @@ -192,16 +192,16 @@ bool PackedSourcePCK::try_open_pack(const String &p_path, bool p_replace_files) uint8_t md5[16]; f->get_buffer(md5, 16); PackedData::get_singleton()->add_path(p_path, path, ofs, size, md5, this, p_replace_files); - }; + } f->close(); memdelete(f); return true; -}; +} FileAccess *PackedSourcePCK::get_file(const String &p_path, PackedData::PackedFile *p_file) { return memnew(FileAccessPack(p_path, *p_file)); -}; +} ////////////////////////////////////////////////////////////////// diff --git a/core/io/file_access_pack.h b/core/io/file_access_pack.h index 320a6cb216..348bc0c450 100644 --- a/core/io/file_access_pack.h +++ b/core/io/file_access_pack.h @@ -79,7 +79,7 @@ private: bool operator==(const PathMD5 &p_md5) const { return a == p_md5.a && b == p_md5.b; - }; + } PathMD5() {} diff --git a/core/io/ip.cpp b/core/io/ip.cpp index 653959b393..24b8ec7cc1 100644 --- a/core/io/ip.cpp +++ b/core/io/ip.cpp @@ -54,7 +54,7 @@ struct _IP_ResolverPrivate { QueueItem() { clear(); - }; + } }; QueueItem queue[IP::RESOLVER_MAX_QUERIES]; diff --git a/core/io/ip_address.cpp b/core/io/ip_address.cpp index 89b317bf93..c7a0ae5605 100644 --- a/core/io/ip_address.cpp +++ b/core/io/ip_address.cpp @@ -58,7 +58,7 @@ IP_Address::operator String() const { } uint16_t num = (field8[i * 2] << 8) + field8[i * 2 + 1]; ret = ret + String::num_int64(num, 16); - }; + } return ret; } @@ -68,7 +68,7 @@ static void _parse_hex(const String &p_string, int p_start, uint8_t *p_dst) { for (int i = p_start; i < p_start + 4; i++) { if (i >= p_string.length()) { break; - }; + } int n = 0; CharType c = p_string[i]; @@ -82,14 +82,14 @@ static void _parse_hex(const String &p_string, int p_start, uint8_t *p_dst) { break; } else { ERR_FAIL_MSG("Invalid character in IPv6 address: " + p_string + "."); - }; + } ret = ret << 4; ret += n; - }; + } p_dst[0] = ret >> 8; p_dst[1] = ret & 0xff; -}; +} void IP_Address::_parse_ipv6(const String &p_string) { static const int parts_total = 8; @@ -105,11 +105,11 @@ void IP_Address::_parse_ipv6(const String &p_string) { if (c == ':') { if (i == 0) { continue; // next must be a ":" - }; + } if (!part_found) { part_skip = true; parts[parts_idx++] = -1; - }; + } part_found = false; } else if (c == '.') { part_ipv4 = true; @@ -119,33 +119,33 @@ void IP_Address::_parse_ipv6(const String &p_string) { parts[parts_idx++] = i; part_found = true; ++parts_count; - }; + } } else { ERR_FAIL_MSG("Invalid character in IPv6 address: " + p_string + "."); - }; - }; + } + } int parts_extra = 0; if (part_skip) { parts_extra = parts_total - parts_count; - }; + } int idx = 0; for (int i = 0; i < parts_idx; i++) { if (parts[i] == -1) { for (int j = 0; j < parts_extra; j++) { field16[idx++] = 0; - }; + } continue; - }; + } if (part_ipv4 && i == parts_idx - 1) { _parse_ipv4(p_string, parts[i], (uint8_t *)&field16[idx]); // should be the last one } else { _parse_hex(p_string, parts[i], (uint8_t *)&(field16[idx++])); - }; - }; -}; + } + } +} void IP_Address::_parse_ipv4(const String &p_string, int p_start, uint8_t *p_ret) { String ip; @@ -153,20 +153,20 @@ void IP_Address::_parse_ipv4(const String &p_string, int p_start, uint8_t *p_ret ip = p_string.substr(p_start, p_string.length() - p_start); } else { ip = p_string; - }; + } int slices = ip.get_slice_count("."); ERR_FAIL_COND_MSG(slices != 4, "Invalid IP address string: " + ip + "."); for (int i = 0; i < 4; i++) { p_ret[i] = ip.get_slicec('.', i).to_int(); } -}; +} void IP_Address::clear() { memset(&field8[0], 0, sizeof(field8)); valid = false; wildcard = false; -}; +} bool IP_Address::is_ipv4() const { return (field32[0] == 0 && field32[1] == 0 && field16[4] == 0 && field16[5] == 0xffff); @@ -224,7 +224,7 @@ _FORCE_INLINE_ static void _32_to_buf(uint8_t *p_dst, uint32_t p_n) { p_dst[1] = (p_n >> 16) & 0xff; p_dst[2] = (p_n >> 8) & 0xff; p_dst[3] = (p_n >> 0) & 0xff; -}; +} IP_Address::IP_Address(uint32_t p_a, uint32_t p_b, uint32_t p_c, uint32_t p_d, bool is_v6) { clear(); diff --git a/core/io/json.cpp b/core/io/json.cpp index 03f4e65220..1c603865ad 100644 --- a/core/io/json.cpp +++ b/core/io/json.cpp @@ -91,7 +91,7 @@ String JSON::_print_var(const Variant &p_var, const String &p_indent, int p_cur_ } s += end_statement + _make_indent(p_indent, p_cur_indent) + "]"; return s; - }; + } case Variant::DICTIONARY: { String s = "{"; s += end_statement; @@ -115,7 +115,7 @@ String JSON::_print_var(const Variant &p_var, const String &p_indent, int p_cur_ s += end_statement + _make_indent(p_indent, p_cur_indent) + "}"; return s; - }; + } default: return "\"" + String(p_var).json_escape() + "\""; } @@ -132,7 +132,7 @@ Error JSON::_get_token(const CharType *p_str, int &index, int p_len, Token &r_to line++; index++; break; - }; + } case 0: { r_token.type = TK_EOF; return OK; @@ -141,32 +141,32 @@ Error JSON::_get_token(const CharType *p_str, int &index, int p_len, Token &r_to r_token.type = TK_CURLY_BRACKET_OPEN; index++; return OK; - }; + } case '}': { r_token.type = TK_CURLY_BRACKET_CLOSE; index++; return OK; - }; + } case '[': { r_token.type = TK_BRACKET_OPEN; index++; return OK; - }; + } case ']': { r_token.type = TK_BRACKET_CLOSE; index++; return OK; - }; + } case ':': { r_token.type = TK_COLON; index++; return OK; - }; + } case ',': { r_token.type = TK_COMMA; index++; return OK; - }; + } case '"': { index++; String str; diff --git a/core/io/marshalls.h b/core/io/marshalls.h index c21a97ac8a..c8ed497528 100644 --- a/core/io/marshalls.h +++ b/core/io/marshalls.h @@ -106,7 +106,7 @@ static inline int encode_cstring(const char *p_string, uint8_t *p_data) { } p_string++; len++; - }; + } if (p_data) { *p_data = 0; diff --git a/core/io/packet_peer.cpp b/core/io/packet_peer.cpp index 6d37d95994..dacd548a3e 100644 --- a/core/io/packet_peer.cpp +++ b/core/io/packet_peer.cpp @@ -147,7 +147,7 @@ void PacketPeer::_bind_methods() { ClassDB::bind_method(D_METHOD("set_encode_buffer_max_size", "max_size"), &PacketPeer::set_encode_buffer_max_size); ADD_PROPERTY(PropertyInfo(Variant::INT, "encode_buffer_max_size"), "set_encode_buffer_max_size", "get_encode_buffer_max_size"); -}; +} /***************/ @@ -267,7 +267,7 @@ void PacketPeerStream::set_stream_peer(const Ref<StreamPeer> &p_peer) { if (p_peer.ptr() != peer.ptr()) { ring_buffer.advance_read(ring_buffer.data_left()); // reset the ring buffer - }; + } peer = p_peer; } diff --git a/core/io/pck_packer.cpp b/core/io/pck_packer.cpp index 06d22ce897..374b2a5e07 100644 --- a/core/io/pck_packer.cpp +++ b/core/io/pck_packer.cpp @@ -45,19 +45,19 @@ static uint64_t _align(uint64_t p_n, int p_alignment) { } else { return p_n + (p_alignment - rest); } -}; +} static void _pad(FileAccess *p_file, int p_bytes) { for (int i = 0; i < p_bytes; i++) { p_file->store_8(0); - }; -}; + } +} void PCKPacker::_bind_methods() { ClassDB::bind_method(D_METHOD("pck_start", "pck_name", "alignment"), &PCKPacker::pck_start, DEFVAL(0)); ClassDB::bind_method(D_METHOD("add_file", "pck_path", "source_path"), &PCKPacker::add_file); ClassDB::bind_method(D_METHOD("flush", "verbose"), &PCKPacker::flush, DEFVAL(false)); -}; +} Error PCKPacker::pck_start(const String &p_file, int p_alignment) { if (file != nullptr) { @@ -78,18 +78,18 @@ Error PCKPacker::pck_start(const String &p_file, int p_alignment) { for (int i = 0; i < 16; i++) { file->store_32(0); // reserved - }; + } files.clear(); return OK; -}; +} Error PCKPacker::add_file(const String &p_file, const String &p_src) { FileAccess *f = FileAccess::open(p_src, FileAccess::READ); if (!f) { return ERR_FILE_CANT_OPEN; - }; + } File pf; pf.path = p_file; @@ -103,7 +103,7 @@ Error PCKPacker::add_file(const String &p_file, const String &p_src) { memdelete(f); return OK; -}; +} Error PCKPacker::flush(bool p_verbose) { ERR_FAIL_COND_V_MSG(!file, ERR_INVALID_PARAMETER, "File must be opened before use."); @@ -123,7 +123,7 @@ Error PCKPacker::flush(bool p_verbose) { file->store_32(0); file->store_32(0); file->store_32(0); - }; + } uint64_t ofs = file->get_position(); ofs = _align(ofs, alignment); @@ -141,7 +141,7 @@ Error PCKPacker::flush(bool p_verbose) { int read = src->get_buffer(buf, MIN(to_write, buf_max)); file->store_buffer(buf, read); to_write -= read; - }; + } uint64_t pos = file->get_position(); file->seek(files[i].offset_offset); // go back to store the file's offset @@ -158,9 +158,9 @@ Error PCKPacker::flush(bool p_verbose) { if (count % 100 == 0) { printf("%i/%i (%.2f)\r", count, files.size(), float(count) / files.size() * 100); fflush(stdout); - }; - }; - }; + } + } + } if (p_verbose) { printf("\n"); @@ -170,11 +170,11 @@ Error PCKPacker::flush(bool p_verbose) { memdelete_arr(buf); return OK; -}; +} PCKPacker::~PCKPacker() { if (file != nullptr) { memdelete(file); - }; + } file = nullptr; -}; +} diff --git a/core/io/xml_parser.cpp b/core/io/xml_parser.cpp index 11f82fef9d..b11267b60f 100644 --- a/core/io/xml_parser.cpp +++ b/core/io/xml_parser.cpp @@ -361,7 +361,7 @@ void XMLParser::_parse_current_node() { uint64_t XMLParser::get_node_offset() const { return node_offset; -}; +} Error XMLParser::seek(uint64_t p_pos) { ERR_FAIL_COND_V(!data, ERR_FILE_EOF); @@ -370,7 +370,7 @@ Error XMLParser::seek(uint64_t p_pos) { P = data + p_pos; return read(); -}; +} void XMLParser::_bind_methods() { ClassDB::bind_method(D_METHOD("read"), &XMLParser::read); @@ -398,7 +398,7 @@ void XMLParser::_bind_methods() { BIND_ENUM_CONSTANT(NODE_COMMENT); BIND_ENUM_CONSTANT(NODE_CDATA); BIND_ENUM_CONSTANT(NODE_UNKNOWN); -}; +} Error XMLParser::read() { // if not end reached, parse the node diff --git a/core/io/zip_io.cpp b/core/io/zip_io.cpp index 1979e91b8c..b8e7fd34d0 100644 --- a/core/io/zip_io.cpp +++ b/core/io/zip_io.cpp @@ -80,7 +80,7 @@ long zipio_seek(voidpf opaque, voidpf stream, uLong offset, int origin) { break; default: break; - }; + } f->seek(pos); return 0; |