aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2019-07-01 12:12:05 +0200
committerEugene Sandulenko2019-09-03 17:17:06 +0200
commitf9c560fd9a5630e25280150dbeca049a9ffaec24 (patch)
treec1c8b34bf2edcbf6e35cef02b41205bb8432205a
parent2cd3bbe2304117a8c0a4cb27f365814c2c9f6f58 (diff)
downloadscummvm-rg350-f9c560fd9a5630e25280150dbeca049a9ffaec24.tar.gz
scummvm-rg350-f9c560fd9a5630e25280150dbeca049a9ffaec24.tar.bz2
scummvm-rg350-f9c560fd9a5630e25280150dbeca049a9ffaec24.zip
HDB: Fix warnings, const'ness
-rw-r--r--engines/hdb/ai-funcs.cpp2
-rw-r--r--engines/hdb/ai-inventory.cpp2
-rw-r--r--engines/hdb/ai-lists.cpp2
-rw-r--r--engines/hdb/ai.h6
-rw-r--r--engines/hdb/lua-script.cpp16
5 files changed, 14 insertions, 14 deletions
diff --git a/engines/hdb/ai-funcs.cpp b/engines/hdb/ai-funcs.cpp
index a59e468b95..da4efc0d49 100644
--- a/engines/hdb/ai-funcs.cpp
+++ b/engines/hdb/ai-funcs.cpp
@@ -24,7 +24,7 @@
namespace HDB {
-AIEntity *AI::spawn(AIType type, AIDir dir, int x, int y, char *funcInit, char *funcAction, char *funcUse, AIDir dir2, int level, int value1, int value2, int callInit) {
+AIEntity *AI::spawn(AIType type, AIDir dir, int x, int y, const char *funcInit, const char *funcAction, const char *funcUse, AIDir dir2, int level, int value1, int value2, int callInit) {
AIEntity *e = new AIEntity;
e->type = type;
diff --git a/engines/hdb/ai-inventory.cpp b/engines/hdb/ai-inventory.cpp
index 0325d3b696..48ce48fb5a 100644
--- a/engines/hdb/ai-inventory.cpp
+++ b/engines/hdb/ai-inventory.cpp
@@ -243,7 +243,7 @@ bool AI::removeInvItemType(AIType which, int amount) {
return true;
}
-bool AI::addItemToInventory(AIType type, int amount, char *funcInit, char *funcAction, char *funcUse) {
+bool AI::addItemToInventory(AIType type, int amount, const char *funcInit, const char *funcAction, const char *funcUse) {
int i;
AIEntity *e;
for (i = 0; i < amount; i++) {
diff --git a/engines/hdb/ai-lists.cpp b/engines/hdb/ai-lists.cpp
index ff0ecfb3fa..b60013a38b 100644
--- a/engines/hdb/ai-lists.cpp
+++ b/engines/hdb/ai-lists.cpp
@@ -762,7 +762,7 @@ bool AI::checkTriggerList(char *entName, int x, int y) {
return false;
}
-void AI::killTrigger(char *id) {
+void AI::killTrigger(const char *id) {
for (Common::Array<Trigger *>::iterator it = _triggerList->begin(); it != _triggerList->end(); it++) {
if (!scumm_stricmp(id, (*it)->id))
_triggerList->erase(it);
diff --git a/engines/hdb/ai.h b/engines/hdb/ai.h
index 4e424870e9..bf6503fb05 100644
--- a/engines/hdb/ai.h
+++ b/engines/hdb/ai.h
@@ -734,7 +734,7 @@ public:
void initAnimInfo();
// Entity Functions
- AIEntity *spawn(AIType type, AIDir dir, int x, int y, char *funcInit, char *funcAction, char *funcUse, AIDir dir2, int level, int value1, int value2, int callInit);
+ AIEntity *spawn(AIType type, AIDir dir, int x, int y, const char *funcInit, const char *funcAction, const char *funcUse, AIDir dir2, int level, int value1, int value2, int callInit);
bool cacheEntGfx(AIEntity *e, bool init);
void stopEntity(AIEntity *e);
AIEntity *locateEntity(const char *luaName);
@@ -798,7 +798,7 @@ public:
ArrowPath *findArrowPath(int x, int y);
void addToTriggerList(char *luaFuncInit, char *luaFuncUse, int x, int y, int value1, int value2, char *id);
bool checkTriggerList(char *entName, int x, int y);
- void killTrigger(char *id);
+ void killTrigger(const char *id);
void floatEntity(AIEntity *e, AIState state);
bool checkFloating(int x, int y);
@@ -955,7 +955,7 @@ public:
bool removeInvItem(const char *string, int amount);
int queryInventoryType(AIType which);
bool removeInvItemType(AIType which, int amount);
- bool addItemToInventory(AIType type, int amount, char *funcInit, char *funcAction, char *funcUse);
+ bool addItemToInventory(AIType type, int amount, const char *funcInit, const char *funcAction, const char *funcUse);
void keepInvItem(AIType type);
void printYouGotMsg(const char *name);
diff --git a/engines/hdb/lua-script.cpp b/engines/hdb/lua-script.cpp
index 40582a54f7..72214b0233 100644
--- a/engines/hdb/lua-script.cpp
+++ b/engines/hdb/lua-script.cpp
@@ -651,7 +651,7 @@ static int dialog(lua_State *L) {
lua_pop(L, 4);
if (string)
- g_hdb->_window->openDialog(title, (int)tileIndex, string, (int)more, more);
+ g_hdb->_window->openDialog(title, (int)tileIndex, string, more ? 1 : 0, more);
return 0;
}
@@ -718,9 +718,9 @@ static int spawnEntity(lua_State *L) {
double dir = lua_tonumber(L, 2);
double x = lua_tonumber(L, 3);
double y = lua_tonumber(L, 4);
- char *funcInit = (char *)lua_tostring(L, 5);
- char *funcAction = (char *)lua_tostring(L, 6);
- char *funcUse = (char *)lua_tostring(L, 7);
+ const char *funcInit = lua_tostring(L, 5);
+ const char *funcAction = lua_tostring(L, 6);
+ const char *funcUse = lua_tostring(L, 7);
double dir2 = lua_tonumber(L, 8);
double level = lua_tonumber(L, 9);
double value1 = lua_tonumber(L, 10);
@@ -741,9 +741,9 @@ static int spawnEntity(lua_State *L) {
static int addInvItem(lua_State *L) {
double type = lua_tonumber(L, 1);
double amount = lua_tonumber(L, 2);
- char *funcInit = (char *)lua_tostring(L, 3);
- char *funcAction = (char *)lua_tostring(L, 4);
- char *funcUse = (char *)lua_tostring(L, 5);
+ const char *funcInit = lua_tostring(L, 3);
+ const char *funcAction = lua_tostring(L, 4);
+ const char *funcUse = lua_tostring(L, 5);
int t = (int)type;
@@ -838,7 +838,7 @@ static int removeInvItem(lua_State *L) {
}
static int killTrigger(lua_State *L) {
- char *id = (char *)lua_tostring(L, 1);
+ const char *id = lua_tostring(L, 1);
g_hdb->_lua->checkParameters("killTrigger", 1);