aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2002-10-22 11:48:24 +0000
committerMax Horn2002-10-22 11:48:24 +0000
commit5151e561d504864a655b25512a933f3bf70bd3de (patch)
tree8a1c9e66bad22700749ee75f07adb39973f90958
parent9f33d561a981203d5d482113b35b329da600ca0e (diff)
downloadscummvm-rg350-5151e561d504864a655b25512a933f3bf70bd3de.tar.gz
scummvm-rg350-5151e561d504864a655b25512a933f3bf70bd3de.tar.bz2
scummvm-rg350-5151e561d504864a655b25512a933f3bf70bd3de.zip
fixing various warnings that occur with -Wshadow;some other minor cleanup
svn-id: r5239
-rw-r--r--scumm/debug.cpp2
-rw-r--r--scumm/gfx.cpp4
-rw-r--r--scumm/imuse.cpp4
-rw-r--r--scumm/script_v2.cpp2
-rw-r--r--scumm/scummvm.cpp2
-rw-r--r--scumm/smush/brenderer.h1
-rw-r--r--scumm/sound.cpp2
-rw-r--r--simon/simon.cpp42
8 files changed, 25 insertions, 34 deletions
diff --git a/scumm/debug.cpp b/scumm/debug.cpp
index 22c46d003d..06954dd6a5 100644
--- a/scumm/debug.cpp
+++ b/scumm/debug.cpp
@@ -201,7 +201,7 @@ int ScummDebugger::get_command()
const DebuggerCommands *dc;
char *s;
int i;
- static char *buf;
+ char *buf;
do {
#ifndef HAVE_READLINE
diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp
index 39dce0d9b4..cd37ae83ee 100644
--- a/scumm/gfx.cpp
+++ b/scumm/gfx.cpp
@@ -985,8 +985,8 @@ void Gdi::drawBitmap(byte *ptr, VirtScreen *vs, int x, int y, int h,
decompressMaskImg();
} else {
if (!(_useOrDecompress && flag & dbAllowMaskOr))
- for (int h = 0; h < _numLinesToProcess; h++)
- _mask_ptr_dest[h * NUM_STRIPS] = 0;
+ for (int height = 0; height < _numLinesToProcess; height++)
+ _mask_ptr_dest[height * NUM_STRIPS] = 0;
/* needs better abstraction, FIXME */
}
}
diff --git a/scumm/imuse.cpp b/scumm/imuse.cpp
index e26beeeb78..094fa7a687 100644
--- a/scumm/imuse.cpp
+++ b/scumm/imuse.cpp
@@ -5624,8 +5624,8 @@ void IMuseDigital::stopAll() {
}
}
-void IMuseDigital::pause(bool pause) {
- _pause = pause;
+void IMuseDigital::pause(bool p) {
+ _pause = p;
}
int32 IMuseDigital::doCommand(int a, int b, int c, int d, int e, int f, int g, int h) {
diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp
index 0ec566425f..191cd81d3a 100644
--- a/scumm/script_v2.cpp
+++ b/scumm/script_v2.cpp
@@ -1345,7 +1345,7 @@ void Scumm::o6_walkActorToObj()
if (obj >= NUM_ACTORS) {
if (whereIsObject(obj) == WIO_NOT_FOUND)
return;
- int x, y, dir;
+ int y, dir;
getObjectXYPos(obj, x, y, dir);
a->startWalkActor(x, y, dir);
} else {
diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp
index fe8715688d..9ab814888f 100644
--- a/scumm/scummvm.cpp
+++ b/scumm/scummvm.cpp
@@ -663,7 +663,7 @@ void Scumm::startScene(int room, Actor * a, int objectNr)
}
} else {
if (camera._follows) {
- Actor *a = derefActorSafe(camera._follows, "startScene: follows");
+ a = derefActorSafe(camera._follows, "startScene: follows");
setCameraAt(a->x, a->y);
}
}
diff --git a/scumm/smush/brenderer.h b/scumm/smush/brenderer.h
index 434c18b8a0..b5ec15aad7 100644
--- a/scumm/smush/brenderer.h
+++ b/scumm/smush/brenderer.h
@@ -49,7 +49,6 @@ protected:
int32 getNbframes() const { return _nbframes; }; //!< accessor for number of frames
int32 getWidth() const { return _width; }; //!< accessor for current width
int32 getHeight() const { return _height; }; //!< accessor for current height
- const Palette & pal() const { return _pal; }; //!< accessor for current palette
const char * data() const { return _data; }; //!< accessor for current frame buffer
void clean(); //!< memory cleanup (deletes frame buffer)
void setFrame(int32 f) { _frame = f; }; //!< allows to change the frame number
diff --git a/scumm/sound.cpp b/scumm/sound.cpp
index 275f8dd5d3..655166d826 100644
--- a/scumm/sound.cpp
+++ b/scumm/sound.cpp
@@ -482,7 +482,7 @@ int Sound::startTalkSound(uint32 offset, uint32 b, int mode) {
if (mode == 1 && (_scumm->_gameId == GID_TENTACLE
|| (_scumm->_gameId == GID_SAMNMAX && !_scumm->isScriptRunning(99)))) {
- for (int i = 0; i < _scumm->_mixer->NUM_CHANNELS; i++) {
+ for (i = 0; i < _scumm->_mixer->NUM_CHANNELS; i++) {
if (i != _talkChannel)
_scumm->_mixer->stop(i);
}
diff --git a/simon/simon.cpp b/simon/simon.cpp
index 40951a4ed1..55fdaa53a3 100644
--- a/simon/simon.cpp
+++ b/simon/simon.cpp
@@ -4419,7 +4419,7 @@ void SimonState::delay(uint delay)
bool SimonState::save_game(uint slot, const char *caption)
{
File f;
- uint item_index, num_item, i;
+ uint item_index, num_item, i, j;
TimeEvent *te;
_lock_word |= 0x100;
@@ -4444,8 +4444,8 @@ bool SimonState::save_game(uint slot, const char *caption)
i = 0;
for (te = _first_time_struct; te; te = te->next)
i++;
-
f.writeUint32BE(i);
+
for (te = _first_time_struct; te; te = te->next) {
f.writeUint32BE(te->time + _base_time);
f.writeUint16BE(te->subroutine_id);
@@ -4460,36 +4460,28 @@ bool SimonState::save_game(uint slot, const char *caption)
f.writeUint16BE(item->unk3);
f.writeUint16BE(item->unk4);
- {
- Child1 *child1 = findChildOfType1(item);
- if (child1) {
- f.writeUint16BE(child1->fr2);
- }
+ Child1 *child1 = findChildOfType1(item);
+ if (child1) {
+ f.writeUint16BE(child1->fr2);
}
- {
- Child2 *child2 = findChildOfType2(item);
- uint i, j;
-
- if (child2) {
- f.writeUint32BE(child2->avail_props);
- i = child2->avail_props & 1;
+ Child2 *child2 = findChildOfType2(item);
+ if (child2) {
+ f.writeUint32BE(child2->avail_props);
+ i = child2->avail_props & 1;
- for (j = 1; j < 16; j++) {
- if ((1 << j) & child2->avail_props) {
- f.writeUint16BE(child2->array[i++]);
- }
+ for (j = 1; j < 16; j++) {
+ if ((1 << j) & child2->avail_props) {
+ f.writeUint16BE(child2->array[i++]);
}
}
}
- {
- Child9 *child9 = (Child9 *) findChildOfType(item, 9);
- if (child9) {
- uint i;
- for (i = 0; i != 4; i++) {
- f.writeUint16BE(child9->array[i]);
- }
+ Child9 *child9 = (Child9 *) findChildOfType(item, 9);
+ if (child9) {
+ uint i;
+ for (i = 0; i != 4; i++) {
+ f.writeUint16BE(child9->array[i]);
}
}
}