VirtualBox

Changeset 107757 in vbox


Ignore:
Timestamp:
Jan 14, 2025 1:27:34 PM (2 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
166869
Message:

src/VBox/Frontends/VBoxManage/VBoxManageDisk.cpp: Fixed warnings found by Parfait (unused assignment). jiraref:VBP-1424

File:
1 edited

Legend:

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

    r106061 r107757  
    667667RTEXITCODE handleModifyMedium(HandlerArg *a)
    668668{
    669     HRESULT hrc;
    670669    int vrc;
    671670    enum {
     
    741740                if (pszProperty)
    742741                {
    743                     char *pDelimiter = strchr(pszProperty, '=');
    744                     if (pDelimiter)
     742                    char *pszDelimiter = strchr(pszProperty, '=');
     743                    if (pszDelimiter)
    745744                    {
    746                         *pDelimiter = '\0';
     745                        *pszDelimiter = '\0';
    747746
    748747                        Bstr bstrName(pszProperty);
    749                         Bstr bstrValue(&pDelimiter[1]);
     748                        Bstr bstrValue(&pszDelimiter[1]);
    750749                        bstrName.detachTo(mediumPropNames.appendedRaw());
    751750                        bstrValue.detachTo(mediumPropValues.appendedRaw());
    752751                        fModifyProperties = true;
    753752                    }
    754                     else
    755                     {
    756                         errorArgument(Disk::tr("Invalid --property argument '%s'"), ValueUnion.psz);
    757                         hrc = E_FAIL;
    758                     }
     753
    759754                    RTStrFree(pszProperty);
     755
     756                    if (!pszDelimiter)
     757                        return errorArgument(Disk::tr("Invalid --property argument '%s'"), ValueUnion.psz);
    760758                }
    761759                else
     
    763761                    RTStrmPrintf(g_pStdErr, Disk::tr("Error: Failed to allocate memory for medium property '%s'\n"),
    764762                                 ValueUnion.psz);
    765                     hrc = E_FAIL;
     763                    return RTEXITCODE_FAILURE;
    766764                }
    767765                break;
     
    841839        )
    842840        return errorSyntax(Disk::tr("No operation specified"));
     841
     842    HRESULT hrc;
    843843
    844844    /* Always open the medium if necessary, there is no other way. */
     
    956956            if (SUCCEEDED(hrc) && !pProgress.isNull())
    957957            {
    958                 hrc = showProgress(pProgress);
     958                showProgress(pProgress);
    959959                CHECK_PROGRESS_ERROR(pProgress, (Disk::tr("Failed to move medium")));
    960960            }
     
    12051205
    12061206
    1207         hrc = showProgress(pProgress);
     1207        showProgress(pProgress);
    12081208        CHECK_PROGRESS_ERROR_BREAK(pProgress, (Disk::tr("Failed to clone medium")));
    12091209
     
    17731773RTEXITCODE handleCloseMedium(HandlerArg *a)
    17741774{
    1775     HRESULT hrc = S_OK;
    17761775    enum {
    17771776        CMD_NONE,
     
    18421841    if (cmd == CMD_NONE)
    18431842        cmd = CMD_DISK;
     1843
    18441844    if (!pszFilenameOrUuid)
    18451845        return errorSyntax(Disk::tr("Medium name or UUID required"));
     1846
     1847    HRESULT hrc = S_OK;
    18461848
    18471849    ComPtr<IMedium> pMedium;
     
    18671869            if (SUCCEEDED(hrc))
    18681870            {
    1869                 hrc = showProgress(pProgress);
     1871                showProgress(pProgress);
    18701872                CHECK_PROGRESS_ERROR(pProgress, (Disk::tr("Failed to delete medium")));
    18711873            }
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