scummvm/sword2
Torbjörn Andersson 3d012651fd The script engine frequently needs to pass pointers to various structures
etc. to the different opcodes. Until now it has done so by casting the
pointer to an int32 (opcode parameters are represented as arrays of int32)
and then the opcode function casts it back to whatever pointer it needs.

At least in C there is no guarantee that a pointer can be represented as an
integer type (though apparently C99 may define such a type), so this has
struck me as unsafe ever since I first noticed it.

However, since all such pointers appear to point to the memory block owned
by the memory manager, we can easily convert them to integers by treating
them as offsets into the memory block. So that's what I have done. I hope I
caught all the occurences in the opcode functions, or we're going to have
some pretty interesting regressions on our hands...

svn-id: r11241
2003-11-10 07:52:15 +00:00
..
driver cleanup whitespaces 2003-11-08 19:47:20 +00:00
.cvsignore bs2 2003-07-28 01:44:38 +00:00
anims.cpp The script engine frequently needs to pass pointers to various structures 2003-11-10 07:52:15 +00:00
build_display.cpp The script engine frequently needs to pass pointers to various structures 2003-11-10 07:52:15 +00:00
build_display.h More moving of stuff into classes 2003-11-01 16:55:20 +00:00
console.cpp Removed some now redundant header files. 2003-11-08 18:15:35 +00:00
console.h Moved more stuff into classes, changed some static allocation to dynamic, 2003-11-08 15:47:51 +00:00
controls.cpp Moved more stuff into classes, changed some static allocation to dynamic, 2003-11-08 15:47:51 +00:00
controls.h Moved more stuff into classes, changed some static allocation to dynamic, 2003-11-08 15:47:51 +00:00
credits.h bs2 -> sword2 2003-10-28 19:51:30 +00:00
debug.cpp Removed some now redundant header files. 2003-11-08 18:15:35 +00:00
debug.h More moving of stuff into classes. I had to make a few changes/cleanups to 2003-11-02 15:58:45 +00:00
defs.h The resource and memory managers are now created dynamically. 2003-11-03 07:47:42 +00:00
events.cpp The script engine frequently needs to pass pointers to various structures 2003-11-10 07:52:15 +00:00
function.cpp The script engine frequently needs to pass pointers to various structures 2003-11-10 07:52:15 +00:00
header.h added namespace Sword2 2003-10-04 00:52:27 +00:00
icons.cpp The script engine frequently needs to pass pointers to various structures 2003-11-10 07:52:15 +00:00
icons.h More moving of stuff into classes. I had to make a few changes/cleanups to 2003-11-02 15:58:45 +00:00
interpreter.cpp The script engine frequently needs to pass pointers to various structures 2003-11-10 07:52:15 +00:00
interpreter.h Moved some more stuff into the Logic class. 2003-10-21 08:54:50 +00:00
layers.cpp Moved more stuff into classes, changed some static allocation to dynamic, 2003-11-08 15:47:51 +00:00
layers.h Moved some more "homeless" functions into Sword2Engine. (Don't worry -- I 2003-11-02 17:17:10 +00:00
logic.cpp Removed some now redundant header files. 2003-11-08 18:15:35 +00:00
logic.h Removed some now redundant header files. 2003-11-08 18:15:35 +00:00
maketext.cpp Moved more stuff into classes, changed some static allocation to dynamic, 2003-11-08 15:47:51 +00:00
maketext.h Moved more stuff into classes, changed some static allocation to dynamic, 2003-11-08 15:47:51 +00:00
mem_view.cpp The resource and memory managers are now created dynamically. 2003-11-03 07:47:42 +00:00
memory.cpp The script engine frequently needs to pass pointers to various structures 2003-11-10 07:52:15 +00:00
memory.h The script engine frequently needs to pass pointers to various structures 2003-11-10 07:52:15 +00:00
module.mk bs2 -> sword2 2003-10-28 19:51:30 +00:00
mouse.cpp The script engine frequently needs to pass pointers to various structures 2003-11-10 07:52:15 +00:00
mouse.h Even more stuff moving into Sword2Engine. I'm tempted to make a new class 2003-11-02 18:50:09 +00:00
object.h Moved the opcode functions into the Logic class. 2003-10-18 08:11:50 +00:00
protocol.cpp The resource and memory managers are now created dynamically. 2003-11-03 07:47:42 +00:00
protocol.h The resource and memory managers are now created dynamically. 2003-11-03 07:47:42 +00:00
resman.cpp Removed some now redundant header files. 2003-11-08 18:15:35 +00:00
resman.h Moved more stuff into classes, changed some static allocation to dynamic, 2003-11-08 15:47:51 +00:00
router.cpp Moved more stuff into classes, changed some static allocation to dynamic, 2003-11-08 15:47:51 +00:00
router.h Moved more stuff into classes, changed some static allocation to dynamic, 2003-11-08 15:47:51 +00:00
save_rest.cpp The script engine frequently needs to pass pointers to various structures 2003-11-10 07:52:15 +00:00
save_rest.h The resource and memory managers are now created dynamically. 2003-11-03 07:47:42 +00:00
scroll.cpp cleanup whitespaces 2003-11-08 19:47:20 +00:00
sound.cpp cleanup whitespaces 2003-11-08 19:47:20 +00:00
sound.h The resource and memory managers are now created dynamically. 2003-11-03 07:47:42 +00:00
speech.cpp The script engine frequently needs to pass pointers to various structures 2003-11-10 07:52:15 +00:00
speech.h More moving of stuff into classes. 2003-11-04 17:26:59 +00:00
startup.cpp The script engine frequently needs to pass pointers to various structures 2003-11-10 07:52:15 +00:00
startup.h Create g_logic dynamically. More moving of stuff into classes. 2003-11-04 18:02:49 +00:00
sword2.cpp cut down on unnecessary GameDetector references 2003-11-10 01:04:12 +00:00
sword2.h cut down on unnecessary GameDetector references 2003-11-10 01:04:12 +00:00
sync.cpp Removed some now redundant header files. 2003-11-08 18:15:35 +00:00
tony_gsdk.cpp Removed some now redundant header files. 2003-11-08 18:15:35 +00:00
walker.cpp The script engine frequently needs to pass pointers to various structures 2003-11-10 07:52:15 +00:00