summaryrefslogtreecommitdiff
path: root/src/3rdparty
diff options
context:
space:
mode:
authorCharles Pigott <charlespigott@googlemail.com>2020-06-27 09:01:31 +0100
committerCharles Pigott <charlespigott@googlemail.com>2020-06-27 14:51:14 +0100
commit64b1c70fddc8b7ef2e8f629d6e5e1749f21a0e4b (patch)
treeb5bbd4c1701a1ef50892744a4d5f5f27a7f3d3ff /src/3rdparty
parent224acb78b03defd075aafec9d3340b3bc0dcedfc (diff)
downloadopenttd-64b1c70fddc8b7ef2e8f629d6e5e1749f21a0e4b.tar.xz
Codechange: Add WARN_FORMAT to vseprintf and fix the cascade of warnings that followed
Diffstat (limited to 'src/3rdparty')
-rw-r--r--src/3rdparty/squirrel/squirrel/sqcompiler.cpp6
-rw-r--r--src/3rdparty/squirrel/squirrel/sqvm.cpp2
-rw-r--r--src/3rdparty/squirrel/squirrel/sqvm.h2
3 files changed, 5 insertions, 5 deletions
diff --git a/src/3rdparty/squirrel/squirrel/sqcompiler.cpp b/src/3rdparty/squirrel/squirrel/sqcompiler.cpp
index 854d080d2..9eb71d457 100644
--- a/src/3rdparty/squirrel/squirrel/sqcompiler.cpp
+++ b/src/3rdparty/squirrel/squirrel/sqcompiler.cpp
@@ -65,9 +65,9 @@ public:
}
NORETURN static void ThrowError(void *ud, const SQChar *s) {
SQCompiler *c = (SQCompiler *)ud;
- c->Error(s);
+ c->Error("%s", s);
}
- NORETURN void Error(const SQChar *s, ...)
+ NORETURN void Error(const SQChar *s, ...) WARN_FORMAT(2, 3)
{
static SQChar temp[256];
va_list vl;
@@ -122,7 +122,7 @@ public:
}
Error("expected '%s'", etypename);
}
- Error("expected '%c'", tok);
+ Error("expected '%c'", (char)tok);
}
}
SQObjectPtr ret;
diff --git a/src/3rdparty/squirrel/squirrel/sqvm.cpp b/src/3rdparty/squirrel/squirrel/sqvm.cpp
index 03ffea230..ee1acbf32 100644
--- a/src/3rdparty/squirrel/squirrel/sqvm.cpp
+++ b/src/3rdparty/squirrel/squirrel/sqvm.cpp
@@ -94,7 +94,7 @@ bool SQVM::ARITH_OP(SQUnsignedInteger op,SQObjectPtr &trg,const SQObjectPtr &o1,
if(!StringCat(o1, o2, trg)) return false;
}
else if(!ArithMetaMethod(op,o1,o2,trg)) {
- Raise_Error("arith op %c on between '%s' and '%s'",op,GetTypeName(o1),GetTypeName(o2)); return false;
+ Raise_Error("arith op %c on between '%s' and '%s'",(char)op,GetTypeName(o1),GetTypeName(o2)); return false;
}
}
return true;
diff --git a/src/3rdparty/squirrel/squirrel/sqvm.h b/src/3rdparty/squirrel/squirrel/sqvm.h
index 97557b133..9c8e986fb 100644
--- a/src/3rdparty/squirrel/squirrel/sqvm.h
+++ b/src/3rdparty/squirrel/squirrel/sqvm.h
@@ -81,7 +81,7 @@ public:
SQString *PrintObjVal(const SQObject &o);
- void Raise_Error(const SQChar *s, ...);
+ void Raise_Error(const SQChar *s, ...) WARN_FORMAT(2, 3);
void Raise_Error(SQObjectPtr &desc);
void Raise_IdxError(const SQObject &o);
void Raise_CompareError(const SQObject &o1, const SQObject &o2);