aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorStrangerke2011-06-13 13:44:52 +0200
committerStrangerke2011-06-13 13:44:52 +0200
commit9918344cdc596d211c2c03b5c31f669f06c89f0f (patch)
tree777ea17b9b0789d97c0bf0278decef972fb5870c /engines
parentaa1d8986a698ebf9b740ed1720baff4e5b091613 (diff)
downloadscummvm-rg350-9918344cdc596d211c2c03b5c31f669f06c89f0f.tar.gz
scummvm-rg350-9918344cdc596d211c2c03b5c31f669f06c89f0f.tar.bz2
scummvm-rg350-9918344cdc596d211c2c03b5c31f669f06c89f0f.zip
CGE: Fix several issues reported by CPPCHECK
Diffstat (limited to 'engines')
-rw-r--r--engines/cge/bitmap.cpp2
-rw-r--r--engines/cge/cge_main.cpp7
-rw-r--r--engines/cge/snail.cpp3
-rw-r--r--engines/cge/text.cpp2
-rw-r--r--engines/cge/vga13h.cpp10
-rw-r--r--engines/cge/vmenu.cpp3
6 files changed, 11 insertions, 16 deletions
diff --git a/engines/cge/bitmap.cpp b/engines/cge/bitmap.cpp
index 2763c00868..36723aba28 100644
--- a/engines/cge/bitmap.cpp
+++ b/engines/cge/bitmap.cpp
@@ -348,7 +348,7 @@ bool BITMAP::SolidAt(int x, int y) {
return true;
break;
}
- m += (t == REP) ? 1 : w;
+ m += ((t == REP) ? 1 : w);
}
}
diff --git a/engines/cge/cge_main.cpp b/engines/cge/cge_main.cpp
index 24964da0fc..64a20293bd 100644
--- a/engines/cge/cge_main.cpp
+++ b/engines/cge/cge_main.cpp
@@ -668,7 +668,7 @@ static void MiniStep(int stp) {
static void PostMiniStep(int stp) {
- static int recent = -2;
+ //static int recent = -2;
//TODO Change the SNPOST message send to a special way to send function pointer
//if (MiniCave && stp != recent) SNPOST_(SNEXEC, -1, recent = stp, (void *)&MiniStep);
warning("STUB: PostMiniStep()");
@@ -843,7 +843,6 @@ void SwitchCave(int cav) {
void SYSTEM::Touch(uint16 mask, int x, int y) {
static int pp = 0;
void SwitchCave(int cav);
- int cav = 0;
FunTouch();
@@ -968,7 +967,7 @@ void SYSTEM::Touch(uint16 mask, int x, int y) {
} else {
if (Startup)
return;
-
+ int cav = 0;
InfoLine.Update(NULL);
if (y >= WORLD_HIG) {
if (x < BUTTON_X) { // select cave?
@@ -998,7 +997,7 @@ void SYSTEM::Touch(uint16 mask, int x, int y) {
#ifdef DEBUG
if (!HorzLine.Flags.Hide) {
if (y >= MAP_TOP && y < MAP_TOP + MAP_HIG) {
- signed char x1, z1;
+ int8 x1, z1;
XZ(x, y).Split(x1, z1);
CLUSTER::Map[z1][x1] = 1;
SetMapBrick(x1, z1);
diff --git a/engines/cge/snail.cpp b/engines/cge/snail.cpp
index cc52ec63dc..3fedeab04d 100644
--- a/engines/cge/snail.cpp
+++ b/engines/cge/snail.cpp
@@ -164,7 +164,6 @@ static void SNGame(SPRITE *spr, int num) {
case 2 : {
static SPRITE *k = NULL, * k1, * k2, * k3;
static int count = 0;
- bool hit;
if (k == NULL) {
k = VGA::ShowQ.Locate(20700);
@@ -188,7 +187,7 @@ static void SNGame(SPRITE *spr, int num) {
}
///--------------------
SNPOST(SNSETZ, 20700, 0, NULL);
- hit = (k1->SeqPtr + k2->SeqPtr + k3->SeqPtr == 15);
+ bool hit = (k1->SeqPtr + k2->SeqPtr + k3->SeqPtr == 15);
if (hit) {
if (spr->Ref == 1) {
SNPOST(SNSAY, 1, 20003, NULL); // hura!
diff --git a/engines/cge/text.cpp b/engines/cge/text.cpp
index 92951196c7..9b79147cff 100644
--- a/engines/cge/text.cpp
+++ b/engines/cge/text.cpp
@@ -199,7 +199,7 @@ void Say(const char *txt, SPRITE *spr) {
}
x = (east) ? (spr->X + spr->W - 2) : (spr->X + 2 - sw);
if (spr->Ref == 1)
- x += (east) ? -10 : 10; // Hero
+ x += ((east) ? -10 : 10); // Hero
Talk->Flags.Kill = true;
Talk->Flags.BDel = true;
diff --git a/engines/cge/vga13h.cpp b/engines/cge/vga13h.cpp
index 3f303e7f29..72831e83cf 100644
--- a/engines/cge/vga13h.cpp
+++ b/engines/cge/vga13h.cpp
@@ -279,9 +279,9 @@ extern "C" void TimerProc (void)
void ENGINE::NewTimer(...) {
+ /*
static SPRITE *spr;
static uint8 run = 0, cntr1 = TMR_RATE1, cntr2 = TMR_RATE2;
- /*
___1152_Hz___:
SNDMIDIPlay();
@@ -502,9 +502,7 @@ SPRITE *SPRITE::Expand(void) {
neacnt = 0,
takcnt = 0,
maxnow = 0,
- maxnxt = 0,
- lcnt = 0,
- len;
+ maxnxt = 0;
SNAIL::COM *nea = NULL;
SNAIL::COM *tak = NULL;
@@ -513,9 +511,9 @@ SPRITE *SPRITE::Expand(void) {
INI_FILE sprf(fname);
if (! OK(sprf))
error("Bad SPR [%s]", fname);
-
+ int len = 0, lcnt = 0;
while ((len = sprf.Read((uint8 *)line)) != 0) {
- ++ lcnt;
+ ++lcnt;
if (len && line[len - 1] == '\n')
line[-- len] = '\0';
if (len == 0 || *line == '.')
diff --git a/engines/cge/vmenu.cpp b/engines/cge/vmenu.cpp
index 4287c12d63..4e1a3334bf 100644
--- a/engines/cge/vmenu.cpp
+++ b/engines/cge/vmenu.cpp
@@ -126,14 +126,13 @@ VMENU::~VMENU(void) {
void VMENU::Touch(uint16 mask, int x, int y) {
#define h (FONT_HIG + TEXT_LS)
- int n = 0;
bool ok = false;
if (Items) {
SPRITE::Touch(mask, x, y);
y -= TEXT_VM - 1;
- //if
+ int n = 0;
if (y >= 0) {
n = y / h;
if (n < Items)