summaryrefslogtreecommitdiff
path: root/shared/util.cpp
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:14:37 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:14:37 +0200
commit8bf668665b107469086f16cb8ad23e47d479d2b4 (patch)
tree66a91ef06a8caa7cd6819dcbe1860693d3eda8d5 /shared/util.cpp
parent3.21 (diff)
downloadFreeFileSync-8bf668665b107469086f16cb8ad23e47d479d2b4.tar.gz
FreeFileSync-8bf668665b107469086f16cb8ad23e47d479d2b4.tar.bz2
FreeFileSync-8bf668665b107469086f16cb8ad23e47d479d2b4.zip
4.0
Diffstat (limited to 'shared/util.cpp')
-rw-r--r--shared/util.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/shared/util.cpp b/shared/util.cpp
index d780d683..292d87c1 100644
--- a/shared/util.cpp
+++ b/shared/util.cpp
@@ -70,11 +70,10 @@ wxString zen::formatFilesizeToShortString(UInt64 size)
}
-wxString zen::formatPercentage(zen::Int64 dividend, zen::Int64 divisor)
+wxString zen::formatPercentage(double fraction)
{
- const double ratio = divisor != 0 ? to<double>(dividend) * 100.0 / to<double>(divisor) : 0;
wxString output = _("%x%");
- output.Replace(wxT("%x"), wxString::Format(wxT("%3.2f"), ratio), false);
+ output.Replace(wxT("%x"), wxString::Format(wxT("%3.2f"), fraction * 100.0), false);
return output;
}
@@ -130,14 +129,7 @@ bool isVistaOrLater()
wxString zen::utcTimeToLocalString(zen::Int64 utcTime)
{
#ifdef FFS_WIN
- //convert ansi C time to FILETIME
- zen::UInt64 fileTimeLong = to<zen::UInt64>(utcTime + //may be < 0
- zen::Int64(3054539008UL, 2)); //timeshift between ansi C time and FILETIME in seconds == 11644473600s
- fileTimeLong *= 10000000U;
-
- FILETIME lastWriteTimeUtc = {};
- lastWriteTimeUtc.dwLowDateTime = fileTimeLong.getLo();
- lastWriteTimeUtc.dwHighDateTime = fileTimeLong.getHi();
+ FILETIME lastWriteTimeUtc = tofiletime(utcTime); //convert ansi C time to FILETIME
SYSTEMTIME systemTimeLocal = {};
bgstack15