forked from Mirrors/openclonk
Fixed compilation in MSVC2010
parent
1a933780d4
commit
a53dae0c1b
|
@ -19,6 +19,7 @@
|
|||
*/
|
||||
// Loads StringTbl* and replaces $..$-strings by localized versions
|
||||
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
#include "C4Include.h"
|
||||
#include "C4LangStringTable.h"
|
||||
|
@ -170,7 +171,7 @@ void C4LangStringTable::ReplaceStrings(const StdStrBuf &rBuf, StdStrBuf &rTarget
|
|||
|
||||
// assign this buf
|
||||
rTarget.Clear();
|
||||
rTarget.Take(sNewBuf);
|
||||
rTarget.Take(std::move(sNewBuf));
|
||||
}
|
||||
|
||||
void C4LangStringTable::ReplaceStrings(StdStrBuf &rBuf)
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
#include <C4Network2.h>
|
||||
#include <C4Language.h>
|
||||
|
||||
#include <utility>
|
||||
#include <StdFile.h>
|
||||
#include <StdWindow.h>
|
||||
#include <StdRegistry.h>
|
||||
|
@ -881,7 +882,7 @@ void C4Config::ForceRelativePath(StdStrBuf *sFilename)
|
|||
{
|
||||
// return relative path
|
||||
StdStrBuf sTemp; sTemp.Copy(szRelative);
|
||||
sFilename->Take(sTemp);
|
||||
sFilename->Take(std::move(sTemp));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -890,7 +891,7 @@ void C4Config::ForceRelativePath(StdStrBuf *sFilename)
|
|||
{
|
||||
// then shorten it (e.g. C:\Temp\Missions.c4f\Goldmine.c4s to Missions.c4f\Goldmine.c4s)
|
||||
StdStrBuf sTemp; sTemp.Copy(GetC4Filename(sFilename->getData()));
|
||||
sFilename->Take(sTemp);
|
||||
sFilename->Take(std::move(sTemp));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
*/
|
||||
// IRC client dialog
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "C4Include.h"
|
||||
#include "C4ChatDlg.h"
|
||||
|
||||
|
@ -802,7 +804,7 @@ void C4ChatControl::UpdateTitle()
|
|||
// call update proc only if title changed
|
||||
if (sTitle != sNewTitle)
|
||||
{
|
||||
sTitle.Take(sNewTitle);
|
||||
sTitle.Take(std::move(sNewTitle));
|
||||
if (pTitleChangeBC) pTitleChangeBC->OnOK(sTitle);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
*/
|
||||
// script-controlled InGame dialog to show player infos
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "C4Include.h"
|
||||
#include "C4Scoreboard.h"
|
||||
#include "C4Gui.h"
|
||||
|
@ -31,9 +33,9 @@
|
|||
|
||||
void C4Scoreboard::Entry::SwapWith(Entry *pSwap)
|
||||
{
|
||||
Entry swp; swp.Text.Take(Text); swp.iVal = iVal;
|
||||
Text.Take(pSwap->Text); iVal = pSwap->iVal;
|
||||
pSwap->Text.Take(swp.Text); pSwap->iVal = swp.iVal;
|
||||
Entry swp; swp.Text.Take(std::move(Text)); swp.iVal = iVal;
|
||||
Text.Take(std::move(pSwap->Text)); iVal = pSwap->iVal;
|
||||
pSwap->Text.Take(std::move(swp.Text)); pSwap->iVal = swp.iVal;
|
||||
}
|
||||
|
||||
void C4Scoreboard::Clear()
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#ifndef INC_C4Scoreboard
|
||||
#define INC_C4Scoreboard
|
||||
|
||||
#include <utility>
|
||||
#include "C4Gui.h"
|
||||
#include "C4StringTable.h"
|
||||
|
||||
|
@ -36,7 +37,7 @@ class C4Scoreboard
|
|||
|
||||
Entry() : Text(), iVal(0) { }
|
||||
void GrabFrom(Entry *pFrom) // grab data w/o copy
|
||||
{ Text.Take(pFrom->Text); iVal = pFrom->iVal; }
|
||||
{ Text.Take(std::move(pFrom->Text)); iVal = pFrom->iVal; }
|
||||
void SwapWith(Entry *pSwap);
|
||||
};
|
||||
private:
|
||||
|
|
|
@ -22,6 +22,8 @@
|
|||
// Startup screen for non-parameterized engine start: Player selection dialog
|
||||
// Also contains player creation, editing and crew management
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include <C4Include.h>
|
||||
#include <C4StartupPlrSelDlg.h>
|
||||
|
||||
|
@ -930,7 +932,7 @@ bool C4StartupPlrSelDlg::CheckPlayerName(const StdStrBuf &Playername, StdStrBuf
|
|||
Playername.getData()).getData(), "", C4GUI::Ico_Error);
|
||||
return false;
|
||||
}
|
||||
Filename.Take(Path);
|
||||
Filename.Take(std::move(Path));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#ifndef INC_C4StartupPlrSelDlg
|
||||
#define INC_C4StartupPlrSelDlg
|
||||
|
||||
#include <utility>
|
||||
#include "C4Startup.h"
|
||||
#include "C4InfoCore.h"
|
||||
|
||||
|
@ -89,7 +90,7 @@ class C4StartupPlrSelDlg : public C4StartupDlg
|
|||
class LoadError : public StdStrBuf
|
||||
{
|
||||
public:
|
||||
LoadError(StdStrBuf RREF rTakeFrom) { Take(rTakeFrom); }
|
||||
LoadError(StdStrBuf RREF rTakeFrom) { Take(std::move(rTakeFrom)); }
|
||||
}; // class thrown off load function if load failed
|
||||
};
|
||||
|
||||
|
|
|
@ -79,6 +79,11 @@ typedef __int32 intptr_t;
|
|||
#else
|
||||
#error Could not find integer datatypes!
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#else
|
||||
typedef ptrdiff_t ssize_t;
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__)
|
||||
// Allow checks for correct printf-usage
|
||||
|
@ -102,6 +107,7 @@ typedef __int32 intptr_t;
|
|||
# define RREF &&
|
||||
#else
|
||||
# define RREF &
|
||||
namespace std { template<typename T> inline T &move (T &t) { return t; } }
|
||||
#endif
|
||||
|
||||
#if defined(_DEBUG) && defined(_MSC_VER)
|
||||
|
|
|
@ -259,7 +259,7 @@ int StdStrBuf::Replace(const char *szOld, const char *szNew, size_t iStartSearch
|
|||
szRPos = szRNextPos;
|
||||
}
|
||||
strcpy(szWrite, szRPos);
|
||||
Take(sResult);
|
||||
Take(std::move(sResult));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -418,7 +418,7 @@ void StdStrBuf::EnsureUnicode()
|
|||
j += strlen(extra_chars[c - 0x80]);
|
||||
}
|
||||
buf.SetLength(j);
|
||||
Take(buf);
|
||||
Take(std::move(buf));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include <stdarg.h>
|
||||
#include <utility>
|
||||
|
||||
// debug memory management
|
||||
#if defined(_DEBUG) && defined(_MSC_VER)
|
||||
|
@ -53,7 +54,7 @@ public:
|
|||
if(fCopy)
|
||||
Copy(Buf2);
|
||||
else if(!Buf2.isRef())
|
||||
Take(Buf2);
|
||||
Take(std::move(Buf2));
|
||||
else
|
||||
Ref(Buf2);
|
||||
}
|
||||
|
@ -315,7 +316,7 @@ public:
|
|||
// Set (as constructor: take if possible)
|
||||
StdBuf &operator = (StdBuf RREF Buf2)
|
||||
{
|
||||
if(Buf2.isRef()) Ref(Buf2); else Take(Buf2);
|
||||
if(Buf2.isRef()) Ref(Buf2); else Take(std::move(Buf2));
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
@ -443,7 +444,7 @@ public:
|
|||
|
||||
void Ref(const StdStrBuf &Buf2) { StdBuf::Ref(Buf2.getData(), Buf2.getSize()); }
|
||||
StdStrBuf getRef() const { return StdStrBuf(getData(), getLength()); }
|
||||
void Take(StdStrBuf RREF Buf2) { StdBuf::Take(Buf2); }
|
||||
void Take(StdStrBuf RREF Buf2) { StdBuf::Take(std::move(Buf2)); }
|
||||
|
||||
void Clear() { StdBuf::Clear(); }
|
||||
void Copy() { StdBuf::Copy(); }
|
||||
|
|
|
@ -713,7 +713,7 @@ void StdCompilerINIRead::CreateNameTree()
|
|||
(pName->LastChild ? pName->LastChild->NextChild : pName->FirstChild) =
|
||||
new NameNode(pName);
|
||||
pName->PrevChild = pPrev;
|
||||
pName->Name.Take(Name);
|
||||
pName->Name.Take(std::move(Name));
|
||||
pName->Pos = pPos;
|
||||
pName->Indent = iIndent;
|
||||
pName->Section = fSection;
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include "C4Constants.h"
|
||||
#include "C4Config.h"
|
||||
|
||||
#include <utility>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
|
@ -2820,7 +2821,7 @@ bool C4NetIOUDP::Peer::SendDirect(C4NetIOPacket RREF rPacket) // (mt-safe)
|
|||
// count outgoing
|
||||
{ CStdLock StatLock(&StatCSec); iORate += rPacket.getSize() + iUDPHeaderSize; }
|
||||
// forward call
|
||||
return pParent->SendDirect(rPacket);
|
||||
return pParent->SendDirect(std::move(rPacket));
|
||||
}
|
||||
|
||||
void C4NetIOUDP::Peer::OnConn()
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
* "Clonk" is a registered trademark of Matthes Bender.
|
||||
* See clonk_trademark_license.txt for full license.
|
||||
*/
|
||||
#include <utility>
|
||||
|
||||
#include <C4Include.h>
|
||||
#include <C4Network2.h>
|
||||
#include <C4Version.h>
|
||||
|
@ -2388,7 +2390,7 @@ bool C4Network2::LeaguePlrAuth(C4PlayerInfo *pInfo)
|
|||
|
||||
// Try given account name as default next time
|
||||
if(AccountMaster.getLength())
|
||||
Account.Take(AccountMaster);
|
||||
Account.Take(std::move(AccountMaster));
|
||||
|
||||
// safety (modal dlg may have deleted network)
|
||||
if (!pLeagueClient) return false;
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include "C4Version.h"
|
||||
#include "C4Network2Reference.h"
|
||||
|
||||
#include <utility>
|
||||
#include <fcntl.h>
|
||||
#include <zlib.h>
|
||||
|
||||
|
@ -374,7 +375,7 @@ bool C4Network2HTTPClient::Decompress(StdBuf *pData)
|
|||
}
|
||||
// Return the buffer
|
||||
Out.SetSize(zstrm.total_out);
|
||||
pData->Take(Out);
|
||||
pData->Take(std::move(Out));
|
||||
// Okay
|
||||
inflateEnd(&zstrm);
|
||||
return true;
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
*/
|
||||
// parses scripts
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include <C4Include.h>
|
||||
#include <C4Aul.h>
|
||||
|
||||
|
@ -353,7 +355,7 @@ void C4AulScriptFunc::ParseDesc()
|
|||
// Long Description
|
||||
else if(SEqual2(DPos0, C4AUL_Desc))
|
||||
{
|
||||
DescLong.Take(Val);
|
||||
DescLong.Take(std::move(Val));
|
||||
}
|
||||
// unrecognized? never mind
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ C4String::C4String(StdStrBuf strString)
|
|||
: iRefCnt(0)
|
||||
{
|
||||
// take string
|
||||
Data.Take(strString);
|
||||
Data.Take(std::move(strString));
|
||||
Hash = C4Set<C4String*>::Hash(Data.getData());
|
||||
// reg
|
||||
Strings.Set.Add(this);
|
||||
|
|
Loading…
Reference in New Issue