Saveload: Fix return type of SlReadUint16

This commit is contained in:
Jonathan G Rennison 2024-08-08 20:28:00 +01:00
parent 89d2cf3a16
commit cef83e30b5
3 changed files with 4 additions and 4 deletions

View File

@ -1067,7 +1067,7 @@ void SlSaveLoadRef(void *ptr, VarType conv)
break;
case SLA_LOAD_CHECK:
case SLA_LOAD:
*(size_t *)ptr = IsSavegameVersionBefore(SLV_69) ? SlReadUint16() : SlReadUint32();
*(size_t *)ptr = IsSavegameVersionBefore(SLV_69) ? (size_t)SlReadUint16() : SlReadUint32();
break;
case SLA_PTRS:
*(void **)ptr = IntToReference(*(size_t *)ptr, (SLRefType)conv);

View File

@ -611,7 +611,7 @@ void SlSkipBytes(size_t length)
return _sl.reader->SkipBytes(length);
}
int SlReadUint16()
uint16_t SlReadUint16()
{
_sl.reader->CheckBytes(2);
return _sl.reader->RawReadUint16();
@ -1533,7 +1533,7 @@ void SlSaveLoadRef(void *ptr, VarType conv)
break;
case SLA_LOAD_CHECK:
case SLA_LOAD:
*(size_t *)ptr = IsSavegameVersionBefore(SLV_69) ? SlReadUint16() : SlReadUint32();
*(size_t *)ptr = IsSavegameVersionBefore(SLV_69) ? (size_t)SlReadUint16() : SlReadUint32();
break;
case SLA_PTRS:
*(void **)ptr = IntToReference(*(size_t *)ptr, (SLRefType)conv);

View File

@ -423,7 +423,7 @@ enum SaveLoadVersion : uint16_t {
uint8_t SlReadByte();
void SlWriteByte(uint8_t b);
int SlReadUint16();
uint16_t SlReadUint16();
uint32_t SlReadUint32();
uint64_t SlReadUint64();