Final pass of Clang warning fixes

This commit is contained in:
Lynix
2016-10-17 16:14:35 +02:00
parent c221d53839
commit d530ca22e0
17 changed files with 35 additions and 73 deletions

View File

@@ -85,7 +85,7 @@ namespace Nz
}
m_activeSockets.clear();
if (activeSockets > 0U)
if (activeSockets > 0)
{
int socketCount = activeSockets;
for (int i = 0; i < socketCount; ++i)

View File

@@ -110,23 +110,13 @@ namespace Nz
return it->first * m_functionScales[functionIndex];
}
float Worley::Get(float x, float y, float z, float scale) const
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
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.");
}

View File

@@ -25,7 +25,7 @@ namespace Nz
return parser.Check();
}
bool Load(Animation* animation, Stream& stream, const AnimationParams& parameters)
bool Load(Animation* animation, Stream& stream, const AnimationParams& /*parameters*/)
{
///TODO: Utiliser les paramètres
MD5AnimParser parser(stream);

View File

@@ -11,10 +11,8 @@
namespace Nz
{
SoftwareBuffer::SoftwareBuffer(Buffer* parent, BufferType type) :
m_type(type)
SoftwareBuffer::SoftwareBuffer(Buffer* /*parent*/, BufferType type)
{
NazaraUnused(parent);
}
SoftwareBuffer::~SoftwareBuffer()
@@ -25,7 +23,7 @@ namespace Nz
{
NazaraUnused(usage);
// Cette allocation est protégée car sa taille dépend directement de paramètres utilisateurs
// Protect the allocation to prevent a memory exception to escape the function
try
{
m_buffer = new UInt8[size];
@@ -46,20 +44,11 @@ namespace Nz
delete[] m_buffer;
}
bool SoftwareBuffer::Fill(const void* data, unsigned int offset, unsigned int size, bool forceDiscard)
bool SoftwareBuffer::Fill(const void* data, unsigned int offset, unsigned int size, bool /*forceDiscard*/)
{
NazaraUnused(forceDiscard);
#if NAZARA_UTILITY_SAFE
if (m_mapped)
{
NazaraError("Buffer already mapped");
return false;
}
#endif
NazaraAssert(!m_mapped, "Buffer is already mapped");
std::memcpy(&m_buffer[offset], data, size);
return true;
}
@@ -68,18 +57,9 @@ namespace Nz
return false;
}
void* SoftwareBuffer::Map(BufferAccess access, unsigned int offset, unsigned int size)
void* SoftwareBuffer::Map(BufferAccess /*access*/, unsigned int offset, unsigned int /*size*/)
{
NazaraUnused(access);
NazaraUnused(size);
#if NAZARA_UTILITY_SAFE
if (m_mapped)
{
NazaraError("Buffer already mapped");
return nullptr;
}
#endif
NazaraAssert(!m_mapped, "Buffer is already mapped");
m_mapped = true;
@@ -88,13 +68,7 @@ namespace Nz
bool SoftwareBuffer::Unmap()
{
#if NAZARA_UTILITY_SAFE
if (!m_mapped)
{
NazaraError("Buffer not mapped");
return true;
}
#endif
NazaraAssert(m_mapped, "Buffer is not mapped");
m_mapped = false;

View File

@@ -29,7 +29,6 @@ namespace Nz
bool Unmap();
private:
BufferType m_type;
UInt8* m_buffer;
bool m_mapped;
};