From f60e2836b05c922b2ae89b121b4f23fea60de3fc Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 20 Jan 2009 02:54:30 +0000 Subject: [PATCH] Fixed warnings (nice example of why heeding warnings is useful: one of the changes seems to fix a NULL deref) svn-id: r35933 --- engines/kyra/scene_lol.cpp | 5 +++-- engines/kyra/script_lol.cpp | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/engines/kyra/scene_lol.cpp b/engines/kyra/scene_lol.cpp index e860bb3f5a4..2c6437605ee 100644 --- a/engines/kyra/scene_lol.cpp +++ b/engines/kyra/scene_lol.cpp @@ -692,10 +692,11 @@ void LoLEngine::resetItems(int flag) { for (int i = 0; i < 1024; i++) { _levelBlockProperties[i].field_8 = 5; uint16 id = _levelBlockProperties[i].itemIndex; - LVL * r = 0; + LVL *r = 0; while (id & 0x8000) { - LVL * r = (LVL*) cmzGetItemOffset(id); + r = (LVL*)cmzGetItemOffset(id); + assert(r); id = r->itemIndexUnk; } diff --git a/engines/kyra/script_lol.cpp b/engines/kyra/script_lol.cpp index 5c559242eed..2ced8b6bf75 100644 --- a/engines/kyra/script_lol.cpp +++ b/engines/kyra/script_lol.cpp @@ -364,7 +364,6 @@ int LoLEngine::o2_getUnkArrayVal(EMCState *script) { } int LoLEngine::o2_setUnkArrayVal(EMCState *script) { - int a=stackPos(0); _unkEMC46[stackPos(0)] = stackPos(1); return 1; }