Fix another lot of warnings from Clang
Closes #90 Closes #91 Closes #92 Closes #93
This commit is contained in:
@@ -208,8 +208,9 @@ namespace Nz
|
||||
|
||||
time_t FileImpl::GetCreationTime(const String& filePath)
|
||||
{
|
||||
NazaraWarning("Posix has no creation time information");
|
||||
NazaraUnused(filePath);
|
||||
|
||||
NazaraWarning("Posix has no creation time information");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace Nz
|
||||
{
|
||||
ErrorFlags flags(ErrorFlag_ThrowException, true);
|
||||
|
||||
std::array<UInt8, 4> whitePixel = {255, 255, 255, 255};
|
||||
std::array<UInt8, 4> whitePixel = { {255, 255, 255, 255} };
|
||||
m_whiteTexture.Create(ImageType_2D, PixelFormatType_RGBA8, 1, 1);
|
||||
m_whiteTexture.Update(whitePixel.data());
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace Nz
|
||||
{
|
||||
ErrorFlags flags(ErrorFlag_ThrowException, true);
|
||||
|
||||
std::array<UInt8, 4> whitePixel = {255, 255, 255, 255};
|
||||
std::array<UInt8, 4> whitePixel = { {255, 255, 255, 255} };
|
||||
m_whiteTexture.Create(ImageType_2D, PixelFormatType_RGBA8, 1, 1);
|
||||
m_whiteTexture.Update(whitePixel.data());
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace Nz
|
||||
byteToInt hostOrder;
|
||||
hostOrder.i = ntohl(addr.s_addr);
|
||||
|
||||
return { hostOrder.b[3], hostOrder.b[2], hostOrder.b[1], hostOrder.b[0] };
|
||||
return { {hostOrder.b[3], hostOrder.b[2], hostOrder.b[1], hostOrder.b[0]} };
|
||||
}
|
||||
|
||||
IpAddress::IPv6 convertSockaddr6ToIPv6(const in6_addr& addr)
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace Nz
|
||||
activeSockets = SocketImpl::Poll(m_sockets.data(), m_sockets.size(), static_cast<int>(msTimeout), error);
|
||||
|
||||
m_activeSockets.clear();
|
||||
if (activeSockets > 0U)
|
||||
if (activeSockets > 0)
|
||||
{
|
||||
int socketRemaining = activeSockets;
|
||||
for (PollSocket& entry : m_sockets)
|
||||
|
||||
@@ -51,11 +51,12 @@ namespace Nz
|
||||
d[2] = d[0] + Vector2f(1.f - 2.f * s_UnskewCoeff2D);
|
||||
|
||||
Vector2i offset(skewedCubeOrigin.x & 255, skewedCubeOrigin.y & 255);
|
||||
std::array<std::size_t, 3> gi =
|
||||
{
|
||||
m_permutations[offset.x + m_permutations[offset.y]] & 7,
|
||||
m_permutations[offset.x + off1.x + m_permutations[offset.y + off1.y]] & 7,
|
||||
m_permutations[offset.x + 1 + m_permutations[offset.y + 1]] & 7
|
||||
std::array<std::size_t, 3> gi = {
|
||||
{
|
||||
m_permutations[offset.x + m_permutations[offset.y]] & 7,
|
||||
m_permutations[offset.x + off1.x + m_permutations[offset.y + off1.y]] & 7,
|
||||
m_permutations[offset.x + 1 + m_permutations[offset.y + 1]] & 7
|
||||
}
|
||||
};
|
||||
|
||||
float n = 0.f;
|
||||
|
||||
@@ -12,12 +12,13 @@ namespace Nz
|
||||
{
|
||||
namespace
|
||||
{
|
||||
static constexpr std::array<float, 4> m_functionScales =
|
||||
{
|
||||
1.f / float(M_SQRT2),
|
||||
0.5f / float(M_SQRT2),
|
||||
0.5f / float(M_SQRT2),
|
||||
0.5f / float(M_SQRT2)
|
||||
static constexpr std::array<float, 4> m_functionScales = {
|
||||
{
|
||||
1.f / float(M_SQRT2),
|
||||
0.5f / float(M_SQRT2),
|
||||
0.5f / float(M_SQRT2),
|
||||
0.5f / float(M_SQRT2)
|
||||
}
|
||||
};
|
||||
}
|
||||
Worley::Worley() :
|
||||
@@ -111,11 +112,21 @@ namespace Nz
|
||||
|
||||
float Worley::Get(float x, float y, float z, float scale) const
|
||||
{
|
||||
NazaraUnused(x);
|
||||
NazaraUnused(y);
|
||||
NazaraUnused(z);
|
||||
NazaraUnused(scale);
|
||||
|
||||
throw std::runtime_error("Worley 3D not available yet.");
|
||||
}
|
||||
|
||||
float Worley::Get(float x, float y, float z, float w, float scale) const
|
||||
{
|
||||
NazaraUnused(x);
|
||||
NazaraUnused(y);
|
||||
NazaraUnused(z);
|
||||
NazaraUnused(scale);
|
||||
|
||||
throw std::runtime_error("Worley 4D not available yet.");
|
||||
}
|
||||
|
||||
|
||||
@@ -44,12 +44,12 @@ namespace Nz
|
||||
return ColliderType2D_Null;
|
||||
}
|
||||
|
||||
float NullCollider2D::ComputeInertialMatrix(float mass) const
|
||||
float NullCollider2D::ComputeInertialMatrix(float /*mass*/) const
|
||||
{
|
||||
return 0.f;
|
||||
}
|
||||
|
||||
std::vector<cpShape*> NullCollider2D::CreateShapes(RigidBody2D* body) const
|
||||
std::vector<cpShape*> NullCollider2D::CreateShapes(RigidBody2D* /*body*/) const
|
||||
{
|
||||
return std::vector<cpShape*>();
|
||||
}
|
||||
|
||||
@@ -66,6 +66,8 @@ namespace Nz
|
||||
|
||||
bool SaveToStream(const Mesh& mesh, const String& format, Stream& stream, const MeshParams& parameters)
|
||||
{
|
||||
NazaraUnused(parameters);
|
||||
|
||||
if (!mesh.IsValid())
|
||||
{
|
||||
NazaraError("Invalid mesh");
|
||||
|
||||
@@ -99,7 +99,7 @@ namespace Nz
|
||||
void WriteToStream(void* userdata, void* data, int size)
|
||||
{
|
||||
Stream* stream = static_cast<Stream*>(userdata);
|
||||
if (stream->Write(data, size) != size)
|
||||
if (stream->Write(data, size) != static_cast<std::size_t>(size))
|
||||
throw std::runtime_error("Failed to write to stream");
|
||||
}
|
||||
|
||||
@@ -142,6 +142,8 @@ namespace Nz
|
||||
|
||||
bool SaveBMP(const Image& image, const ImageParams& parameters, Stream& stream)
|
||||
{
|
||||
NazaraUnused(parameters);
|
||||
|
||||
Image tempImage(image); //< We're using COW here to prevent Image copy unless required
|
||||
|
||||
int componentCount = ConvertToIntegerFormat(tempImage);
|
||||
@@ -159,9 +161,11 @@ namespace Nz
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool SaveHDR(const Image& image, const ImageParams& parameters, Stream& stream)
|
||||
{
|
||||
NazaraUnused(parameters);
|
||||
|
||||
Image tempImage(image); //< We're using COW here to prevent Image copy unless required
|
||||
|
||||
int componentCount = ConvertToFloatFormat(tempImage);
|
||||
@@ -182,6 +186,8 @@ namespace Nz
|
||||
|
||||
bool SavePNG(const Image& image, const ImageParams& parameters, Stream& stream)
|
||||
{
|
||||
NazaraUnused(parameters);
|
||||
|
||||
Image tempImage(image); //< We're using COW here to prevent Image copy unless required
|
||||
|
||||
int componentCount = ConvertToIntegerFormat(tempImage);
|
||||
@@ -202,6 +208,8 @@ namespace Nz
|
||||
|
||||
bool SaveTGA(const Image& image, const ImageParams& parameters, Stream& stream)
|
||||
{
|
||||
NazaraUnused(parameters);
|
||||
|
||||
Image tempImage(image); //< We're using COW here to prevent Image copy unless required
|
||||
|
||||
int componentCount = ConvertToIntegerFormat(tempImage);
|
||||
|
||||
Reference in New Issue
Block a user