[PC-BSD Commits] r5695 - pcbsd/trunk/libpcbsd

svn at pcbsd.org svn at pcbsd.org
Mon Dec 28 07:32:49 PST 2009


Author: kris
Date: 2009-12-28 07:32:49 -0800 (Mon, 28 Dec 2009)
New Revision: 5695

Modified:
   pcbsd/trunk/libpcbsd/pcbsd-utils.h
   pcbsd/trunk/libpcbsd/utils.cpp
Log:

Updated libpcbsd, needs to use type "long long" not "float" when figuring out some of the longer numbers, such
as RAM bytes on amd64



Modified: pcbsd/trunk/libpcbsd/pcbsd-utils.h
===================================================================
--- pcbsd/trunk/libpcbsd/pcbsd-utils.h	2009-12-28 15:15:31 UTC (rev 5694)
+++ pcbsd/trunk/libpcbsd/pcbsd-utils.h	2009-12-28 15:32:49 UTC (rev 5695)
@@ -29,8 +29,8 @@
 {
 public:
    static QString sysctl(QString sysctl);
-   static int sysctlAsInt(QString sysctl);
-   static QString bytesToHumanReadable(float bytes);
+   static long long sysctlAsInt(QString sysctl);
+   static QString bytesToHumanReadable(long long bytes);
 };
 
 #endif

Modified: pcbsd/trunk/libpcbsd/utils.cpp
===================================================================
--- pcbsd/trunk/libpcbsd/utils.cpp	2009-12-28 15:15:31 UTC (rev 5694)
+++ pcbsd/trunk/libpcbsd/utils.cpp	2009-12-28 15:32:49 UTC (rev 5695)
@@ -38,15 +38,15 @@
    return QString(result);
 }
 
-int Utils::sysctlAsInt(QString sysctl)
+long long Utils::sysctlAsInt(QString sysctl)
 {
-   int result = 0;
+   long long result = 0;
    size_t len = sizeof(result);
    sysctlbyname(sysctl.toAscii(), &result, &len, NULL, 0);
    return result;
 }
 
-QString Utils::bytesToHumanReadable(float bytes)
+QString Utils::bytesToHumanReadable(long long bytes)
 {
    QString suffix[] = {"B", "KB", "MB", "GB", "TB"};
    int i = 0;



More information about the Commits mailing list