Skip to content

Commit

Permalink
MORTEVIELLE: silent several warning reported by cppCheck
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke committed Apr 6, 2012
1 parent 9751829 commit be68aad
Show file tree
Hide file tree
Showing 11 changed files with 91 additions and 94 deletions.
93 changes: 49 additions & 44 deletions engines/mortevielle/actions.cpp
Expand Up @@ -179,10 +179,8 @@ void fctMove() {
* @remarks Originally called 'tprendre'
*/
void fctTake() {
int cx;

if (caff > 99) {
cx = caff;
int cx = caff;
avpoing(cx);
if (crep != 139) {
if (ipers > 0)
Expand Down Expand Up @@ -475,27 +473,30 @@ void fctSelftLook() {
*/
void fctSearch() {
const byte r[14] = {123, 104, 123, 131, 131, 123, 104, 131, 123, 123, 106, 123, 123, 107};
int cx;

if (caff > 99) {
st7(caff);
return;
}

if (!syn)
ecr3(g_vm->getEngineString(S_SEARCH));

tfleche();
if (anyone || iesc)
return;

if (s.mlieu == 23) {
crep = 1504;
tperd();
return;
}

tcoord(6);
if (num == 0) {
tcoord(7);
if (num != 0) {
cx = 0;
int cx = 0;
do {
++cx;
} while ((cx <= 6) && (num != ord(touv[cx])));
Expand All @@ -504,6 +505,7 @@ void fctSearch() {
else {
if (ipers > 0)
s.conf += 3;

rechai(mchai);
if (mchai != 0) {
cs = 0;
Expand Down Expand Up @@ -540,14 +542,17 @@ void fctSearch() {
crep = 997;
if (s.mlieu < 14)
crep = r[s.mlieu];

if ((s.mlieu == 3) && (num == 2))
crep = 162;

if (s.mlieu == 12) {
if ((num == 3) || (num == 4))
crep = 162;
else if (num == 5)
crep = 159;
}

if (s.mlieu == 19)
crep = 104;
else if (s.mlieu == 16)
Expand All @@ -571,10 +576,9 @@ void fctSelfSearch() {
* @remarks Originally called 'touvrir'
*/
void fctOpen() {
int cx, haz;

if (!syn)
ecr3(g_vm->getEngineString(S_OPEN));

if (caff == 26) {
if (ment != 0) {
msg[4] = OPCODE_ENTER;
Expand All @@ -583,19 +587,22 @@ void fctOpen() {
crep = 997;
return;
}

if (caff == 15) {
aldepl();
return;
}

tfleche();
if ((anyone) || (iesc))
return;

tcoord(7);
if (num != 0) {
if (ipers > 0)
s.conf += 2;
++iouv;
cx = 0;
int cx = 0;
do {
++cx;
} while (!((cx > 6) || (ord(touv[cx]) == 0) || (ord(touv[cx]) == num)));
Expand All @@ -609,8 +616,7 @@ void fctOpen() {
if ( ((s.mlieu > 10) && (s.mlieu < 14))
|| ((s.mlieu > 6) && (s.mlieu < 10))
|| (s.mlieu == 0) || (s.mlieu == 2) || (s.mlieu == 5)) {
haz = hazard(1, 4);
if (haz == 3)
if (hazard(1, 4) == 3)
parole(7, 9, 1);
}
touv[cx] = chr(num);
Expand All @@ -632,10 +638,6 @@ void fctOpen() {
* @remarks Originally called 'tmettre'
*/
void fctPlace() {
bool enterPassageFl;
Common::String str_;
int i;

if (s.derobj == 0) {
crep = 186;
return;
Expand Down Expand Up @@ -684,10 +686,10 @@ void fctPlace() {
int answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
if (answer== 1) {
Common::String alertTxt = deline(582);
i = Alert::show(alertTxt, 1);
Alert::show(alertTxt, 1);

tesok = false;
enterPassageFl = Ques::show();
bool enterPassageFl = Ques::show();
hideMouse();
hirs();
dessine_rouleau();
Expand All @@ -712,7 +714,7 @@ void fctPlace() {
aniof(1, 2);
aniof(1, 1);
alertTxt = deline(577);
i = Alert::show(alertTxt, 1);
Alert::show(alertTxt, 1);
aniof(2, 1);
crep = 166;
}
Expand Down Expand Up @@ -844,10 +846,9 @@ void fctAttach() {
* @remarks Originally called 'tfermer'
*/
void fctClose() {
int cx, chai;

if (!syn)
ecr3(g_vm->getEngineString(S_CLOSE));

if (caff < 26) {
tfleche();
if (iesc)
Expand All @@ -856,7 +857,7 @@ void fctClose() {
return;
tcoord(7);
if (num != 0) {
cx = 0;
int cx = 0;
do {
++cx;
} while ((cx <= 6) && (num != ord(touv[cx])));
Expand All @@ -867,7 +868,7 @@ void fctClose() {
iouv = iouv - 1;
if (iouv < 0)
iouv = 0;
chai = 9999;
int chai = 9999;
rechai(chai);
if (mchai == chai)
mchai = 0;
Expand All @@ -883,14 +884,14 @@ void fctClose() {
* @remarks Originally called 'tfrapper'
*/
void fctKnock() {
int l, p, haz;

if (!syn)
ecr3(g_vm->getEngineString(S_HIT));

if (s.mlieu == 15) {
l = Alert::show(g_vm->getEngineString(S_BEFORE_USE_DEP_MENU), 1);
Alert::show(g_vm->getEngineString(S_BEFORE_USE_DEP_MENU), 1);
return;
}

if (s.mlieu < 25) {
tfleche();
if (!(anyone) && !(iesc))
Expand All @@ -900,12 +901,14 @@ void fctKnock() {
crep = 997;
return;
}

if (s.mlieu == 26) {
haz = (hazard(0, 8)) - 4;
int haz = (hazard(0, 8)) - 4;
parole(11, haz, 1);
int p;
ecfren(p, haz, s.conf, ment);
l = ment;
if (l != 0)
int l = ment;
if (l != 0) {
if (p != -500) {
if (haz > p)
crep = 190;
Expand All @@ -915,6 +918,8 @@ void fctKnock() {
}
} else
frap();
}

if (ment == 8)
crep = 190;
}
Expand All @@ -925,8 +930,6 @@ void fctKnock() {
* @remarks Originally called 'tposer'
*/
void fctSelfPut() {
int cx, chai;

if (!syn)
ecr3(g_vm->getEngineString(S_POSE));
if (s.derobj == 0)
Expand All @@ -945,11 +948,12 @@ void fctSelfPut() {
tcoord(7);
crep = 124;
if (num != 0) {
int chai;
rechai(chai);
if (chai == 0)
crep = 997;
else {
cx = 0;
int cx = 0;
do {
++cx;
} while ((cx <= 6) && (num != ord(touv[cx])));
Expand Down Expand Up @@ -1014,21 +1018,21 @@ void fctSelfPut() {
* @remarks Originally called 'tecouter'
*/
void fctListen() {
int l, p, haz, j, h, m;

if (s.mlieu != 26)
crep = 101;
else {
if (ipers != 0)
++s.conf;
int p, haz;
ecfren(p, haz, s.conf, ment);
l = ment;
int l = ment;
if (l != 0) {
if (p != -500) {
if (haz > p)
crep = 101;
else {
becfren(l);
int j, h, m;
calch(j, h, m);
haz = hazard(1, 100);
if ((h >= 0) && (h < 8)) {
Expand All @@ -1052,8 +1056,6 @@ void fctListen() {
* @remarks Originally called 'tmanger'
*/
void fctEat() {
int j, h, m;

if ((s.mlieu > 15) && (s.mlieu < 26))
crep = 148;
else {
Expand All @@ -1062,6 +1064,8 @@ void fctEat() {
caff = 10;
debloc(s.mlieu);
tmlieu(s.mlieu);

int j, h, m;
calch(j, h, m);
if ((h == 12) || (h == 13) || (h == 19)) {
s.conf = s.conf - (s.conf / 7);
Expand All @@ -1088,7 +1092,7 @@ void fctEat() {
* @remarks Originally called 'tentrer'
*/
void fctEnter() {
int x, z = 0;
// int x;

if ((s.mlieu == 21) || (s.mlieu == 22)) {
t1sama();
Expand All @@ -1101,21 +1105,22 @@ void fctEnter() {
crep = 189;
s.teauto[8] = '*';
} else {
int z = 0;
if (! blo)
t11(ment, z);
if (z != 0) {
if ((ment == 3) || (ment == 7))
crep = 179;
else {
x = (hazard(0, 10)) - 5;
parole(7, x, 1);
g_x = (hazard(0, 10)) - 5;
parole(7, g_x, 1);
aniof(1, 1);

tip(z, x);
tip(z, g_x);
++s.conf;
s.mlieu = 15;
msg[3] = MENU_DISCUSS;
msg[4] = g_vm->_menu._discussMenu[x];
msg[4] = g_vm->_menu._discussMenu[g_x];
syn = true;
if (ment == 9) {
col = true;
Expand All @@ -1128,8 +1133,8 @@ void fctEnter() {
ment = 0;
}
} else {
x = (hazard(0, 10)) - 5;
parole(7, x, 1);
g_x = (hazard(0, 10)) - 5;
parole(7, g_x, 1);
aniof(1, 1);

s.mlieu = ment;
Expand Down Expand Up @@ -1213,13 +1218,13 @@ void fctForce() {
* @remarks Originally called 'tsortir'
*/
void fctLeave() {
int lx = 0;

tsort();
crep = 0;
if ((s.mlieu == 19) || (s.mlieu == 21) || (s.mlieu == 22) || (s.mlieu == 24))
crep = 997;
else {
int lx = 0;

if ((s.mlieu < 16) || (s.mlieu == 26))
lx = 10;
if ((s.mlieu == 10) || (s.mlieu == 20))
Expand Down
11 changes: 5 additions & 6 deletions engines/mortevielle/menu.cpp
Expand Up @@ -393,14 +393,11 @@ void Menu::eraseMenu() {
* Handle updates to the menu
*/
void Menu::mdn() {
int x, y, ix;
bool tes;

if (!_menuActive)
return;

x = x_s;
y = y_s;
int x = x_s;
int y = y_s;
if (!g_vm->getMouseClick()) {
if ((x == xprec) && (y == yprec))
return;
Expand All @@ -409,14 +406,16 @@ void Menu::mdn() {
yprec = y;
}

tes = (y < 11)
bool tes = (y < 11)
&& ((x >= (28 * res) && x <= (28 * res + 24))
|| (x >= (76 * res) && x <= (76 * res + 24))
|| ((x > 124 * res) && (x < 124 * res + 24))
|| ((x > 172 * res) && (x < 172 * res + 24))
|| ((x > 220 * res) && (x < 220 * res + 24))
|| ((x > 268 * res) && (x < 268 * res + 24)));
if (tes) {
int ix;

if (x < 76 * res)
ix = MENU_INVENTORY;
else if (x < 124 * res)
Expand Down
2 changes: 1 addition & 1 deletion engines/mortevielle/mor.cpp
Expand Up @@ -674,7 +674,7 @@ void drawClock() {

void debloc(int l) {
num = 0;
x = 0;
g_x = 0;
y = 0;
if ((l != 26) && (l != 15))
t5(l);
Expand Down

0 comments on commit be68aad

Please sign in to comment.