diff options
author | Max Horn | 2010-05-26 18:11:17 +0000 |
---|---|---|
committer | Max Horn | 2010-05-26 18:11:17 +0000 |
commit | db475d1501452490ab4e95ecbd181380b0bec414 (patch) | |
tree | 20414325b386c5f97368074ce094becc93f3ed05 /engines/sci/engine/segment.cpp | |
parent | 2fa8ac0575e45ddfee96e3cd1eba2f2d9c3d2db3 (diff) | |
download | scummvm-rg350-db475d1501452490ab4e95ecbd181380b0bec414.tar.gz scummvm-rg350-db475d1501452490ab4e95ecbd181380b0bec414.tar.bz2 scummvm-rg350-db475d1501452490ab4e95ecbd181380b0bec414.zip |
SCI: More const related changes; remove unnecessary casts which hide const issues
svn-id: r49248
Diffstat (limited to 'engines/sci/engine/segment.cpp')
-rw-r--r-- | engines/sci/engine/segment.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/engines/sci/engine/segment.cpp b/engines/sci/engine/segment.cpp index c43c195e6b..02d3a8987b 100644 --- a/engines/sci/engine/segment.cpp +++ b/engines/sci/engine/segment.cpp @@ -362,8 +362,8 @@ void Script::setLockers(int lockers) { void Script::setExportTableOffset(int offset) { if (offset) { - _exportTable = (const uint16 *)(_buf + offset + 2); - _numExports = READ_SCI11ENDIAN_UINT16((const byte *)(_exportTable - 1)); + _exportTable = (uint16 *)(_buf + offset + 2); + _numExports = READ_SCI11ENDIAN_UINT16(_exportTable - 1); } else { _exportTable = NULL; _numExports = 0; @@ -380,7 +380,7 @@ uint16 Script::validateExportFunc(int pubfunct) { if (exportsAreWide) pubfunct *= 2; - uint16 offset = READ_SCI11ENDIAN_UINT16((const byte *)(_exportTable + pubfunct)); + uint16 offset = READ_SCI11ENDIAN_UINT16(_exportTable + pubfunct); VERIFY(offset < _bufSize, "invalid export function pointer"); return offset; @@ -538,7 +538,7 @@ SegmentRef SystemStrings::dereference(reg_t pointer) { //-------------------- script -------------------- -reg_t Script::findCanonicAddress(SegManager *segMan, reg_t addr) { +reg_t Script::findCanonicAddress(SegManager *segMan, reg_t addr) const { addr.offset = 0; return addr; } @@ -622,7 +622,7 @@ void CloneTable::freeAtAddress(SegManager *segMan, reg_t addr) { //-------------------- locals -------------------- -reg_t LocalVariables::findCanonicAddress(SegManager *segMan, reg_t addr) { +reg_t LocalVariables::findCanonicAddress(SegManager *segMan, reg_t addr) const { // Reference the owning script SegmentId owner_seg = segMan->getScriptSegment(script_id); @@ -640,7 +640,7 @@ void LocalVariables::listAllOutgoingReferences(reg_t addr, void *param, NoteCall //-------------------- stack -------------------- -reg_t DataStack::findCanonicAddress(SegManager *segMan, reg_t addr) { +reg_t DataStack::findCanonicAddress(SegManager *segMan, reg_t addr) const { addr.offset = 0; return addr; } @@ -821,7 +821,7 @@ bool Object::initBaseObject(SegManager *segMan, reg_t addr) { //-------------------- dynamic memory -------------------- -reg_t DynMem::findCanonicAddress(SegManager *segMan, reg_t addr) { +reg_t DynMem::findCanonicAddress(SegManager *segMan, reg_t addr) const { addr.offset = 0; return addr; } @@ -860,7 +860,7 @@ void ArrayTable::listAllOutgoingReferences(reg_t addr, void *param, NoteCallback } } -Common::String SciString::toString() { +Common::String SciString::toString() const { if (_type != 3) error("SciString::toString(): Array is not a string"); @@ -871,7 +871,7 @@ Common::String SciString::toString() { return string; } -void SciString::fromString(Common::String string) { +void SciString::fromString(const Common::String &string) { if (_type != 3) error("SciString::fromString(): Array is not a string"); |