From 09f97a3422f82f4de6c59406d0337d0667d2a591 Mon Sep 17 00:00:00 2001 From: Matei Date: Mon, 11 Aug 2008 04:18:10 +0000 Subject: [PATCH] Some fixes for OS X: - Find enet properly - Type conversion of size_t's in JS This was SVN commit r6324. --- build/premake/extern_libs.lua | 1 + source/graphics/MapWriter.cpp | 4 ++-- source/network/NetSession.h | 2 +- source/ps/CConsole.cpp | 2 +- source/scripting/SynchedJSObject.cpp | 4 ++-- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/build/premake/extern_libs.lua b/build/premake/extern_libs.lua index 59719f4929..4a3ac620c1 100644 --- a/build/premake/extern_libs.lua +++ b/build/premake/extern_libs.lua @@ -92,6 +92,7 @@ extern_lib_defs = { tinsert(package.config["Testing"].links, "enet_dbg") tinsert(package.config["Release"].links, "enet") else + tinsert(package.includepaths, libraries_dir.."enet/include") tinsert(package.linkoptions, "-lenet") end end, diff --git a/source/graphics/MapWriter.cpp b/source/graphics/MapWriter.cpp index ea5c84845b..12d1484f5e 100644 --- a/source/graphics/MapWriter.cpp +++ b/source/graphics/MapWriter.cpp @@ -269,10 +269,10 @@ void CMapWriter::WriteXML(const char* filename, continue; XML_Element("Entity"); - XML_Attribute("uid", (*unit)->GetID()); + XML_Attribute("uid", (unsigned) (*unit)->GetID()); XML_Setting("Template", entity->m_base->m_Tag); - XML_Setting("Player", entity->GetPlayer()->GetPlayerID()); + XML_Setting("Player", (unsigned) entity->GetPlayer()->GetPlayerID()); { CVector3D position = entity->m_position; diff --git a/source/network/NetSession.h b/source/network/NetSession.h index 8d0a8063bf..a81a14bb8f 100644 --- a/source/network/NetSession.h +++ b/source/network/NetSession.h @@ -15,7 +15,7 @@ #include "ps/GameAttributes.h" #include "ps/Player.h" #include "fsm.h" -#include "enet/enet.h" +#include #include diff --git a/source/ps/CConsole.cpp b/source/ps/CConsole.cpp index 6d0be8e80a..82d978e163 100644 --- a/source/ps/CConsole.cpp +++ b/source/ps/CConsole.cpp @@ -740,7 +740,7 @@ void CConsole::SaveHistory() { WriteBuffer buffer; const int linesToSkip = (int)m_deqBufHistory.size() - m_MaxHistoryLines; - std::deque::const_reverse_iterator it = m_deqBufHistory.rbegin(); + std::deque::reverse_iterator it = m_deqBufHistory.rbegin(); if(linesToSkip > 0) std::advance(it, linesToSkip); for (; it != m_deqBufHistory.rend(); ++it) diff --git a/source/scripting/SynchedJSObject.cpp b/source/scripting/SynchedJSObject.cpp index 6d5246893b..12eea823ab 100644 --- a/source/scripting/SynchedJSObject.cpp +++ b/source/scripting/SynchedJSObject.cpp @@ -5,13 +5,13 @@ #include "ScriptCustomTypes.h" template <> -CStrW ToNetString(const unsigned &val) +CStrW ToNetString(const size_t &val) { return CStrW(val); } template <> -void SetFromNetString(unsigned &val, const CStrW& string) +void SetFromNetString(size_t &val, const CStrW& string) { val=string.ToUInt(); }