diff options
author | eray orçunus <erayorcunus@gmail.com> | 2020-07-22 13:56:28 +0200 |
---|---|---|
committer | eray orçunus <erayorcunus@gmail.com> | 2020-07-22 17:51:28 +0200 |
commit | 1dc6fbda1fbd9a731eb20b3ef71c3dda989e511e (patch) | |
tree | 5578c27b5739341d34def86586a68f1f1129e1bb /src/text/Text.cpp | |
parent | README 64-bit preparation (diff) | |
download | re3-1dc6fbda1fbd9a731eb20b3ef71c3dda989e511e.tar re3-1dc6fbda1fbd9a731eb20b3ef71c3dda989e511e.tar.gz re3-1dc6fbda1fbd9a731eb20b3ef71c3dda989e511e.tar.bz2 re3-1dc6fbda1fbd9a731eb20b3ef71c3dda989e511e.tar.lz re3-1dc6fbda1fbd9a731eb20b3ef71c3dda989e511e.tar.xz re3-1dc6fbda1fbd9a731eb20b3ef71c3dda989e511e.tar.zst re3-1dc6fbda1fbd9a731eb20b3ef71c3dda989e511e.zip |
Diffstat (limited to '')
-rw-r--r-- | src/text/Text.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/text/Text.cpp b/src/text/Text.cpp index c9e22a84..1f6cda89 100644 --- a/src/text/Text.cpp +++ b/src/text/Text.cpp @@ -23,8 +23,8 @@ CText::Load(void) { uint8 *filedata; char filename[32], type[4]; - int length; - int offset, sectlen; + intptr_t offset, length; + size_t sectlen; Unload(); filedata = new uint8[0x40000]; @@ -176,12 +176,13 @@ CText::UpperCase(wchar *s) void -CKeyArray::Load(uint32 length, uint8 *data, int *offset) +CKeyArray::Load(size_t length, uint8 *data, intptr_t *offset) { - uint32 i; + size_t i; uint8 *rawbytes; - numEntries = length / sizeof(CKeyEntry); + // You can make numEntries size_t if you want to exceed 32-bit boundaries, everything else should be ready. + numEntries = (int)(length / sizeof(CKeyEntry)); entries = new CKeyEntry[numEntries]; rawbytes = (uint8*)entries; @@ -255,12 +256,13 @@ CKeyArray::Search(const char *key) void -CData::Load(uint32 length, uint8 *data, int *offset) +CData::Load(size_t length, uint8 *data, intptr_t *offset) { - uint32 i; + size_t i; uint8 *rawbytes; - numChars = length / sizeof(wchar); + // You can make numChars size_t if you want to exceed 32-bit boundaries, everything else should be ready. + numChars = (int)(length / sizeof(wchar)); chars = new wchar[numChars]; rawbytes = (uint8*)chars; |