Fix errors and warnings

Former-commit-id: a3ba309633f198f82c1d0277d750d867cad4ba44
This commit is contained in:
Lynix 2015-11-12 00:29:10 +01:00
parent a26c979d84
commit 5d6e6b2d45
14 changed files with 55 additions and 30 deletions

View File

@ -12,9 +12,9 @@ namespace Ndk
Entity::Entity(Entity&& entity) :
m_components(std::move(entity.m_components)),
m_handles(std::move(entity.m_handles)),
m_id(entity.m_id),
m_componentBits(std::move(entity.m_componentBits)),
m_systemBits(std::move(entity.m_systemBits)),
m_id(entity.m_id),
m_world(entity.m_world),
m_valid(entity.m_valid)
{

View File

@ -35,9 +35,9 @@ namespace Nz
InstancedRenderable(billboard),
m_color(billboard.m_color),
m_material(billboard.m_material),
m_rotation(billboard.m_rotation),
m_sinCos(billboard.m_sinCos),
m_size(billboard.m_size)
m_size(billboard.m_size),
m_rotation(billboard.m_rotation)
{
}

View File

@ -3,6 +3,6 @@
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Network/Config.hpp>
#if NAZARA_MODULENAME_MANAGE_MEMORY
#if NAZARA_NETWORK_MANAGE_MEMORY
#include <Nazara/Core/Debug/NewRedefinition.hpp>
#endif

View File

@ -3,7 +3,7 @@
// For conditions of distribution and use, see copyright notice in Config.hpp
// On suppose que Debug.hpp a déjà été inclus, tout comme Config.hpp
#if NAZARA_MODULENAME_MANAGE_MEMORY
#if NAZARA_NETWORK_MANAGE_MEMORY
#undef delete
#undef new
#endif

View File

@ -3,6 +3,7 @@
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Core/Error.hpp>
#include <ostream>
#include <Nazara/Network/Debug.hpp>
namespace Nz
@ -13,18 +14,18 @@ namespace Nz
}
inline IpAddress::IpAddress(const IPv4& ip, UInt16 port) :
m_isValid(true),
m_ipv4(ip),
m_protocol(NetProtocol_IPv4),
m_port(port)
m_port(port),
m_isValid(true)
{
}
inline IpAddress::IpAddress(const IPv6& ip, UInt16 port) :
m_isValid(true),
m_ipv6(ip),
m_protocol(NetProtocol_IPv6),
m_port(port)
m_port(port),
m_isValid(true)
{
}
@ -116,6 +117,9 @@ namespace Nz
// Each protocol has its variables to compare
switch (first.m_protocol)
{
case NetProtocol_Any:
break;
case NetProtocol_IPv4:
{
if (first.m_ipv4 != second.m_ipv4)
@ -162,6 +166,9 @@ namespace Nz
// Compare IP (thanks to std::array comparison operator)
switch (first.m_protocol)
{
case NetProtocol_Any:
break;
case NetProtocol_IPv4:
{
if (first.m_ipv4 != second.m_ipv4)

View File

@ -35,6 +35,10 @@ namespace Nz
IpAddress any;
switch (protocol)
{
case NetProtocol_Any:
NazaraInternalError("Invalid protocol Any at this point");
return SocketState_NotConnected;
case NetProtocol_IPv4:
any = IpAddress::AnyIpV4;
break;

View File

@ -29,6 +29,10 @@ namespace Nz
IpAddress any;
switch (m_protocol)
{
case NetProtocol_Any:
NazaraInternalError("Invalid protocol Any at this point");
return SocketState_NotConnected;
case NetProtocol_IPv4:
any = IpAddress::AnyIpV4;
break;

View File

@ -1912,7 +1912,6 @@ namespace Nz
}
else
{
unsigned int newSize = m_sharedString->size + length;
auto newString = std::make_shared<SharedString>(m_sharedString->size + length);
char* ptr = newString->string.get();

View File

@ -724,8 +724,6 @@ namespace Nz
return false;
}
bool glsl140 = (OpenGL::GetGLSLVersion() >= 140);
// Basic shader
{
UberShaderPreprocessorRef uberShader = UberShaderPreprocessor::New();

View File

@ -4,6 +4,7 @@
#include <Nazara/Network/Algorithm.hpp>
#include <Nazara/Core/Error.hpp>
#include <cstring>
#include <Nazara/Network/Debug.hpp>
namespace Nz
@ -173,14 +174,14 @@ namespace Nz
addressPtr = savedPtr;
// who knows how to parse ipv4? we do!
UInt8 result[16];
bool isIPv6;
if (!ParseIPAddress(addressPtr, result, nullptr, &isIPv6, &addressPtr) || isIPv6) // must parse and must be ipv4
UInt8 ipv4[16];
bool ipv6;
if (!ParseIPAddress(addressPtr, ipv4, nullptr, &ipv6, &addressPtr) || ipv6) // must parse and must be ipv4
return false;
// transfer addrlocal into the present location
for (unsigned int j = 0; j < 4; ++j)
*(resultPtr++) = result[j];
*(resultPtr++) = ipv4[j];
++i; // pretend like we took another short, since the ipv4 effectively is two shorts
mappedIPv4 = true; // remember how we got here for further validation later

View File

@ -7,6 +7,7 @@
#include <Nazara/Core/StringStream.hpp>
#include <Nazara/Network/Algorithm.hpp>
#include <algorithm>
#include <limits>
#include <Nazara/Network/SystemSocket.hpp>
#if defined(NAZARA_PLATFORM_WINDOWS)
@ -55,6 +56,9 @@ namespace Nz
NazaraAssert(m_protocol <= NetProtocol_Max, "Protocol has value out of enum");
switch (m_protocol)
{
case NetProtocol_Any:
break;
case NetProtocol_IPv4:
return m_ipv4[0] == 127;
@ -75,6 +79,9 @@ namespace Nz
NazaraAssert(m_protocol <= NetProtocol_Max, "Protocol has value out of enum");
switch (m_protocol)
{
case NetProtocol_Any:
break;
case NetProtocol_IPv4:
for (unsigned int i = 0; i < 4; ++i)
{
@ -89,8 +96,8 @@ namespace Nz
// https://tools.ietf.org/html/rfc5952
// Find the longest zero sequence
int f0 = -1;
int l0 = -1;
unsigned int f0 = std::numeric_limits<unsigned int>::max();
unsigned int l0 = std::numeric_limits<unsigned int>::max();
for (unsigned int i = 0; i < 8; ++i)
{

View File

@ -218,6 +218,10 @@ namespace Nz
{
switch (m_state)
{
case SocketState_Bound:
case SocketState_Resolving:
break;
case SocketState_Connected:
return true;

View File

@ -6,6 +6,7 @@
#include <Nazara/Core/CallOnExit.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Network/Win32/SocketImpl.hpp>
#include <cstring>
#include <Nazara/Network/Debug.hpp>
namespace Nz

View File

@ -1546,7 +1546,7 @@ namespace Nz
glBindBuffer(OpenGL::BufferTarget[BufferType_Vertex], vertexBufferImpl->GetOpenGLID());
unsigned int bufferOffset = vertexBuffer->GetStartOffset();
const VertexDeclaration* vertexDeclaration = vertexBuffer->GetVertexDeclaration();
vertexDeclaration = vertexBuffer->GetVertexDeclaration();
unsigned int stride = vertexDeclaration->GetStride();
// On définit les bornes (une fois de plus selon l'itération)