VirtualBox

Changeset 108003 in vbox for trunk/src


Ignore:
Timestamp:
Jan 31, 2025 2:05:57 PM (3 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
167275
Message:

Parfait: fixed the warning "Change of signedness on implicit conversion" in VBoxManage part of the code

Location:
trunk/src/VBox/Frontends/VBoxManage
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp

    r107982 r108003  
    486486
    487487    /* complete the line. */
    488     LONG iRc = E_FAIL;
     488    LONG iRc = (LONG)E_FAIL;
    489489    hrc = progress->COMGETTER(ResultCode)(&iRc);
    490490    if (SUCCEEDED(hrc))
     
    510510                RTStrmPrintf(g_pStdErr, "%Rhrc\n", iRc);
    511511        }
    512         hrc = iRc;
     512        hrc = (HRESULT)iRc;
    513513    }
    514514    else
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageAppliance.cpp

    r107198 r108003  
    106106        const char *pszComma = strchr(psz, ',');
    107107        if (pszComma)
    108             len = pszComma - psz;
     108            len = (size_t)(pszComma - psz);
    109109        else
    110110            len = strlen(psz);
     
    14641464        const char *pszComma = strchr(psz, ',');
    14651465        if (pszComma)
    1466             len = pszComma - psz;
     1466            len = (size_t)(pszComma - psz);
    14671467        else
    14681468            len = strlen(psz);
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageControlVM.cpp

    r107606 r108003  
    15571557
    15581558                    aChangeOrigin = TRUE;
    1559                     aOriginX      = RTStrToUInt32(argv[2]);
    1560                     aOriginY      = RTStrToUInt32(argv[3]);
     1559                    aOriginX      = (LONG)RTStrToUInt32(argv[2]);/* Explicit conversion */
     1560                    aOriginY      = (LONG)RTStrToUInt32(argv[3]);/* Explicit conversion */
    15611561                    aWidth        = RTStrToUInt32(argv[4]);
    15621562                    aHeight       = RTStrToUInt32(argv[5]);
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageDebugVM.cpp

    r106061 r108003  
    462462                try
    463463                {
    464                     com::Bstr bstrName(ValueUnion.psz, pszEqual - ValueUnion.psz);
     464                    com::Bstr bstrName(ValueUnion.psz, (size_t)(pszEqual - ValueUnion.psz));
    465465                    com::Bstr bstrValue(pszEqual + 1);
    466466                    if (   !aBstrNames.push_back(bstrName.raw())
     
    851851    ComPtr<IProgress> ptrProgress;
    852852    com::Bstr bstrFilename(pszFilename);
    853     CHECK_ERROR2I_RET(pDebugger, TakeGuestSample(bstrFilename.raw(), cSampleIntervalUs, cSampleTimeUs, ptrProgress.asOutParam()), RTEXITCODE_FAILURE);
     853    CHECK_ERROR2I_RET(pDebugger, TakeGuestSample(bstrFilename.raw(), cSampleIntervalUs, (LONG64)cSampleTimeUs, ptrProgress.asOutParam()), RTEXITCODE_FAILURE);
    854854    showProgress(ptrProgress);
    855855
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageDisk.cpp

    r107757 r108003  
    8484        const char *pszComma = strchr(psz, ',');
    8585        if (pszComma)
    86             len = pszComma - psz;
     86            len = (size_t)(pszComma - psz);
    8787        else
    8888            len = strlen(psz);
     
    622622
    623623        if (fBase)
    624             CHECK_ERROR(pMedium, CreateBaseStorage(size, ComSafeArrayAsInParam(l_variants), pProgress.asOutParam()));
     624            CHECK_ERROR(pMedium, CreateBaseStorage((LONG64)size, ComSafeArrayAsInParam(l_variants), pProgress.asOutParam()));
    625625        else
    626626            CHECK_ERROR(pParentMedium, CreateDiffStorage(pMedium, ComSafeArrayAsInParam(l_variants), pProgress.asOutParam()));
     
    929929    {
    930930        ComPtr<IProgress> pProgress;
    931         CHECK_ERROR(pMedium, Resize(cbResize, pProgress.asOutParam()));
     931        CHECK_ERROR(pMedium, Resize((LONG64)cbResize, pProgress.asOutParam()));
    932932        if (SUCCEEDED(hrc))
    933933            hrc = showProgress(pProgress);
     
    11971197        if (fNeedResize)
    11981198        {
    1199             CHECK_ERROR_BREAK(pSrcMedium, ResizeAndCloneTo(pDstMedium, cbResize, ComSafeArrayAsInParam(l_variants), NULL, pProgress.asOutParam()));
     1199            CHECK_ERROR_BREAK(pSrcMedium, ResizeAndCloneTo(pDstMedium, (LONG64)cbResize, ComSafeArrayAsInParam(l_variants), NULL, pProgress.asOutParam()));
    12001200        }
    12011201        else
     
    22892289            LONG64 cbLogical = 0;
    22902290            CHECK_ERROR2I_STMT(ptrMedium, COMGETTER(LogicalSize)(&cbLogical), hrc = hrcCheck);
    2291             *pcbMedium = cbLogical;
     2291            *pcbMedium = (uint64_t)cbLogical;
    22922292            if (!SUCCEEDED(hrc))
    22932293                rPtrMediumIO.setNull();
     
    24572457                uint32_t const  cbToRead = (uint32_t)RT_MIN(cb, _128K);
    24582458                SafeArray<BYTE> SafeArrayBuf;
    2459                 HRESULT hrc = ptrMediumIO->Read(off, cbToRead, ComSafeArrayAsOutParam(SafeArrayBuf));
     2459                HRESULT hrc = ptrMediumIO->Read((LONG64)off, cbToRead, ComSafeArrayAsOutParam(SafeArrayBuf));
    24602460                if (FAILED(hrc))
    24612461                {
     
    25142514                                {
    25152515                                    uint8_t const u8 = pbBuf[i];
    2516                                     szLine[cch++] = u8 < 127 && u8 >= 32 ? u8 : '.';
     2516                                    szLine[cch++] = u8 < 127 && u8 >= 32 ? (char)u8 : '.';
    25172517                                }
    25182518                                szLine[cch++] = '\n';
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp

    r107755 r108003  
    15661566                                 lExitCode, procStatus, gctlProcessStatusToText(procStatus));
    15671567
    1568                     rcExit = gctlRunCalculateExitCode(procStatus, lExitCode, true /*fReturnExitCodes*/);
     1568                    rcExit = gctlRunCalculateExitCode(procStatus, (ULONG)lExitCode, true /*fReturnExitCodes*/);
    15691569                }
    15701570                else if (   procStatus == ProcessStatus_TimedOutKilled
     
    17041704
    17051705    char **papszSources = RTGetOptNonOptionArrayPtr(&GetState);
    1706     size_t cSources = &argv[argc] - papszSources;
     1706    size_t cSources = (size_t)(&argv[argc] - papszSources);
    17071707
    17081708    if (!cSources)
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestProp.cpp

    r106061 r108003  
    512512
    513513        ComPtr<IEvent> ev;
    514         hrc = es->GetEvent(listener, cMsWait, ev.asOutParam());
     514        hrc = es->GetEvent(listener, (LONG)cMsWait, ev.asOutParam());
    515515        if (ev) /** @todo r=andy Why not using SUCCEEDED(hrc) here? */
    516516        {
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp

    r107930 r108003  
    339339    RTTimeExplode(&t, &ts);
    340340
    341     RTStrPrintf(s, cb, "%04d/%02d/%02d %02d:%02d:%02d UTC",
     341    RTStrPrintf(s, (size_t)cb, "%04d/%02d/%02d %02d:%02d:%02d UTC",
    342342                        t.i32Year, t.u8Month, t.u8MonthDay,
    343343                        t.u8Hour, t.u8Minute, t.u8Second);
     
    487487            break;
    488488        }
    489         RTStrmWrite(g_pStdOut, psz, pszNext - psz);
     489        RTStrmWrite(g_pStdOut, psz, (size_t)(pszNext - psz));
    490490        char const szTmp[2] = { '\\', *pszNext };
    491491        RTStrmWrite(g_pStdOut, szTmp, sizeof(szTmp));
     
    910910        {
    911911            ComPtr<IMediumAttachment> mediumAttach;
    912             HRESULT hrc = machine->GetMediumAttachment(bstrStorageCtlName.raw(), i, k, mediumAttach.asOutParam());
     912            HRESULT hrc = machine->GetMediumAttachment(bstrStorageCtlName.raw(), (LONG)i, (LONG)k, mediumAttach.asOutParam());
    913913            if (!SUCCEEDED(hrc) && hrc != VBOX_E_OBJECT_NOT_FOUND)
    914914            {
     
    934934
    935935            ComPtr<IMedium> medium;
    936             hrc = machine->GetMedium(bstrStorageCtlName.raw(), i, k, medium.asOutParam());
     936            hrc = machine->GetMedium(bstrStorageCtlName.raw(), (LONG)i, (LONG)k, medium.asOutParam());
    937937            if (SUCCEEDED(hrc) && medium)
    938938            {
     
    32773277            aLogData.setNull();
    32783278            /* Fetch a chunk of the log file */
    3279             CHECK_ERROR_BREAK(machine, ReadLog(uLogIdx, uOffset, _1M,
     3279            CHECK_ERROR_BREAK(machine, ReadLog(uLogIdx, (LONG64)uOffset, _1M,
    32803280                                               ComSafeArrayAsOutParam(aLogData)));
    32813281            cbLogData = aLogData.size();
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageList.cpp

    r107930 r108003  
    10261026    RTPrintf(List::tr("Maximum guest CPU count:         %u\n"), ulValue);
    10271027    systemProperties->COMGETTER(InfoVDSize)(&i64Value);
    1028     RTPrintf(List::tr("Virtual disk limit (info):       %lld Bytes\n", "" , i64Value), i64Value);
     1028    RTPrintf(List::tr("Virtual disk limit (info):       %lld Bytes\n", "" , (size_t)i64Value), i64Value);
    10291029
    10301030#if 0
     
    15651565    {
    15661566        uint32_t u32Format = (uint32_t)formats[i];
    1567         char szFormat[5];
     1567        unsigned char szFormat[5];
    15681568        szFormat[0] = RT_BYTE1(u32Format);
    15691569        szFormat[1] = RT_BYTE2(u32Format);
     
    19801980        hrc = pHostDrive->COMGETTER(Size)(&cbSize);
    19811981        if (SUCCEEDED(hrc) && fOptLong)
    1982             RTPrintf(List::tr("Size:        %llu bytes (%Rhcb)\n", "", cbSize), cbSize, cbSize);
     1982            RTPrintf(List::tr("Size:        %llu bytes (%Rhcb)\n", "", (size_t)cbSize), cbSize, cbSize);
    19831983        else if (SUCCEEDED(hrc))
    19841984            RTPrintf(List::tr("Size:        %Rhcb\n"), cbSize);
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageMetrics.cpp

    r106061 r108003  
    411411    bool isDetached = false, listMatches = false;
    412412    int i;
    413 
    414413    setCurrentSubcommand(HELP_SCOPE_METRICS_COLLECT);
    415414
     
    460459    ComPtr<IUnknown> objectFiltered;
    461460    Bstr metricNameFiltered;
    462     for (i = 0; i < (int)metricInfo.size(); i++)
    463     {
    464         CHECK_ERROR(metricInfo[i], COMGETTER(Object)(objectFiltered.asOutParam()));
    465         CHECK_ERROR(metricInfo[i], COMGETTER(MetricName)(metricNameFiltered.asOutParam()));
     461
     462    for (size_t j = 0; j < metricInfo.size(); j++)
     463    {
     464        CHECK_ERROR(metricInfo[j], COMGETTER(Object)(objectFiltered.asOutParam()));
     465        CHECK_ERROR(metricInfo[j], COMGETTER(MetricName)(metricNameFiltered.asOutParam()));
    466466        Utf8Str baseMetricName(metricNameFiltered);
    467467        baseMetrics.insert(std::make_pair(objectFiltered, toBaseName(baseMetricName)));
     
    470470    com::SafeIfaceArray<IUnknown> objectsFiltered(baseMetrics.size());
    471471    std::set<std::pair<ComPtr<IUnknown>,Bstr> >::iterator it;
    472     i = 0;
     472
     473    size_t n = 0;
    473474    for (it = baseMetrics.begin(); it != baseMetrics.end(); ++it)
    474475    {
    475         it->first.queryInterfaceTo(&objectsFiltered[i]);
    476         Bstr(it->second).detachTo(&baseMetricsFiltered[i++]);
     476        it->first.queryInterfaceTo(&objectsFiltered[n]);
     477        Bstr(it->second).detachTo(&baseMetricsFiltered[n++]);
    477478    }
    478479    com::SafeIfaceArray<IPerformanceMetric> affectedMetrics;
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp

    r107886 r108003  
    595595        const char *pszComma = strchr(psz, ',');
    596596        if (pszComma)
    597             len = pszComma - psz;
     597            len = (size_t)(pszComma - psz);
    598598        else
    599599            len = strlen(psz);
     
    943943                                    com::GluePrintErrorInfo(info);
    944944                                }
    945                                 hrc = iRc;
     945                                hrc = (HRESULT)iRc;
    946946                            }
    947947                        }
     
    27082708                            com::GluePrintErrorInfo(info);
    27092709                        }
    2710                         hrc = iRc;
     2710                        hrc = (HRESULT)iRc;
    27112711                    }
    27122712                }
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp

    r107930 r108003  
    603603        if (pComma)
    604604        {
    605             Bstr(pcszGroups, pComma - pcszGroups).detachTo(pGroups->appendedRaw());
     605            Bstr(pcszGroups, (size_t)(pComma - pcszGroups)).detachTo(pGroups->appendedRaw());
    606606            pcszGroups = pComma + 1;
    607607        }
     
    656656    if (   uIndex >= 1
    657657        && uIndex <= cMaxIndex)
    658         return uIndex;
     658        return (int)uIndex;
    659659    errorArgument(ModifyVM::tr("Invalid %s number %u"), pszName, uIndex);
    660660    return 0;
     
    13081308                if (!RTStrICmp(ValueUnion.psz, "none"))
    13091309                {
    1310                     sessionMachine->DetachDevice(bstrController.raw(), u1, u2);
     1310                    sessionMachine->DetachDevice(bstrController.raw(), (LONG)u1, (LONG)u2);
    13111311                }
    13121312                else
     
    13221322                    {
    13231323                        CHECK_ERROR(sessionMachine, AttachDevice(bstrController.raw(),
    1324                                                           u1, u2,
     1324                                                          (LONG)u1, (LONG)u2,
    13251325                                                          DeviceType_HardDisk,
    13261326                                                          hardDisk));
     
    13911391                {
    13921392                    hrc = sessionMachine->DetachDevice(Bstr("LsiLogic").raw(),
    1393                                                GetOptState.uIndex, 0);
     1393                                               (LONG)GetOptState.uIndex, 0);
    13941394                    if (FAILED(hrc))
    13951395                        CHECK_ERROR(sessionMachine, DetachDevice(Bstr("BusLogic").raw(),
    1396                                                           GetOptState.uIndex, 0));
     1396                                                          (LONG)GetOptState.uIndex, 0));
    13971397                }
    13981398                else
     
    14081408                    {
    14091409                        hrc = sessionMachine->AttachDevice(Bstr("LsiLogic").raw(),
    1410                                                    GetOptState.uIndex, 0,
     1410                                                   (LONG)GetOptState.uIndex, 0,
    14111411                                                   DeviceType_HardDisk,
    14121412                                                   hardDisk);
     
    14141414                            CHECK_ERROR(sessionMachine,
    14151415                                        AttachDevice(Bstr("BusLogic").raw(),
    1416                                                      GetOptState.uIndex, 0,
     1416                                                     (LONG)GetOptState.uIndex, 0,
    14171417                                                     DeviceType_HardDisk,
    14181418                                                     hardDisk));
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