Make all file access 64-bit
Created by: RandomShaper
DISCLAIMER:
This change is big and can break a lot of stuff. I'm marking it as [wip] until I have done everything needed I can think of.
Maybe it should go directly to 4.0.
UPDATE:
This changes a lot of types and may introduce bugs, but it shouldn't break compatibility. Maybe it's suitable for 3.2 or even 3.1.1?
This is all I can do so far on my side. Now I'm asking the community for testing and feedback.
UPDATE: As soon as I get the build checks to pass. :P CI checks passing!
UPDATE: Current commit message after modifications:
This changes the types of a big number of variables.
General rules:
- Using
int64_t
in general. With 64-bit we no longer need to use unsigned type. That matchesVariant
better and avoids akward casts. Checks for negative numbers are performed where they don't make sense (seek, read/write buffer size). - Previous point means no more
size_t
for file size/offsets. - Not worrying about
FileAccess::get_64/store_64
working with unsigneds. I haven't found any place where conversion to unsigned will cause trouble and saves us from having to addget/store_64_signed
or similar. - Using
int32_t
integers for concepts not needing such a huge range, like pages, blocks, etc.
In addition:
- Improve usage of integer types in some related places; namely,
DirAccess
, core binds. - The binding for
Directory::get_space_left()
tried to return the size in MiB, but the expression was missing parentheses, so the1024 * 1024
is removed and it keeps working as usual, returning bytes.
Fixes #27168.