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/script.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/script.cpp')
| -rw-r--r-- | engines/sci/engine/script.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/engines/sci/engine/script.cpp b/engines/sci/engine/script.cpp index aa3fbc995a..9bbb7738e9 100644 --- a/engines/sci/engine/script.cpp +++ b/engines/sci/engine/script.cpp @@ -193,7 +193,7 @@ void SegManager::scriptInitialiseLocals(reg_t location) { LocalVariables *locals = allocLocalsSegment(scr, count); if (locals) { uint i; - byte *base = (byte *)(scr->_buf + location.offset); + const byte *base = (const byte *)(scr->_buf + location.offset); for (i = 0; i < count; i++) locals->_locals[i] = make_reg(0, READ_SCI11ENDIAN_UINT16(base + i * 2)); @@ -206,10 +206,10 @@ void SegManager::scriptRelocateExportsSci11(SegmentId seg) { /* We are forced to use an ugly heuristic here to distinguish function exports from object/class exports. The former kind points into the script resource, the latter into the heap resource. */ - uint16 location = READ_SCI11ENDIAN_UINT16((byte *)(scr->_exportTable + i)); + uint16 location = READ_SCI11ENDIAN_UINT16(scr->_exportTable + i); if ((location < scr->_heapSize - 1) && (READ_SCI11ENDIAN_UINT16(scr->_heapStart + location) == SCRIPT_OBJECT_MAGIC_NUMBER)) { - WRITE_SCI11ENDIAN_UINT16((byte *)(scr->_exportTable + i), location + scr->_heapStart - scr->_buf); + WRITE_SCI11ENDIAN_UINT16(scr->_exportTable + i, location + scr->_heapStart - scr->_buf); } else { // Otherwise it's probably a function export, // and we don't need to do anything. @@ -219,7 +219,7 @@ void SegManager::scriptRelocateExportsSci11(SegmentId seg) { void SegManager::scriptInitialiseObjectsSci11(SegmentId seg) { Script *scr = getScript(seg); - byte *seeker = scr->_heapStart + 4 + READ_SCI11ENDIAN_UINT16(scr->_heapStart + 2) * 2; + const byte *seeker = scr->_heapStart + 4 + READ_SCI11ENDIAN_UINT16(scr->_heapStart + 2) * 2; while (READ_SCI11ENDIAN_UINT16(seeker) == SCRIPT_OBJECT_MAGIC_NUMBER) { if (READ_SCI11ENDIAN_UINT16(seeker + 14) & SCRIPT_INFO_CLASS) { |
