[Scummvm-git-logs] scummvm master -> 8612a95494e42972d896db308ae3faca7a31ce71
mduggan
mgithub at guarana.org
Thu Mar 4 08:13:32 UTC 2021
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
8612a95494 PRIVATE: Fix compiler warnings
Commit: 8612a95494e42972d896db308ae3faca7a31ce71
https://github.com/scummvm/scummvm/commit/8612a95494e42972d896db308ae3faca7a31ce71
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2021-03-04T17:13:20+09:00
Commit Message:
PRIVATE: Fix compiler warnings
Changed paths:
engines/private/funcs.cpp
engines/private/grammar.h
engines/private/private.h
engines/private/symbol.cpp
engines/private/symbol.h
diff --git a/engines/private/funcs.cpp b/engines/private/funcs.cpp
index 15fa03e10e..ef620734c0 100644
--- a/engines/private/funcs.cpp
+++ b/engines/private/funcs.cpp
@@ -507,7 +507,7 @@ void fBitmap(ArgArray args) {
int x = 0;
int y = 0;
- char *f = args[0].u.str;
+ const char *f = args[0].u.str;
if (args.size() == 3) {
x = args[1].u.val;
y = args[2].u.val;
@@ -523,8 +523,8 @@ void _fMask(ArgArray args, bool drawn) {
int x = 0;
int y = 0;
- char *f = args[0].u.str;
- char *e = args[1].u.str;
+ const char *f = args[0].u.str;
+ const char *e = args[1].u.str;
Common::String *c = args[2].u.sym->name;
if (args.size() == 5) {
@@ -553,7 +553,7 @@ void fMaskDrawn(ArgArray args) {
_fMask(args, true);
}
-void fAddSound(Common::String sound, char *t, Symbol *flag = NULL, int val = 0) {
+static void fAddSound(Common::String sound, const char *t, Symbol *flag = NULL, int val = 0) {
if (sound == "\"\"")
return;
@@ -755,7 +755,7 @@ FuncTable funcTable[] = {
{ 0, 0}
};
-void call(char *name, ArgArray args) {
+void call(const char *name, ArgArray args) {
Common::String n(name);
if (!g_private->_functions.contains(n)) {
error("I don't know how to execute %s", name);
diff --git a/engines/private/grammar.h b/engines/private/grammar.h
index a71b97a120..d1cd6b5bb0 100644
--- a/engines/private/grammar.h
+++ b/engines/private/grammar.h
@@ -42,7 +42,7 @@ typedef struct Datum { /* interpreter stack type */
short type;
union {
int val;
- char *str;
+ const char *str;
Symbol *sym;
Common::Rect *rect;
} u;
@@ -87,7 +87,7 @@ extern SettingMaps *g_setts;
// Funtions
typedef Common::Array<Datum> ArgArray;
-void call(char *, ArgArray);
+void call(const char *, ArgArray);
// Code Generation and Execution
diff --git a/engines/private/private.h b/engines/private/private.h
index 52318d1d78..9c5059957b 100644
--- a/engines/private/private.h
+++ b/engines/private/private.h
@@ -37,7 +37,7 @@ class ImageDecoder;
}
namespace Graphics {
-struct ManagedSurface;
+class ManagedSurface;
}
struct ADGameDescription;
diff --git a/engines/private/symbol.cpp b/engines/private/symbol.cpp
index f39a451ff5..e81fcb4e1a 100644
--- a/engines/private/symbol.cpp
+++ b/engines/private/symbol.cpp
@@ -78,7 +78,7 @@ Symbol *lookup(Common::String s, SymbolMap symlist) {
}
/* install some symbol s in a symbol table */
-Symbol *install(Common::String *n, int t, int d, char *s, Common::Rect *r, SymbolMap *symlist) {
+static Symbol *install(Common::String *n, int t, int d, const char *s, Common::Rect *r, SymbolMap *symlist) {
Common::String *name = new Common::String(*n);
Symbol *sp;
@@ -122,7 +122,7 @@ Symbol *SymbolMaps::lookupName(char *n) {
else {
debugC(1, kPrivateDebugCode, "WARNING: %s not defined", s->c_str());
- return constant(STRING, 0, (char *)s->c_str());
+ return constant(STRING, 0, s->c_str());
}
}
@@ -139,7 +139,7 @@ void SymbolMaps::installAll(char *n) {
//debug("name %s", s->c_str());
if (strcmp(n, "settings") == 0) {
assert(r == NULL);
- install(s, STRING, 0, (char *)s->c_str(), r, &settings);
+ install(s, STRING, 0, s->c_str(), r, &settings);
} else if (strcmp(n, "variables") == 0) {
assert(r == NULL);
install(s, NAME, 0, NULL, r, &variables);
@@ -159,7 +159,7 @@ void SymbolMaps::installAll(char *n) {
}
}
-Symbol *SymbolMaps::constant(int t, int d, char *s) {
+Symbol *SymbolMaps::constant(int t, int d, const char *s) {
Symbol *sp;
Common::String *n = new Common::String("<constant>");
diff --git a/engines/private/symbol.h b/engines/private/symbol.h
index 6df245ae66..4f613f4699 100644
--- a/engines/private/symbol.h
+++ b/engines/private/symbol.h
@@ -38,7 +38,7 @@ typedef struct Symbol { /* symbol table entry */
short type; /* NAME, NUM, STRING or RECT */
union {
int val; /* NAME or NUM */
- char *str; /* STRING */
+ const char *str; /* STRING */
Common::Rect *rect; /* RECT */
} u;
} Symbol;
@@ -70,7 +70,7 @@ public:
NameList variableList;
NameList locationList;
- Symbol *constant(int t, int d, char *s);
+ Symbol *constant(int t, int d, const char *s);
Symbol *lookupName(char *n);
void installAll(char *n);
void defineSymbol(char *, Common::Rect *);
More information about the Scummvm-git-logs
mailing list