VirtualBox

Ignore:
Timestamp:
Jul 20, 2016 3:45:58 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
108908
Message:

Main/VBoxSVC: enable -Wconversion plus a couple of fixes (all harmless)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/linux/PerformanceLinux.cpp

    r60373 r62363  
    8282    uint64_t     mSingleUser, mSingleKernel, mSingleIdle;
    8383    uint32_t     mHZ;
    84     ULONG        totalRAM;
     84    ULONG        mTotalRAM;
    8585};
    8686
     
    101101    }
    102102    else
    103         mHZ = hz;
     103        mHZ = (uint32_t)hz;
    104104    LogFlowThisFunc(("mHZ=%u\n", mHZ));
    105105
     
    107107    int rc = RTSystemQueryTotalRam(&cb);
    108108    if (RT_FAILURE(rc))
    109         totalRAM = 0;
     109        mTotalRAM = 0;
    110110    else
    111         totalRAM = (ULONG)(cb / 1024);
     111        mTotalRAM = (ULONG)(cb / 1024);
    112112}
    113113
     
    212212int CollectorLinux::getHostMemoryUsage(ULONG *total, ULONG *used, ULONG *available)
    213213{
    214     AssertReturn(totalRAM, VERR_INTERNAL_ERROR);
     214    AssertReturn(mTotalRAM, VERR_INTERNAL_ERROR);
    215215    uint64_t cb;
    216216    int rc = RTSystemQueryAvailableRam(&cb);
    217217    if (RT_SUCCESS(rc))
    218218    {
    219         *total = totalRAM;
    220         *available = cb / 1024;
     219        *total = mTotalRAM;
     220        *available = (ULONG)(cb / 1024);
    221221        *used = *total - *available;
    222222    }
     
    413413char *CollectorLinux::trimNewline(char *pszName)
    414414{
    415     unsigned cbName = strlen(pszName);
     415    size_t cbName = strlen(pszName);
    416416    if (cbName == 0)
    417417        return pszName;
     
    427427char *CollectorLinux::trimTrailingDigits(char *pszName)
    428428{
    429     unsigned cbName = strlen(pszName);
     429    size_t cbName = strlen(pszName);
    430430    if (cbName == 0)
    431431        return pszName;
     
    452452{
    453453    unsigned cbName = 0;
    454     unsigned cbDevName = strlen(pszDevName);
     454    size_t cbDevName = strlen(pszDevName);
    455455    const char *pszEnd = pszDevName + cbDevName - 1;
    456456    if (fTrimDigits)
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette