summaryrefslogtreecommitdiff
path: root/src/3rdparty/squirrel
diff options
context:
space:
mode:
authorCharles Pigott <charlespigott@googlemail.com>2018-05-13 18:34:57 +0100
committerfrosch <github@elsenhans.name>2018-06-27 22:54:46 +0200
commit5f86e1a390b4aa9510d43f97251484ca67934f1c (patch)
tree8a9a74e4beeefb3ebe5585f0f10aac80d2ba078a /src/3rdparty/squirrel
parente1b9187e9b39ff2ce1982a8fbcb4f2a018662ce7 (diff)
downloadopenttd-5f86e1a390b4aa9510d43f97251484ca67934f1c.tar.xz
Codechange: Silence -Wclass-memaccess warnings with GCC8
Diffstat (limited to 'src/3rdparty/squirrel')
-rw-r--r--src/3rdparty/squirrel/squirrel/squtils.h2
-rw-r--r--src/3rdparty/squirrel/squirrel/sqvm.cpp6
2 files changed, 3 insertions, 5 deletions
diff --git a/src/3rdparty/squirrel/squirrel/squtils.h b/src/3rdparty/squirrel/squirrel/squtils.h
index 28c6cbec2..b1138dcb1 100644
--- a/src/3rdparty/squirrel/squirrel/squtils.h
+++ b/src/3rdparty/squirrel/squirrel/squtils.h
@@ -90,7 +90,7 @@ public:
{
_vals[idx].~T();
if(idx < (_size - 1)) {
- memmove(&_vals[idx], &_vals[idx+1], sizeof(T) * (_size - (size_t)idx - 1));
+ memmove(static_cast<void *>(&_vals[idx]), &_vals[idx+1], sizeof(T) * (_size - (size_t)idx - 1));
}
_size--;
}
diff --git a/src/3rdparty/squirrel/squirrel/sqvm.cpp b/src/3rdparty/squirrel/squirrel/sqvm.cpp
index c66c4aca5..03ffea230 100644
--- a/src/3rdparty/squirrel/squirrel/sqvm.cpp
+++ b/src/3rdparty/squirrel/squirrel/sqvm.cpp
@@ -378,8 +378,7 @@ bool SQVM::StartCall(SQClosure *closure,SQInteger target,SQInteger args,SQIntege
}
if (!tailcall) {
- CallInfo lc;
- memset(&lc, 0, sizeof(lc));
+ CallInfo lc = {};
lc._generator = NULL;
lc._etraps = 0;
lc._prevstkbase = (SQInt32) ( stackbase - _stackbase );
@@ -1159,8 +1158,7 @@ bool SQVM::CallNative(SQNativeClosure *nclosure,SQInteger nargs,SQInteger stackb
SQInteger oldtop = _top;
SQInteger oldstackbase = _stackbase;
_top = stackbase + nargs;
- CallInfo lci;
- memset(&lci, 0, sizeof(lci));
+ CallInfo lci = {};
lci._closure = nclosure;
lci._generator = NULL;
lci._etraps = 0;