1
0
forked from 0ad/0ad

Fix tests, and warnings, and non-PCH build

This was SVN commit r10801.
This commit is contained in:
Ykkrosh 2011-12-23 13:01:29 +00:00
parent 779278d376
commit 4f6f0b7baf
6 changed files with 17 additions and 11 deletions

View File

@ -18,6 +18,8 @@
#ifndef NETFILETRANSFER_H #ifndef NETFILETRANSFER_H
#define NETFILETRANSFER_H #define NETFILETRANSFER_H
#include <map>
class CNetMessage; class CNetMessage;
class CNetClientSession; class CNetClientSession;
class CNetServerSession; class CNetServerSession;
@ -61,7 +63,7 @@ public:
u32 m_RequestID; u32 m_RequestID;
size_t m_Length; size_t m_Length;
std::string m_Buffer; std::string m_Buffer;
}; };
@ -128,4 +130,4 @@ private:
double m_LastProgressReportTime; double m_LastProgressReportTime;
}; };
#endif // NETFILETRANSFER_H #endif // NETFILETRANSFER_H

View File

@ -30,8 +30,8 @@
#include "lib/utf8.h" #include "lib/utf8.h"
#include "lib/byte_order.h" #include "lib/byte_order.h"
#include "network/Serialization.h" #include "network/Serialization.h"
#include <cassert>
#include <iomanip>
#include <sstream> #include <sstream>
#define UNIDOUBLER_HEADER "CStr.cpp" #define UNIDOUBLER_HEADER "CStr.cpp"
@ -356,9 +356,9 @@ CStr CStr::UnescapeBackslashes() const
return NewString; return NewString;
} }
CStr8 CStr::EscapeToPrintableASCII() const std::string CStr::EscapeToPrintableASCII() const
{ {
CStr8 NewString; std::string NewString;
for (size_t i = 0; i < length(); i++) for (size_t i = 0; i < length(); i++)
{ {
tchar ch = (*this)[i]; tchar ch = (*this)[i];

View File

@ -313,7 +313,7 @@ public:
/** /**
* Convert strings to printable ASCII characters with JSON-style escapes. * Convert strings to printable ASCII characters with JSON-style escapes.
*/ */
CStr8 EscapeToPrintableASCII() const; std::string EscapeToPrintableASCII() const;
/** /**
* Return a trimmed copy of the CStr. * Return a trimmed copy of the CStr.

View File

@ -26,9 +26,12 @@
#include "lib/allocators/shared_ptr.h" #include "lib/allocators/shared_ptr.h"
#include "ps/CLogger.h" #include "ps/CLogger.h"
#include "ps/CStr.h"
#include "ps/Profiler2GPU.h" #include "ps/Profiler2GPU.h"
#include "third_party/mongoose/mongoose.h" #include "third_party/mongoose/mongoose.h"
#include <iomanip>
CProfiler2 g_Profiler2; CProfiler2 g_Profiler2;
// A human-recognisable pattern (for debugging) followed by random bytes (for uniqueness) // A human-recognisable pattern (for debugging) followed by random bytes (for uniqueness)
@ -463,7 +466,7 @@ public:
{ {
} }
void OnSync(double time) void OnSync(double UNUSED(time))
{ {
// Split the array of items into an array of array (arbitrarily splitting // Split the array of items into an array of array (arbitrarily splitting
// around the sync points) to avoid array-too-large errors in JSON decoders // around the sync points) to avoid array-too-large errors in JSON decoders

View File

@ -134,12 +134,13 @@ public:
SAFE_DELETE(m_DebugOverlay); SAFE_DELETE(m_DebugOverlay);
} }
virtual void Serialize(ISerializer& serialize) virtual void Serialize(ISerializer& UNUSED(serialize))
{ {
// TODO // Territory state can be recomputed as required, so we don't need to serialize any of it.
// TODO: do we ever need to serialize m_TriggerEvent to prevent lost messages?
} }
virtual void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) virtual void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize))
{ {
Init(paramNode); Init(paramNode);
} }

View File

@ -69,7 +69,7 @@ std::istream& CStdDeserializer::GetStream()
void CStdDeserializer::RequireBytesInStream(size_t numBytes) void CStdDeserializer::RequireBytesInStream(size_t numBytes)
{ {
if (numBytes >= m_Stream.rdbuf()->in_avail()) if (numBytes > (size_t)m_Stream.rdbuf()->in_avail())
throw PSERROR_Deserialize_OutOfBounds("RequireBytesInStream"); throw PSERROR_Deserialize_OutOfBounds("RequireBytesInStream");
} }