summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Pigott <charlespigott@googlemail.com>2019-06-29 21:57:26 +0100
committerCharles Pigott <charlespigott@googlemail.com>2019-09-30 14:00:06 +0100
commit6378a7881793ea3e3562a9e3e06299a49af18050 (patch)
tree9a7d5d9213feff03354966ced2cfa975904ec6ae
parent99f5e294841ba525c0936b9c75edb821e2d0294f (diff)
downloadopenttd-6378a7881793ea3e3562a9e3e06299a49af18050.tar.xz
Codechange: Explicitly move a few variables to avoid a copy constructor (fixes warning from clang)
-rw-r--r--src/3rdparty/squirrel/squirrel/sqcompiler.cpp2
-rw-r--r--src/3rdparty/squirrel/squirrel/sqfuncstate.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/3rdparty/squirrel/squirrel/sqcompiler.cpp b/src/3rdparty/squirrel/squirrel/sqcompiler.cpp
index ace9d201e..854d080d2 100644
--- a/src/3rdparty/squirrel/squirrel/sqcompiler.cpp
+++ b/src/3rdparty/squirrel/squirrel/sqcompiler.cpp
@@ -142,7 +142,7 @@ public:
break;
}
Lex();
- return ret;
+ return std::move(ret);
}
bool IsEndOfStatement() { return ((_lex._prevtoken == '\n') || (_token == SQUIRREL_EOB) || (_token == '}') || (_token == ';')); }
void OptionalSemicolon()
diff --git a/src/3rdparty/squirrel/squirrel/sqfuncstate.cpp b/src/3rdparty/squirrel/squirrel/sqfuncstate.cpp
index 5415b566e..c8548bac3 100644
--- a/src/3rdparty/squirrel/squirrel/sqfuncstate.cpp
+++ b/src/3rdparty/squirrel/squirrel/sqfuncstate.cpp
@@ -502,14 +502,14 @@ SQObject SQFuncState::CreateString(const SQChar *s,SQInteger len)
{
SQObjectPtr ns(SQString::Create(_sharedstate,s,len));
_table(_strings)->NewSlot(ns,(SQInteger)1);
- return ns;
+ return std::move(ns);
}
SQObject SQFuncState::CreateTable()
{
SQObjectPtr nt(SQTable::Create(_sharedstate,0));
_table(_strings)->NewSlot(nt,(SQInteger)1);
- return nt;
+ return std::move(nt);
}
SQFunctionProto *SQFuncState::BuildProto()