From 9a19d8808e80531d1fd0279e56ac3e19d9b46c83 Mon Sep 17 00:00:00 2001 From: spx Date: Fri, 27 May 2011 18:39:57 +0000 Subject: [PATCH] Tweaks. --- Library/MeasureDiskSpace.cpp | 6 +++--- Library/MeasureNetIn.cpp | 4 ++-- Library/MeasureNetOut.cpp | 4 ++-- Library/MeasureNetTotal.cpp | 4 ++-- Library/MeterImage.cpp | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Library/MeasureDiskSpace.cpp b/Library/MeasureDiskSpace.cpp index 86f088d2..fb500c62 100644 --- a/Library/MeasureDiskSpace.cpp +++ b/Library/MeasureDiskSpace.cpp @@ -76,12 +76,12 @@ bool CMeasureDiskSpace::Update() if (sizeResult) { - m_Value = (double)((m_Total) ? i64TotalBytes : i64FreeBytes).QuadPart; + m_Value = (double)(__int64)((m_Total) ? i64TotalBytes : i64FreeBytes).QuadPart; if (i64TotalBytes.QuadPart != m_OldTotalBytes) { // Total size was changed, so set new max value. - m_MaxValue = (double)i64TotalBytes.QuadPart; + m_MaxValue = (double)(__int64)i64TotalBytes.QuadPart; m_OldTotalBytes = i64TotalBytes.QuadPart; } } @@ -188,7 +188,7 @@ void CMeasureDiskSpace::ReadConfig(CConfigParser& parser, const WCHAR* section) if (result) { - m_MaxValue = (double)i64TotalBytes.QuadPart; + m_MaxValue = (double)(__int64)i64TotalBytes.QuadPart; m_OldTotalBytes = i64TotalBytes.QuadPart; } else diff --git a/Library/MeasureNetIn.cpp b/Library/MeasureNetIn.cpp index 1218543c..5e5fd0c8 100644 --- a/Library/MeasureNetIn.cpp +++ b/Library/MeasureNetIn.cpp @@ -55,7 +55,7 @@ bool CMeasureNetIn::Update() if (m_Cumulative) { - m_Value = (double)GetNetStatsValue(NET_IN); + m_Value = (double)(__int64)GetNetStatsValue(NET_IN); } else { @@ -82,7 +82,7 @@ bool CMeasureNetIn::Update() m_FirstTime = false; } - m_Value = (double)value; + m_Value = (double)(__int64)value; } return PostUpdate(); diff --git a/Library/MeasureNetOut.cpp b/Library/MeasureNetOut.cpp index 438afa9a..958bdfe1 100644 --- a/Library/MeasureNetOut.cpp +++ b/Library/MeasureNetOut.cpp @@ -55,7 +55,7 @@ bool CMeasureNetOut::Update() if (m_Cumulative) { - m_Value = (double)GetNetStatsValue(NET_OUT); + m_Value = (double)(__int64)GetNetStatsValue(NET_OUT); } else { @@ -82,7 +82,7 @@ bool CMeasureNetOut::Update() m_FirstTime = false; } - m_Value = (double)value; + m_Value = (double)(__int64)value; } return PostUpdate(); diff --git a/Library/MeasureNetTotal.cpp b/Library/MeasureNetTotal.cpp index f33e546d..b3130164 100644 --- a/Library/MeasureNetTotal.cpp +++ b/Library/MeasureNetTotal.cpp @@ -55,7 +55,7 @@ bool CMeasureNetTotal::Update() if (m_Cumulative) { - m_Value = (double)GetNetStatsValue(NET_TOTAL); + m_Value = (double)(__int64)GetNetStatsValue(NET_TOTAL); } else { @@ -82,7 +82,7 @@ bool CMeasureNetTotal::Update() m_FirstTime = false; } - m_Value = (double)value; + m_Value = (double)(__int64)value; } return PostUpdate(); diff --git a/Library/MeterImage.cpp b/Library/MeterImage.cpp index 3a94a8df..5fc52e8f 100644 --- a/Library/MeterImage.cpp +++ b/Library/MeterImage.cpp @@ -93,14 +93,14 @@ void CMeterImage::LoadImage(const std::wstring& imageName, bool bLoadAlways) { if (!m_HeightDefined) { - m_H = (imageW == 0) ? 0 : (m_Tile) ? imageH : (int)(m_W * imageH / (double)imageW); + m_H = (imageW == 0) ? 0 : (m_Tile) ? imageH : m_W * imageH / imageW; } } else { if (m_HeightDefined) { - m_W = (imageH == 0) ? 0 : (m_Tile) ? imageW : (int)(m_H * imageW / (double)imageH); + m_W = (imageH == 0) ? 0 : (m_Tile) ? imageW : m_H * imageW / imageH; } else {