VirtualBox

Ignore:
Timestamp:
Jul 20, 2016 3:45:58 PM (9 years ago)
Author:
vboxsync
Message:

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

Location:
trunk/src/VBox/Main/src-server/linux
Files:
4 edited

Legend:

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

    r57358 r62363  
    145145        RTUuidClear(&uuid);
    146146        memcpy(&uuid, Req.ifr_name, RT_MIN(sizeof(Req.ifr_name), sizeof(uuid)));
    147         uuid.Gen.u8ClockSeqHiAndReserved = (uuid.Gen.u8ClockSeqHiAndReserved & 0x3f) | 0x80;
    148         uuid.Gen.u16TimeHiAndVersion = (uuid.Gen.u16TimeHiAndVersion & 0x0fff) | 0x4000;
     147        uuid.Gen.u8ClockSeqHiAndReserved = (uint8_t)((uuid.Gen.u8ClockSeqHiAndReserved & 0x3f) | 0x80);
     148        uuid.Gen.u16TimeHiAndVersion = (uint16_t)((uuid.Gen.u16TimeHiAndVersion & 0x0fff) | 0x4000);
    149149        memcpy(uuid.Gen.au8Node, &Req.ifr_hwaddr.sa_data, sizeof(uuid.Gen.au8Node));
    150150        pInfo->Uuid = uuid;
     
    233233                    continue;
    234234                *pszEndOfName = 0;
    235                 int iFirstNonWS = strspn(buf, " ");
    236                 char *pszName = buf+iFirstNonWS;
     235                size_t iFirstNonWS = strspn(buf, " ");
     236                char *pszName = buf + iFirstNonWS;
    237237                NETIFINFO Info;
    238238                RT_ZERO(Info);
  • 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)
  • trunk/src/VBox/Main/src-server/linux/USBGetDevices.cpp

    r62343 r62363  
    376376         * Set the value.
    377377         */
    378         *pu16 = (uint16_t)u32Int << 8 | (uint16_t)u32Dec;
     378        *pu16 = (uint16_t)((u32Int << 8) | (uint16_t)u32Dec);
    379379    }
    380380    return VINF_SUCCESS;
     
    11791179
    11801180    /* usbfs compatibility, 0-based port number. */
    1181     *pu8Port -= 1;
     1181    *pu8Port = (uint8_t)(*pu8Port - 1);
    11821182    return VINF_SUCCESS;
    11831183}
     
    12841284    /* Fill in the simple fields */
    12851285    pDev->enmState           = USBDEVICESTATE_UNUSED;
    1286     pDev->bBus               = usbsysfsGetBusFromPath(pszSysfsPath);
     1286    pDev->bBus               = (uint8_t)usbsysfsGetBusFromPath(pszSysfsPath);
    12871287    pDev->bDeviceClass       = usbsysfsReadDevicePropertyU8Def(16, 0, "%s/bDeviceClass", pszSysfsPath);
    12881288    pDev->bDeviceSubClass    = usbsysfsReadDevicePropertyU8Def(16, 0, "%s/bDeviceSubClass", pszSysfsPath);
  • trunk/src/VBox/Main/src-server/linux/USBProxyBackendLinux.cpp

    r61423 r62363  
    321321
    322322    RT_ZERO(PollFds);
    323     PollFds[0].fd        = RTFileToNative(mhFile);
     323    PollFds[0].fd        = (int)RTFileToNative(mhFile);
    324324    PollFds[0].events    = POLLIN;
    325     PollFds[1].fd        = RTPipeToNative(mhWakeupPipeR);
     325    PollFds[1].fd        = (int)RTPipeToNative(mhWakeupPipeR);
    326326    PollFds[1].events    = POLLIN | POLLERR | POLLHUP;
    327327
Note: See TracChangeset for help on using the changeset viewer.

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