summaryrefslogtreecommitdiff
path: root/editor/editor_export.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-05-17 16:02:12 +0200
committerGitHub <noreply@github.com>2021-05-17 16:02:12 +0200
commitb0a51bf9fe6b35cf4e2a76ec067d76349ca9b75c (patch)
tree905b5c483a9dab81bc19fbfe9893e17f02506720 /editor/editor_export.cpp
parent45e0f9fd523cb861b8e432966577d7c4608564ad (diff)
parent469fa47e0646d8f2ca3237dede8a04568039c7c6 (diff)
Merge pull request #48768 from akien-mga/file-access-64-bit-4.0
Make all file access 64-bit (`uint64_t`)
Diffstat (limited to 'editor/editor_export.cpp')
-rw-r--r--editor/editor_export.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp
index a368a9618e..b3755bef80 100644
--- a/editor/editor_export.cpp
+++ b/editor/editor_export.cpp
@@ -1222,12 +1222,12 @@ Error EditorExportPlatform::save_pack(const Ref<EditorExportPreset> &p_preset, c
}
for (int i = 0; i < pd.file_ofs.size(); i++) {
- int string_len = pd.file_ofs[i].path_utf8.length();
- int pad = _get_pad(4, string_len);
+ uint32_t string_len = pd.file_ofs[i].path_utf8.length();
+ uint32_t pad = _get_pad(4, string_len);
fhead->store_32(string_len + pad);
fhead->store_buffer((const uint8_t *)pd.file_ofs[i].path_utf8.get_data(), string_len);
- for (int j = 0; j < pad; j++) {
+ for (uint32_t j = 0; j < pad; j++) {
fhead->store_8(0);
}
@@ -1269,8 +1269,8 @@ Error EditorExportPlatform::save_pack(const Ref<EditorExportPreset> &p_preset, c
uint8_t buf[bufsize];
while (true) {
- int got = ftmp->get_buffer(buf, bufsize);
- if (got <= 0) {
+ uint64_t got = ftmp->get_buffer(buf, bufsize);
+ if (got == 0) {
break;
}
f->store_buffer(buf, got);
@@ -1280,13 +1280,13 @@ Error EditorExportPlatform::save_pack(const Ref<EditorExportPreset> &p_preset, c
if (p_embed) {
// Ensure embedded data ends at a 64-bit multiple
- int64_t embed_end = f->get_position() - embed_pos + 12;
- int pad = embed_end % 8;
- for (int i = 0; i < pad; i++) {
+ uint64_t embed_end = f->get_position() - embed_pos + 12;
+ uint64_t pad = embed_end % 8;
+ for (uint64_t i = 0; i < pad; i++) {
f->store_8(0);
}
- int64_t pck_size = f->get_position() - pck_start_pos;
+ uint64_t pck_size = f->get_position() - pck_start_pos;
f->store_64(pck_size);
f->store_32(PACK_HEADER_MAGIC);