VirtualBox

Changeset 25019 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Nov 26, 2009 3:38:39 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
55333
Message:

VBoxManage: -Wshadow warnings

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

Legend:

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

    r24754 r25019  
    498498                CHECK_ERROR(mediumFormats [i],
    499499                            COMGETTER(FileExtensions) (ComSafeArrayAsOutParam (fileExtensions)));
    500                 for (size_t a = 0; a < fileExtensions.size(); ++ a)
    501                 {
    502                     RTPrintf ("%ls", Bstr (fileExtensions [a]).raw());
    503                     if (a != fileExtensions.size()-1)
     500                for (size_t j = 0; j < fileExtensions.size(); ++ j)
     501                {
     502                    RTPrintf ("%ls", Bstr (fileExtensions [j]).raw());
     503                    if (j != fileExtensions.size()-1)
    504504                        RTPrintf (",");
    505505                }
     
    522522                if (propertyNames.size() > 0)
    523523                {
    524                     for (size_t a = 0; a < propertyNames.size(); ++ a)
     524                    for (size_t j = 0; j < propertyNames.size(); ++ j)
    525525                    {
    526526                        RTPrintf ("\n  name='%ls' desc='%ls' type=",
    527                                 Bstr (propertyNames [a]).raw(), Bstr (propertyDescriptions [a]).raw());
    528                         switch (propertyTypes [a])
     527                                Bstr (propertyNames [j]).raw(), Bstr (propertyDescriptions [j]).raw());
     528                        switch (propertyTypes [j])
    529529                        {
    530530                            case DataType_Int32: RTPrintf ("int"); break;
     
    532532                            case DataType_String: RTPrintf ("string"); break;
    533533                        }
    534                         RTPrintf (" flags=%#04x", propertyFlags [a]);
    535                         RTPrintf (" default='%ls'", Bstr (propertyDefaults [a]).raw());
    536                         if (a != propertyNames.size()-1)
     534                        RTPrintf (" flags=%#04x", propertyFlags [j]);
     535                        RTPrintf (" default='%ls'", Bstr (propertyDefaults [j]).raw());
     536                        if (j != propertyNames.size()-1)
    537537                            RTPrintf (", ");
    538538                    }
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageMetrics.cpp

    r20928 r25019  
    505505                                                 ComSafeArrayAsOutParam(retLengths),
    506506                                                 ComSafeArrayAsOutParam(retData)) );
    507         for (unsigned i = 0; i < retNames.size(); i++)
    508         {
    509             Bstr metricUnit(retUnits[i]);
    510             Bstr metricName(retNames[i]);
    511             RTPrintf("%-12s %-10ls %-20ls ", ts, getObjectName(aVirtualBox, retObjects[i]).raw(), metricName.raw());
     507        for (unsigned j = 0; j < retNames.size(); j++)
     508        {
     509            Bstr metricUnit(retUnits[j]);
     510            Bstr metricName(retNames[j]);
     511            RTPrintf("%-12s %-10ls %-20ls ", ts, getObjectName(aVirtualBox, retObjects[j]).raw(), metricName.raw());
    512512            const char *separator = "";
    513             for (unsigned j = 0; j < retLengths[i]; j++)
     513            for (unsigned k = 0; k < retLengths[j]; k++)
    514514            {
    515                 if (retScales[i] == 1)
    516                     RTPrintf("%s%d %ls", separator, retData[retIndices[i] + j], metricUnit.raw());
     515                if (retScales[j] == 1)
     516                    RTPrintf("%s%d %ls", separator, retData[retIndices[j] + k], metricUnit.raw());
    517517                else
    518                     RTPrintf("%s%d.%02d%ls", separator, retData[retIndices[i] + j] / retScales[i],
    519                              (retData[retIndices[i] + j] * 100 / retScales[i]) % 100, metricUnit.raw());
     518                    RTPrintf("%s%d.%02d%ls", separator, retData[retIndices[j] + k] / retScales[j],
     519                             (retData[retIndices[j] + k] * 100 / retScales[j]) % 100, metricUnit.raw());
    520520                separator = ", ";
    521521            }
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageSnapshot.cpp

    r24879 r25019  
    240240    if (!pMachine)
    241241        return 1;
    242     Bstr guid;
    243     pMachine->COMGETTER(Id)(guid.asOutParam());
     242    Bstr guidMachine;
     243    pMachine->COMGETTER(Id)(guidMachine.asOutParam());
    244244
    245245    do
    246246    {
    247247        /* we have to open a session for this task. First try an existing session */
    248         rc = a->virtualBox->OpenExistingSession(a->session, guid);
     248        rc = a->virtualBox->OpenExistingSession(a->session, guidMachine);
    249249        if (FAILED(rc))
    250             CHECK_ERROR_BREAK(a->virtualBox, OpenSession(a->session, guid));
     250            CHECK_ERROR_BREAK(a->virtualBox, OpenSession(a->session, guidMachine));
    251251        ComPtr<IConsole> console;
    252252        CHECK_ERROR_BREAK(a->session, COMGETTER(Console)(console.asOutParam()));
     
    352352
    353353            /* assume it's a UUID */
    354             Bstr guid(a->argv[2]);
    355             if (!guid.isEmpty())
    356             {
    357                 CHECK_ERROR_BREAK(pMachine, GetSnapshot(guid, pSnapshot.asOutParam()));
     354            Bstr guidSnap(a->argv[2]);
     355            if (!guidSnap.isEmpty())
     356            {
     357                CHECK_ERROR_BREAK(pMachine, GetSnapshot(guidSnap, pSnapshot.asOutParam()));
    358358            }
    359359            else
     
    361361                /* then it must be a name */
    362362                CHECK_ERROR_BREAK(pMachine, FindSnapshot(Bstr(a->argv[2]), pSnapshot.asOutParam()));
    363                 pSnapshot->COMGETTER(Id)(guid.asOutParam());
     363                pSnapshot->COMGETTER(Id)(guidSnap.asOutParam());
    364364            }
    365365
     
    367367            if (fDelete)
    368368            {
    369                 CHECK_ERROR_BREAK(console, DeleteSnapshot(guid, pProgress.asOutParam()));
     369                CHECK_ERROR_BREAK(console, DeleteSnapshot(guidSnap, pProgress.asOutParam()));
    370370            }
    371371            else
     
    404404            {
    405405                /* assume it's a UUID */
    406                 Bstr guid(a->argv[2]);
    407                 if (!guid.isEmpty())
    408                 {
    409                     CHECK_ERROR_BREAK(pMachine, GetSnapshot(guid, snapshot.asOutParam()));
     406                Bstr guidSnap(a->argv[2]);
     407                if (!guidSnap.isEmpty())
     408                {
     409                    CHECK_ERROR_BREAK(pMachine, GetSnapshot(guidSnap, snapshot.asOutParam()));
    410410                }
    411411                else
     
    467467
    468468            /* assume it's a UUID */
    469             Bstr guid(a->argv[2]);
    470             if (!guid.isEmpty())
    471             {
    472                 CHECK_ERROR_BREAK(pMachine, GetSnapshot(guid, snapshot.asOutParam()));
     469            Bstr guidSnap(a->argv[2]);
     470            if (!guidSnap.isEmpty())
     471            {
     472                CHECK_ERROR_BREAK(pMachine, GetSnapshot(guidSnap, snapshot.asOutParam()));
    473473            }
    474474            else
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