From 9dd815526aa6926a239f57fe20ac0bee2118cc0f Mon Sep 17 00:00:00 2001 From: Patrick McIlroy Date: Wed, 1 Sep 2010 21:00:30 +0000 Subject: [PATCH] - Typo and namespace fix git-svn-id: https://openitg.svn.sourceforge.net/svnroot/openitg/branches/dev@810 83fadc84-e282-4d84-a09a-c4228d6ae7e5 --- src/DiagnosticsUtil.cpp | 50 +++++++++++++++++++++++++------------------------ src/DiagnosticsUtil.h | 2 +- 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/src/DiagnosticsUtil.cpp b/src/DiagnosticsUtil.cpp index b320ce8c..466804b9 100644 --- a/src/DiagnosticsUtil.cpp +++ b/src/DiagnosticsUtil.cpp @@ -55,33 +55,35 @@ namespace unsigned KILOBYTE = 1024; unsigned MEGABYTE = 1024*KILOBYTE; unsigned GIGABYTE = 1024*MEGABYTE; +} - CString FormatByteValue( uint64_t iBytes ) - { - double fShownSpace = 0.0f; - - if( iBytes > GIGABYTE ) - { - fShownSpace = iBytes / GIGABYTE; - sSuffix = "GB"; - } - else if( iBytes > MEGABYTE ) - { - fShownSpace = iBytes / MEGABYTE; - sSuffix = "MB"; - } - else if( iBytes > KILOBYTE ) - { - fShownSpace = iByte / KILOBYTE; - sSuffix = "KB"; - } - else - { - fShownSpace = double(iBytes); - sSuffix = "bytes"; +CString FormatByteValue( uint64_t iBytes ) +{ + double fShownSpace = 0.0f; + CString sSuffix; - return ssprintf( "%.02f %s", fShownSpace, sSuffix.c_str() ); + if( iBytes > GIGABYTE ) + { + fShownSpace = iBytes / GIGABYTE; + sSuffix = "GB"; + } + else if( iBytes > MEGABYTE ) + { + fShownSpace = iBytes / MEGABYTE; + sSuffix = "MB"; } + else if( iBytes > KILOBYTE ) + { + fShownSpace = iBytes / KILOBYTE; + sSuffix = "KB"; + } + else + { + fShownSpace = double(iBytes); + sSuffix = "bytes"; + } + + return ssprintf( "%.02f %s", fShownSpace, sSuffix.c_str() ); } // XXX: we should probably take a parameter for these later on. diff --git a/src/DiagnosticsUtil.h b/src/DiagnosticsUtil.h index 9f30e78c..c3bcf48a 100644 --- a/src/DiagnosticsUtil.h +++ b/src/DiagnosticsUtil.h @@ -11,7 +11,7 @@ namespace DiagnosticsUtil int GetRevision(); CString GetDiskSpaceFree(); - CString GetDiskSpacetotal(); + CString GetDiskSpaceTotal(); CString GetIP(); CString GetProductName(); -- 2.11.0