From 5f86e1a390b4aa9510d43f97251484ca67934f1c Mon Sep 17 00:00:00 2001 From: Charles Pigott Date: Sun, 13 May 2018 18:34:57 +0100 Subject: Codechange: Silence -Wclass-memaccess warnings with GCC8 --- src/3rdparty/squirrel/squirrel/squtils.h | 2 +- src/3rdparty/squirrel/squirrel/sqvm.cpp | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'src/3rdparty/squirrel') 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(&_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; -- cgit v1.2.3-70-g09d2