Fixed some VS warnings

Thanks to Fraggy again !


Former-commit-id: bd0eea66714701b065892d8b69d576e7b3615dd2
This commit is contained in:
Lynix
2013-09-21 00:10:10 +02:00
parent 6440d38c5c
commit 3167531b39
19 changed files with 95 additions and 73 deletions

View File

@@ -1279,9 +1279,9 @@ nzUInt8 NzImage::GetMaxLevel(unsigned int width, unsigned int height, unsigned i
{
static const float invLog2 = 1.f/std::log(2.f);
unsigned int widthLevel = invLog2 * std::log(static_cast<float>(width));
unsigned int heightLevel = invLog2 * std::log(static_cast<float>(height));
unsigned int depthLevel = invLog2 * std::log(static_cast<float>(depth));
unsigned int widthLevel = static_cast<unsigned int>(invLog2 * std::log(static_cast<float>(width)));
unsigned int heightLevel = static_cast<unsigned int>(invLog2 * std::log(static_cast<float>(height)));
unsigned int depthLevel = static_cast<unsigned int>(invLog2 * std::log(static_cast<float>(depth)));
return std::max(std::max(std::max(widthLevel, heightLevel), depthLevel), 1U);
}

View File

@@ -217,7 +217,7 @@ namespace
nzUInt8 palette[768];
/* the palette is contained in the last 769 bytes of the file */
unsigned int curPos = stream.GetCursorPos();
nzUInt64 curPos = stream.GetCursorPos();
stream.SetCursorPos(stream.GetSize()-769);
nzUInt8 magic;
if (!stream.Read(&magic, 1))

View File

@@ -11,7 +11,7 @@ namespace
{
inline nzUInt8 c4to5(nzUInt8 c)
{
return c * (31.f/15.f);
return static_cast<nzUInt8>(c * (31.f/15.f));
}
inline nzUInt8 c4to8(nzUInt8 c)
@@ -21,12 +21,12 @@ namespace
inline nzUInt8 c5to4(nzUInt8 c)
{
return c * (15.f/31.f);
return static_cast<nzUInt8>(c * (15.f/31.f));
}
inline nzUInt8 c5to8(nzUInt8 c)
{
return c * (255.f/31.f);
return static_cast<nzUInt8>(c * (255.f/31.f));
}
inline nzUInt8 c8to4(nzUInt8 c)
@@ -36,7 +36,7 @@ namespace
inline nzUInt8 c8to5(nzUInt8 c)
{
return c * (31.f/255.f);
return static_cast<nzUInt8>(c * (31.f/255.f));
}
template<nzPixelFormat from, nzPixelFormat to>

View File

@@ -281,12 +281,12 @@ void NzWindowImpl::IgnoreNextMouseEvent(int mouseX, int mouseY)
bool NzWindowImpl::IsMinimized() const
{
return IsIconic(m_handle);
return IsIconic(m_handle) == TRUE;
}
bool NzWindowImpl::IsVisible() const
{
return IsWindowVisible(m_handle);
return IsWindowVisible(m_handle) == TRUE;
}
void NzWindowImpl::ProcessEvents(bool block)
@@ -800,7 +800,7 @@ bool NzWindowImpl::HandleMessage(HWND window, UINT message, WPARAM wParam, LPARA
{
NzEvent event;
event.type = nzEventType_MouseWheelMoved;
event.mouseWheel.delta = m_scrolling/WHEEL_DELTA;
event.mouseWheel.delta = static_cast<float>(m_scrolling/WHEEL_DELTA);
m_parent->PushEvent(event);
m_scrolling %= WHEEL_DELTA;
@@ -1001,7 +1001,7 @@ bool NzWindowImpl::Initialize()
windowClass.lpszMenuName = nullptr;
windowClass.style = CS_DBLCLKS; // Gestion du double-clic
return RegisterClassW(&windowClass);
return RegisterClassW(&windowClass) != 0;
}
void NzWindowImpl::Uninitialize()