[Scummvm-cvs-logs] SF.net SVN: scummvm:[52230] scummvm/trunk/engines/hugo
strangerke at users.sourceforge.net
strangerke at users.sourceforge.net
Fri Aug 20 18:35:21 CEST 2010
Revision: 52230
http://scummvm.svn.sourceforge.net/scummvm/?rev=52230&view=rev
Author: strangerke
Date: 2010-08-20 16:35:20 +0000 (Fri, 20 Aug 2010)
Log Message:
-----------
Hugo : Style - Add parenthesis around condition when conditional operator is used, as mentioned in Code Formatting Conventions
Modified Paths:
--------------
scummvm/trunk/engines/hugo/detection.cpp
scummvm/trunk/engines/hugo/engine.cpp
scummvm/trunk/engines/hugo/game.h
scummvm/trunk/engines/hugo/mouse.cpp
scummvm/trunk/engines/hugo/schedule.cpp
scummvm/trunk/engines/hugo/util.cpp
Modified: scummvm/trunk/engines/hugo/detection.cpp
===================================================================
--- scummvm/trunk/engines/hugo/detection.cpp 2010-08-20 16:25:48 UTC (rev 52229)
+++ scummvm/trunk/engines/hugo/detection.cpp 2010-08-20 16:35:20 UTC (rev 52230)
@@ -199,7 +199,7 @@
void HugoEngine::initGamePart(const HugoGameDescription *gd) {
char tmpStr[8];
- _gameVariant = _gameType - 1 + (_platform == Common::kPlatformWindows ? 0 : 3);
+ _gameVariant = _gameType - 1 + ((_platform == Common::kPlatformWindows) ? 0 : 3);
//Generate filenames
if (gd->desc.platform == Common::kPlatformWindows)
Modified: scummvm/trunk/engines/hugo/engine.cpp
===================================================================
--- scummvm/trunk/engines/hugo/engine.cpp 2010-08-20 16:25:48 UTC (rev 52229)
+++ scummvm/trunk/engines/hugo/engine.cpp 2010-08-20 16:35:20 UTC (rev 52230)
@@ -262,11 +262,11 @@
if (abs(dx) <= radius)
obj->vx = 0;
else
- obj->vx = dx > 0 ? MIN(dx, obj->vxPath) : MAX(dx, -obj->vxPath);
+ obj->vx = (dx > 0) ? MIN(dx, obj->vxPath) : MAX(dx, -obj->vxPath);
if (abs(dy) <= radius)
obj->vy = 0;
else
- obj->vy = dy > 0 ? MIN(dy, obj->vyPath) : MAX(dy, -obj->vyPath);
+ obj->vy = (dy > 0) ? MIN(dy, obj->vyPath) : MAX(dy, -obj->vyPath);
// Set first image in sequence (if multi-seq object)
switch (obj->seqNumb) {
@@ -467,7 +467,7 @@
if (vy == 0)
return(0); // Object stationary
- inc = (vy > 0 ? 1 : -1);
+ inc = (vy > 0) ? 1 : -1;
for (j = y + inc; j != (y + vy + inc); j += inc) //Search by byte
for (i = x1 >> 3; i <= x2 >> 3; i++)
if ((b = _boundary[j * XBYTES + i] | _objBound[j * XBYTES + i]) != 0) { // Any bit set
Modified: scummvm/trunk/engines/hugo/game.h
===================================================================
--- scummvm/trunk/engines/hugo/game.h 2010-08-20 16:25:48 UTC (rev 52229)
+++ scummvm/trunk/engines/hugo/game.h 2010-08-20 16:35:20 UTC (rev 52230)
@@ -109,7 +109,7 @@
#define LOOK_S 8 // Description depends on state of object
// Macros:
-#define TPS (_config.turboFl ? TURBO_TPS : NORMAL_TPS)
+#define TPS ((_config.turboFl) ? TURBO_TPS : NORMAL_TPS)
enum TEXTCOLORS {
Modified: scummvm/trunk/engines/hugo/mouse.cpp
===================================================================
--- scummvm/trunk/engines/hugo/mouse.cpp 2010-08-20 16:25:48 UTC (rev 52229)
+++ scummvm/trunk/engines/hugo/mouse.cpp 2010-08-20 16:35:20 UTC (rev 52230)
@@ -167,7 +167,7 @@
case LEFT_ARROW: // A scroll arrow - scroll the iconbar
case RIGHT_ARROW:
// Scroll the iconbar and display results
- _vm.inventory().processInventory(objId == LEFT_ARROW ? INV_LEFT : INV_RIGHT);
+ _vm.inventory().processInventory((objId == LEFT_ARROW) ? INV_LEFT : INV_RIGHT);
_vm.screen().moveImage(_vm.screen().getIconBuffer(), 0, 0, XPIX, INV_DY, XPIX, _vm.screen().getFrontBuffer(), 0, DIBOFF_Y, XPIX);
_vm.screen().moveImage(_vm.screen().getIconBuffer(), 0, 0, XPIX, INV_DY, XPIX, _vm.screen().getBackBuffer(), 0, DIBOFF_Y, XPIX);
_vm.screen().displayList(D_ADD, 0, DIBOFF_Y, XPIX, INV_DY);
@@ -281,7 +281,7 @@
if (objId >= 0) { // Got a match
// Display object name next to cursor (unless CURSOR_NOCHAR)
// Note test for swapped hero name
- name = _vm._arrayNouns[_vm._objects[objId == HERO ? _vm._heroImage : objId].nounIndex][CURSOR_NAME];
+ name = _vm._arrayNouns[(_vm._objects[objId == HERO) ? _vm._heroImage : objId].nounIndex][CURSOR_NAME];
if (name[0] != CURSOR_NOCHAR)
cursorText(name, cx, cy, U_FONT8, _TBRIGHTWHITE);
Modified: scummvm/trunk/engines/hugo/schedule.cpp
===================================================================
--- scummvm/trunk/engines/hugo/schedule.cpp 2010-08-20 16:25:48 UTC (rev 52229)
+++ scummvm/trunk/engines/hugo/schedule.cpp 2010-08-20 16:35:20 UTC (rev 52230)
@@ -47,7 +47,7 @@
namespace Hugo {
-#define SIGN(X) (X < 0 ? -1 : 1)
+#define SIGN(X) ((X < 0) ? -1 : 1)
Scheduler::Scheduler(HugoEngine &vm) : _vm(vm) {
}
Modified: scummvm/trunk/engines/hugo/util.cpp
===================================================================
--- scummvm/trunk/engines/hugo/util.cpp 2010-08-20 16:25:48 UTC (rev 52229)
+++ scummvm/trunk/engines/hugo/util.cpp 2010-08-20 16:35:20 UTC (rev 52230)
@@ -200,7 +200,7 @@
if (HugoEngine::get().getGameStatus().debugFl) {
/* Create/truncate if first call, else append */
- if ((fp = fopen("debug.txt", fp == NULL ? "w" : "a")) == NULL) {
+ if ((fp = fopen("debug.txt", (fp == NULL) ? "w" : "a")) == NULL) {
Error(WRITE_ERR, "debug.txt");
return;
}
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