Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix -Wshorten-64-to-32 warning on Android NDK when targeting x86
stat.h defines struct stat to use long long on Android NDK when targeting x86; off_t however is defined as long, which is 32-bit (unlike other Unix-like platforms). This results in a narrowing conversion which produces a warning, and can also result in silently reading a prefix of a huge file instead of a clean "out of memory" error. There's no way for us to preserve the type exactly but always widening to long long should be safe; get_file_size will proceed to check if length actually fits into size_t which is what we ultimately need, and that overflow check will fail on files that are >4 GB in size.
- Loading branch information