VirtualBox

Changeset 103449 in vbox


Ignore:
Timestamp:
Feb 19, 2024 2:21:15 PM (15 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
161780
Message:

include/VBox/errorprint.h,FE/VBoxAutostart: Some warning fixes, bugref:3409

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/com/errorprint.h

    r98611 r103449  
    302302        if (FAILED(hrc) || FAILED(iRc)) \
    303303        { \
    304             if (SUCCEEDED(hrc)) hrc = iRc; else iRc = hrc; \
     304            if (SUCCEEDED(hrc)) hrc = (HRESULT)iRc; else iRc = (LONG)hrc; \
    305305            RTMsgError msg; \
    306             com::GlueHandleComErrorProgress(progress, __PRETTY_FUNCTION__, iRc, __FILE__, __LINE__); \
     306            com::GlueHandleComErrorProgress(progress, __PRETTY_FUNCTION__, (HRESULT)iRc, __FILE__, __LINE__); \
    307307        } \
    308308    } while (0)
     
    321321        if (FAILED(hrc) || FAILED(iRc)) \
    322322        { \
    323             if (SUCCEEDED(hrc)) hrc = iRc; else iRc = hrc; \
     323            if (SUCCEEDED(hrc)) hrc = (HRESULT)iRc; else iRc = (LONG)hrc; \
    324324            RTMsgError msg; \
    325             com::GlueHandleComErrorProgress(progress, __PRETTY_FUNCTION__, iRc, __FILE__, __LINE__); \
     325            com::GlueHandleComErrorProgress(progress, __PRETTY_FUNCTION__, (HRESULT)iRc, __FILE__, __LINE__); \
    326326            break; \
    327327        } \
     
    335335        if (FAILED(hrc) || FAILED(iRc)) \
    336336        { \
    337             if (SUCCEEDED(hrc)) hrc = iRc; else iRc = hrc; \
     337            if (SUCCEEDED(hrc)) hrc = (HRESULT)iRc; else iRc = (LONG)hrc; \
    338338            RTMsgError msg; \
    339             com::GlueHandleComErrorProgress(progress, __PRETTY_FUNCTION__, iRc, __FILE__, __LINE__); \
     339            com::GlueHandleComErrorProgress(progress, __PRETTY_FUNCTION__, (HRESULT)iRc, __FILE__, __LINE__); \
    340340            break; \
    341341        } \
     
    358358            RTMsgError msg; \
    359359            com::GlueHandleComErrorProgress(progress, __PRETTY_FUNCTION__, \
    360                                             SUCCEEDED(hrcCheck) ? iRc : hrcCheck, __FILE__, __LINE__); \
     360                                            SUCCEEDED(hrcCheck) ? (HRESULT)iRc : hrcCheck, __FILE__, __LINE__); \
    361361            return (ret); \
    362362        } \
  • trunk/src/VBox/Frontends/VBoxAutostart/VBoxAutostart-posix.cpp

    r101227 r103449  
    226226
    227227    /* complete the line. */
    228     LONG iRc = E_FAIL;
     228    LONG iRc = (LONG)E_FAIL;
    229229    hrc = progress->COMGETTER(ResultCode)(&iRc);
    230230    if (SUCCEEDED(hrc))
     
    239239            RTStrmPrintf(g_pStdErr, "Progress state: %Rhrc\n", iRc);
    240240        }
    241         hrc = iRc;
     241        hrc = (HRESULT)iRc;
    242242    }
    243243    else
  • trunk/src/VBox/Frontends/VBoxAutostart/VBoxAutostartStart.cpp

    r98103 r103449  
    105105        for (size_t i = 0; i < machines.size(); ++i)
    106106        {
    107             if (machines[i])
     107            ComPtr<IMachine> pMachine = machines[i];
     108
     109            if (pMachine.isNotNull())
    108110            {
    109111                Bstr strName;
    110                 CHECK_ERROR_BREAK(machines[i], COMGETTER(Name)(strName.asOutParam()));
     112                CHECK_ERROR_BREAK(pMachine, COMGETTER(Name)(strName.asOutParam()));
    111113
    112114                BOOL fAccessible;
    113                 CHECK_ERROR_BREAK(machines[i], COMGETTER(Accessible)(&fAccessible));
     115                CHECK_ERROR_BREAK(pMachine, COMGETTER(Accessible)(&fAccessible));
    114116                if (!fAccessible)
    115117                {
     
    121123
    122124                BOOL fAutostart;
    123                 CHECK_ERROR_BREAK(machines[i], COMGETTER(AutostartEnabled)(&fAutostart));
     125                CHECK_ERROR_BREAK(pMachine, COMGETTER(AutostartEnabled)(&fAutostart));
    124126                if (fAutostart)
    125127                {
    126                     CHECK_ERROR_BREAK(machines[i], COMGETTER(Id)(autostartVM.strId.asOutParam()));
    127                     CHECK_ERROR_BREAK(machines[i], COMGETTER(AutostartDelay)(&autostartVM.uStartupDelay));
     128                    CHECK_ERROR_BREAK(pMachine, COMGETTER(Id)(autostartVM.strId.asOutParam()));
     129                    CHECK_ERROR_BREAK(pMachine, COMGETTER(AutostartDelay)(&autostartVM.uStartupDelay));
    128130
    129131                    listVM.push_back(autostartVM);
  • trunk/src/VBox/Frontends/VBoxAutostart/VBoxAutostartStop.cpp

    r98103 r103449  
    135135        for (size_t i = 0; i < machines.size(); ++i)
    136136        {
    137             if (machines[i])
     137            ComPtr<IMachine> pMachine = machines[i];
     138
     139            if (pMachine.isNotNull())
    138140            {
    139141                Bstr strName;
    140                 CHECK_ERROR_BREAK(machines[i], COMGETTER(Name)(strName.asOutParam()));
     142                CHECK_ERROR_BREAK(pMachine, COMGETTER(Name)(strName.asOutParam()));
    141143
    142144                BOOL fAccessible;
    143                 CHECK_ERROR_BREAK(machines[i], COMGETTER(Accessible)(&fAccessible));
     145                CHECK_ERROR_BREAK(pMachine, COMGETTER(Accessible)(&fAccessible));
    144146                if (!fAccessible)
    145147                {
     
    151153
    152154                AutostopType_T enmAutostopType;
    153                 CHECK_ERROR_BREAK(machines[i], COMGETTER(AutostopType)(&enmAutostopType));
     155                CHECK_ERROR_BREAK(pMachine, COMGETTER(AutostopType)(&enmAutostopType));
    154156                if (enmAutostopType != AutostopType_Disabled)
    155157                {
    156                     CHECK_ERROR_BREAK(machines[i], COMGETTER(Id)(autostopVM.strId.asOutParam()));
     158                    CHECK_ERROR_BREAK(pMachine, COMGETTER(Id)(autostopVM.strId.asOutParam()));
    157159                    autostopVM.enmAutostopType = enmAutostopType;
    158160
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