aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2016-02-14 13:52:05 +0100
committerEugene Sandulenko2016-02-14 17:13:21 +0100
commitc0697f7f2b7bea2b6e4dafb6fa5ac03aa0681638 (patch)
tree08e6a959ee264e10afacf1a5d3311766826e0e54
parentc5a01f3f38aae04cf114db68c27aaadfbe558a88 (diff)
downloadscummvm-rg350-c0697f7f2b7bea2b6e4dafb6fa5ac03aa0681638.tar.gz
scummvm-rg350-c0697f7f2b7bea2b6e4dafb6fa5ac03aa0681638.tar.bz2
scummvm-rg350-c0697f7f2b7bea2b6e4dafb6fa5ac03aa0681638.zip
WAGE: const goodness
-rw-r--r--engines/wage/combat.cpp6
-rw-r--r--engines/wage/util.cpp2
-rw-r--r--engines/wage/wage.h8
-rw-r--r--engines/wage/world.cpp4
4 files changed, 10 insertions, 10 deletions
diff --git a/engines/wage/combat.cpp b/engines/wage/combat.cpp
index 9581c90f0b..c8eee68f19 100644
--- a/engines/wage/combat.cpp
+++ b/engines/wage/combat.cpp
@@ -571,7 +571,7 @@ Common::String *WageEngine::getGroundItemsList(Scene *scene) {
return NULL;
}
-void WageEngine::appendObjNames(Common::String &str, ObjArray &objs) {
+void WageEngine::appendObjNames(Common::String &str, const ObjArray &objs) {
for (uint i = 0; i < objs.size(); i++) {
Obj *obj = objs[i];
@@ -849,7 +849,7 @@ bool WageEngine::handleOfferCommand(const char *target) {
return false;
}
-bool WageEngine::tryAttack(Obj *weapon, Common::String &input) {
+bool WageEngine::tryAttack(const Obj *weapon, const Common::String &input) {
Common::String w(weapon->_name);
w.toLowercase();
Common::String i(input);
@@ -883,7 +883,7 @@ bool WageEngine::handleAttack(Obj *weapon) {
return true;
}
-const char *const WageEngine::getPercentMessage(double percent) {
+const char *WageEngine::getPercentMessage(double percent) {
if (percent < 0.40) {
return "very bad";
} else if (percent < 0.55) {
diff --git a/engines/wage/util.cpp b/engines/wage/util.cpp
index 51fcd2d6ec..2a72960868 100644
--- a/engines/wage/util.cpp
+++ b/engines/wage/util.cpp
@@ -84,7 +84,7 @@ Common::Rect *readRect(Common::SeekableReadStream *in) {
return new Common::Rect(x1, y1, x2, y2);
}
-const char *getIndefiniteArticle(Common::String &word) {
+const char *getIndefiniteArticle(const Common::String &word) {
switch (word[0]) {
case 'a': case 'A':
case 'e': case 'E':
diff --git a/engines/wage/wage.h b/engines/wage/wage.h
index 42749dc311..9e1795bf4d 100644
--- a/engines/wage/wage.h
+++ b/engines/wage/wage.h
@@ -109,7 +109,7 @@ enum {
Common::String readPascalString(Common::SeekableReadStream *in);
Common::Rect *readRect(Common::SeekableReadStream *in);
-const char *getIndefiniteArticle(Common::String &word);
+const char *getIndefiniteArticle(const Common::String &word);
const char *prependGenderSpecificPronoun(int gender);
const char *getGenderSpecificPronoun(int gender, bool capitalize);
@@ -158,7 +158,7 @@ public:
bool handleMoveCommand(Directions dir, const char *dirName);
bool handleLookCommand();
Common::String *getGroundItemsList(Scene *scene);
- void appendObjNames(Common::String &str, ObjArray &objs);
+ void appendObjNames(Common::String &str, const ObjArray &objs);
bool handleInventoryCommand();
bool handleStatusCommand();
bool handleRestCommand();
@@ -172,11 +172,11 @@ public:
void wearObj(Obj *o, int pos);
- bool tryAttack(Obj *weapon, Common::String &input);
+ bool tryAttack(const Obj *weapon, const Common::String &input);
bool handleAttack(Obj *weapon);
void printPlayerCondition(Chr *player);
- const char *const getPercentMessage(double percent);
+ const char *getPercentMessage(double percent);
public:
Common::RandomSource *_rnd;
diff --git a/engines/wage/world.cpp b/engines/wage/world.cpp
index daa2de9867..4a8e5fb741 100644
--- a/engines/wage/world.cpp
+++ b/engines/wage/world.cpp
@@ -385,7 +385,7 @@ Common::String *World::loadStringFromDITL(Common::MacResManager *resMan, int res
return NULL;
}
-bool InvComparator(Obj *l, Obj *r) {
+static bool InvComparator(const Obj *l, const Obj *r) {
return l->_index < r->_index;
}
@@ -402,7 +402,7 @@ void World::move(Obj *obj, Chr *chr) {
_engine->onMove(obj, from, chr);
}
-bool ObjComparator(Obj *o1, Obj *o2) {
+static bool ObjComparator(const Obj *o1, const Obj *o2) {
bool o1Immobile = (o1->_type == Obj::IMMOBILE_OBJECT);
bool o2Immobile = (o2->_type == Obj::IMMOBILE_OBJECT);
if (o1Immobile == o2Immobile) {