VirtualBox

Ignore:
Timestamp:
May 31, 2022 9:11:39 AM (3 years ago)
Author:
vboxsync
Message:

Frontends + Main: Adjust to the new rules wrt. to rc -> hrc,vrc usage. This also fixes quite a few bugs wrt shadow variables, wrong return values and output error translations / exit codes. Also see @todos added. ​​bugref:10223

File:
1 edited

Legend:

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

    r94234 r95140  
    5252static RTEXITCODE handleGetGuestProperty(HandlerArg *a)
    5353{
    54     HRESULT rc = S_OK;
     54    HRESULT hrc = S_OK;
    5555
    5656    setCurrentSubcommand(HELP_SCOPE_GUESTPROPERTY_GET);
     
    9191        }
    9292    }
    93     return SUCCEEDED(rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;
     93    return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;
    9494}
    9595
    9696static RTEXITCODE handleSetGuestProperty(HandlerArg *a)
    9797{
    98     HRESULT rc = S_OK;
     98    HRESULT hrc = S_OK;
    9999
    100100    setCurrentSubcommand(HELP_SCOPE_GUESTPROPERTY_SET);
     
    146146                                                  Bstr(pszFlags).raw()));
    147147
    148         if (SUCCEEDED(rc))
     148        if (SUCCEEDED(hrc))
    149149            CHECK_ERROR(machine, SaveSettings());
    150150
    151151        a->session->UnlockMachine();
    152152    }
    153     return SUCCEEDED(rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;
     153    return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;
    154154}
    155155
    156156static RTEXITCODE handleDeleteGuestProperty(HandlerArg *a)
    157157{
    158     HRESULT rc = S_OK;
     158    HRESULT hrc = S_OK;
    159159
    160160    setCurrentSubcommand(HELP_SCOPE_GUESTPROPERTY_UNSET);
     
    186186        CHECK_ERROR(machine, DeleteGuestProperty(Bstr(pszName).raw()));
    187187
    188         if (SUCCEEDED(rc))
     188        if (SUCCEEDED(hrc))
    189189            CHECK_ERROR(machine, SaveSettings());
    190190
    191191        a->session->UnlockMachine();
    192192    }
    193     return SUCCEEDED(rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;
     193    return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;
    194194}
    195195
     
    226226     */
    227227    ComPtr<IMachine> machine;
    228     HRESULT rc;
     228    HRESULT hrc;
    229229    CHECK_ERROR(a->virtualBox, FindMachine(Bstr(a->argv[0]).raw(),
    230230                                           machine.asOutParam()));
     
    246246                                                      ComSafeArrayAsOutParam(timestamps),
    247247                                                      ComSafeArrayAsOutParam(flags)));
    248         if (SUCCEEDED(rc))
     248        if (SUCCEEDED(hrc))
    249249        {
    250250            if (names.size() == 0)
     
    255255        }
    256256    }
    257     return SUCCEEDED(rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;
     257    return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;
    258258}
    259259
     
    280280        pszPatterns = a->argv[1];
    281281    ComPtr<IMachine> machine;
    282     HRESULT rc;
     282    HRESULT hrc;
    283283    CHECK_ERROR(a->virtualBox, FindMachine(Bstr(a->argv[0]).raw(),
    284284                                           machine.asOutParam()));
     
    334334
    335335        ComPtr<IEvent> ev;
    336         rc = es->GetEvent(listener, cMsWait, ev.asOutParam());
    337         if (ev)
     336        hrc = es->GetEvent(listener, cMsWait, ev.asOutParam());
     337        if (ev) /** @todo r=andy Why not using SUCCEEDED(hrc) here? */
    338338        {
    339339            VBoxEventType_T aType;
    340             rc = ev->COMGETTER(Type)(&aType);
     340            hrc = ev->COMGETTER(Type)(&aType);
    341341            switch (aType)
    342342            {
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