SCI: Update formatting strings to match updated Span API

This commit is contained in:
Colin Snover 2017-03-30 14:02:27 -05:00
parent 993d83fe4b
commit a233696212
8 changed files with 18 additions and 18 deletions

View File

@ -954,7 +954,7 @@ bool Console::cmdResourceInfo(int argc, const char **argv) {
else {
Resource *resource = _engine->getResMan()->findResource(ResourceId(res, resNum), 0);
if (resource) {
debugPrintf("Resource size: %lu\n", resource->size());
debugPrintf("Resource size: %u\n", resource->size());
debugPrintf("Resource location: %s\n", resource->getResourceLocation().c_str());
} else {
debugPrintf("Resource %s.%03d not found\n", argv[1], resNum);
@ -1067,11 +1067,11 @@ bool Console::cmdVerifyScripts(int argc, const char **argv) {
debugPrintf("Error: script %d doesn't have a corresponding heap\n", itr->getNumber());
if (script && heap && (script->size() + heap->size() > 65535))
debugPrintf("Error: script and heap %d together are larger than 64KB (%lu bytes)\n",
debugPrintf("Error: script and heap %d together are larger than 64KB (%u bytes)\n",
itr->getNumber(), script->size() + heap->size());
} else { // SCI3
if (script && script->size() > 65535)
debugPrintf("Error: script %d is larger than 64KB (%lu bytes)\n",
debugPrintf("Error: script %d is larger than 64KB (%u bytes)\n",
itr->getNumber(), script->size());
}
}

View File

@ -82,7 +82,7 @@ public:
record.string = (const char *)_data.getUnsafeDataAt(stringOffset, maxSize);
record.length = Common::strnlen(record.string, maxSize);
if (record.length == maxSize) {
warning("Message %s from %s appears truncated at %ld", tuple.toString().c_str(), _data.name().c_str(), recordPtr - _data);
warning("Message %s from %s appears truncated at %d", tuple.toString().c_str(), _data.name().c_str(), recordPtr - _data);
}
return true;
}
@ -110,7 +110,7 @@ public:
record.string = (const char *)_data.getUnsafeDataAt(stringOffset, maxSize);
record.length = Common::strnlen(record.string, maxSize);
if (record.length == maxSize) {
warning("Message %s from %s appears truncated at %ld", tuple.toString().c_str(), _data.name().c_str(), recordPtr - _data);
warning("Message %s from %s appears truncated at %d", tuple.toString().c_str(), _data.name().c_str(), recordPtr - _data);
}
return true;
}
@ -138,7 +138,7 @@ public:
record.string = (const char *)_data.getUnsafeDataAt(stringOffset, maxSize);
record.length = Common::strnlen(record.string, maxSize);
if (record.length == maxSize) {
warning("Message %s from %s appears truncated at %ld", tuple.toString().c_str(), _data.name().c_str(), recordPtr - _data);
warning("Message %s from %s appears truncated at %d", tuple.toString().c_str(), _data.name().c_str(), recordPtr - _data);
}
return true;
}
@ -169,7 +169,7 @@ public:
record.string = (const char *)_data.getUnsafeDataAt(stringOffset, maxSize);
record.length = Common::strnlen(record.string, maxSize);
if (record.length == maxSize) {
warning("Message %s from %s appears truncated at %ld", tuple.toString().c_str(), _data.name().c_str(), recordPtr - _data);
warning("Message %s from %s appears truncated at %d", tuple.toString().c_str(), _data.name().c_str(), recordPtr - _data);
}
return true;
}

View File

@ -881,7 +881,7 @@ bool Script::isValidOffset(uint16 offset) const {
SegmentRef Script::dereference(reg_t pointer) {
if (pointer.getOffset() > _buf->size()) {
error("Script::dereference(): Attempt to dereference invalid pointer %04x:%04x into script segment (script size=%lu)",
error("Script::dereference(): Attempt to dereference invalid pointer %04x:%04x into script segment (script size=%u)",
PRINT_REG(pointer), _buf->size());
return SegmentRef();
}

View File

@ -151,7 +151,7 @@ void GfxPalette::createFromData(const SciSpan<const byte> &data, Palette *palett
if (data.size() < 37) {
// This happens when loading palette of picture 0 in sq5 - the resource is broken and doesn't contain a full
// palette
debugC(kDebugLevelResMan, "GfxPalette::createFromData() - not enough bytes in resource (%lu), expected palette header", data.size());
debugC(kDebugLevelResMan, "GfxPalette::createFromData() - not enough bytes in resource (%u), expected palette header", data.size());
return;
}

View File

@ -299,7 +299,7 @@ bool Vocabulary::loadAltInputs() {
uint32 maxSize = end - it;
uint32 l = Common::strnlen(t._input, maxSize);
if (l == maxSize) {
error("Alt input from %s appears truncated at %ld", resource->name().c_str(), it - resource->cbegin());
error("Alt input from %s appears truncated at %d", resource->name().c_str(), it - resource->cbegin());
}
t._inputLength = l;
it += l + 1;
@ -308,7 +308,7 @@ bool Vocabulary::loadAltInputs() {
maxSize = end - it;
l = Common::strnlen(t._replacement, maxSize);
if (l == maxSize) {
error("Alt input replacement from %s appears truncated at %ld", resource->name().c_str(), it - resource->cbegin());
error("Alt input replacement from %s appears truncated at %d", resource->name().c_str(), it - resource->cbegin());
}
it += l + 1;

View File

@ -309,7 +309,7 @@ bool Resource::loadPatch(Common::SeekableReadStream *file) {
_header = new byte[_headerSize];
if (data() == nullptr || (_headerSize > 0 && _header == nullptr)) {
error("Can't allocate %lu bytes needed for loading %s", size() + _headerSize, _id.toString().c_str());
error("Can't allocate %u bytes needed for loading %s", size() + _headerSize, _id.toString().c_str());
}
uint32 bytesRead;
@ -321,7 +321,7 @@ bool Resource::loadPatch(Common::SeekableReadStream *file) {
bytesRead = file->read(ptr, size());
if (bytesRead != size())
error("Read %d bytes from %s but expected %lu", bytesRead, _id.toString().c_str(), size());
error("Read %d bytes from %s but expected %u", bytesRead, _id.toString().c_str(), size());
_status = kResStatusAllocated;
return true;
@ -1028,7 +1028,7 @@ void ResourceManager::printLRU() {
while (it != _LRU.end()) {
res = *it;
debug("\t%s: %lu bytes", res->_id.toString().c_str(), res->size());
debug("\t%s: %u bytes", res->_id.toString().c_str(), res->size());
mem += res->size();
++entries;
++it;

View File

@ -85,7 +85,7 @@ bool Resource::loadFromWaveFile(Common::SeekableReadStream *file) {
uint32 bytesRead = file->read(ptr, _size);
if (bytesRead != _size)
error("Read %d bytes from %s but expected %lu", bytesRead, _id.toString().c_str(), _size);
error("Read %d bytes from %s but expected %u", bytesRead, _id.toString().c_str(), _size);
_status = kResStatusAllocated;
return true;
@ -139,12 +139,12 @@ bool Resource::loadFromAudioVolumeSCI1(Common::SeekableReadStream *file) {
_data = ptr;
if (!ptr) {
error("Can't allocate %lu bytes needed for loading %s", _size, _id.toString().c_str());
error("Can't allocate %u bytes needed for loading %s", _size, _id.toString().c_str());
}
uint32 bytesRead = file->read(ptr, size());
if (bytesRead != size())
warning("Read %d bytes from %s but expected %lu", bytesRead, _id.toString().c_str(), _size);
warning("Read %d bytes from %s but expected %u", bytesRead, _id.toString().c_str(), _size);
_status = kResStatusAllocated;
return true;

View File

@ -1025,7 +1025,7 @@ int MidiPlayer_Midi::open(ResourceManager *resMan) {
error("MT-32 patch has wrong type");
} else {
// Happens in the SCI3 interactive demo of Lighthouse
warning("TODO: Ignoring new SCI3 type of MT-32 patch for now (size = %lu)", res->size());
warning("TODO: Ignoring new SCI3 type of MT-32 patch for now (size = %u)", res->size());
}
}
} else {