[Scummvm-cvs-logs] SF.net SVN: scummvm:[38445] scummvm/trunk/engines/sci/engine/seg_manager. cpp
aquadran at users.sourceforge.net
aquadran at users.sourceforge.net
Tue Feb 17 21:34:19 CET 2009
Revision: 38445
http://scummvm.svn.sourceforge.net/scummvm/?rev=38445&view=rev
Author: aquadran
Date: 2009-02-17 20:34:19 +0000 (Tue, 17 Feb 2009)
Log Message:
-----------
fixed unsigned/signed comparisons warnings
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/seg_manager.cpp
Modified: scummvm/trunk/engines/sci/engine/seg_manager.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/seg_manager.cpp 2009-02-17 20:26:57 UTC (rev 38444)
+++ scummvm/trunk/engines/sci/engine/seg_manager.cpp 2009-02-17 20:34:19 UTC (rev 38445)
@@ -556,9 +556,9 @@
switch (mem_type) {
case MEM_OBJ_SCRIPT:
- VERIFY(reg.offset + 1 < (unsigned int)mem_obj->data.script.buf_size, "invalid offset\n");
- return (unsigned char)mem_obj->data.script.buf[reg.offset] |
- (((unsigned char)mem_obj->data.script.buf[reg.offset+1]) << 8);
+ VERIFY(reg.offset + 1 < (guint16)mem_obj->data.script.buf_size, "invalid offset\n");
+ return (mem_obj->data.script.buf[reg.offset] |
+ (mem_obj->data.script.buf[reg.offset+1]) << 8);
case MEM_OBJ_CLONES:
sciprintf("memcpy for clones hasn't been implemented yet\n");
break;
@@ -579,7 +579,7 @@
switch (mem_type) {
case MEM_OBJ_SCRIPT:
- VERIFY(reg.offset + 1 < mem_obj->data.script.buf_size, "invalid offset");
+ VERIFY(reg.offset + 1 < (guint16)mem_obj->data.script.buf_size, "invalid offset");
mem_obj->data.script.buf[reg.offset] = value & 0xff;
mem_obj->data.script.buf[reg.offset + 1] = value >> 8;
break;
@@ -827,8 +827,8 @@
scr = &(mobj->data.script);
- VERIFY(block.offset < scr->buf_size
- && getUInt16(scr->buf + block.offset)*2 + block.offset < scr->buf_size,
+ VERIFY(block.offset < (guint16)scr->buf_size
+ && getUInt16(scr->buf + block.offset)*2 + block.offset < (guint16)scr->buf_size,
"Relocation block outside of script\n");
count = getUInt16(scr->buf + block.offset);
@@ -887,8 +887,8 @@
scr = &(mobj->data.script);
- VERIFY(block.offset < scr->heap_size
- && getUInt16(scr->heap_start + block.offset)*2 + block.offset < scr->buf_size,
+ VERIFY(block.offset < (guint16)scr->heap_size
+ && getUInt16(scr->heap_start + block.offset)*2 + block.offset < (guint16)scr->buf_size,
"Relocation block outside of script\n");
if (scr->relocated) return;
@@ -1023,7 +1023,7 @@
scr = &(mobj->data.script);
- VERIFY(base < scr->buf_size,
+ VERIFY(base < (guint16)scr->buf_size,
"Attempt to initialize object beyond end of script\n");
if (!scr->objects) {
@@ -1043,7 +1043,7 @@
obj = scr->objects + id;
- VERIFY(base + SCRIPT_FUNCTAREAPTR_OFFSET < scr->buf_size,
+ VERIFY(base + SCRIPT_FUNCTAREAPTR_OFFSET < (guint16)scr->buf_size,
"Function area pointer stored beyond end of script\n");
{
@@ -1149,7 +1149,7 @@
scr = &(mobj->data.script);
- VERIFY(location.offset + 1 < scr->buf_size,
+ VERIFY(location.offset + 1 < (guint16)scr->buf_size,
"Locals beyond end of script\n");
if (self->sci1_1)
@@ -1168,7 +1168,7 @@
locals = _sm_alloc_locals_segment(self, scr, count);
if (locals) {
- int i;
+ uint i;
byte *base = (byte *)(scr->buf + location.offset);
for (i = 0; i < count; i++)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list