VirtualBox

Changeset 28128 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Apr 9, 2010 8:42:36 AM (15 years ago)
Author:
vboxsync
Message:

ConsoleImpl2.cpp: cosmetics.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/ConsoleImpl2.cpp

    r28111 r28128  
    4747#endif
    4848#include <iprt/file.h>
    49 
    50 #include <limits.h>
    5149
    5250#include <VBox/vmapi.h>
     
    193191}
    194192
    195 /*
     193/**
    196194 * Simple class for storing network boot information.
    197195 */
    198 struct BootNic {
     196struct BootNic
     197{
    199198    ULONG       mInstance;
    200199    unsigned    mPciDev;
     
    203202    bool operator < (const BootNic &rhs) const
    204203    {
    205         int lval = mBootPrio ? mBootPrio : INT_MAX;
    206         int rval = rhs.mBootPrio ? rhs.mBootPrio : INT_MAX;
     204        ULONG lval = mBootPrio     - 1; /* 0 will wrap around and get the lowest priority. */
     205        ULONG rval = rhs.mBootPrio - 1;
    207206        return lval < rval; /* Zero compares as highest number (lowest prio). */
    208207    }
     
    14681467    rc = CFGMR3InsertNode(pDevices, "virtio-net", &pDevVirtioNet);                  RC_CHECK();
    14691468#endif /* VBOX_WITH_VIRTIO */
    1470     std::list<BootNic> llNics;
     1469    std::list<BootNic> llBootNics;
    14711470    for (ULONG ulInstance = 0; ulInstance < SchemaDefs::NetworkAdapterCount; ++ulInstance)
    14721471    {
     
    15481547        }
    15491548#endif
    1550         /* 
     1549        /*
    15511550         * Collect information needed for network booting and add it to the list.
    15521551         */
     
    15591558        hrc = networkAdapter->COMGETTER(BootPriority)(&nic.mBootPrio);              H();
    15601559
    1561         llNics.push_back(nic);
     1560        llBootNics.push_back(nic);
    15621561
    15631562        /*
     
    16391638     * Build network boot information and transfer it to the BIOS.
    16401639     */
    1641     if (pNetBootCfg && !llNics.empty())  /* NetBoot node doesn't exist for EFI! */
    1642     {
    1643         llNics.sort();  /* Sort the list by boot priority. */
    1644 
    1645         PCFGMNODE   pNetBtDevCfg;
     1640    if (pNetBootCfg && !llBootNics.empty())  /* NetBoot node doesn't exist for EFI! */
     1641    {
     1642        llBootNics.sort();  /* Sort the list by boot priority. */
     1643
    16461644        char        achBootIdx[] = "0";
    16471645        unsigned    uBootIdx = 0;
    16481646
    1649         std::list<BootNic>::iterator it;
    1650 
    1651         for (it = llNics.begin(); it != llNics.end(); ++it)
     1647        for (std::list<BootNic>::iterator it = llBootNics.begin(); it != llBootNics.end(); ++it)
    16521648        {
    16531649            /* A NIC with priority 0 is only used if it's first in the list. */
     
    16551651                break;
    16561652
     1653            PCFGMNODE pNetBtDevCfg;
    16571654            achBootIdx[0] = '0' + uBootIdx++;   /* Boot device order. */
    16581655            rc = CFGMR3InsertNode(pNetBootCfg, achBootIdx, &pNetBtDevCfg);      RC_CHECK();
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