VirtualBox

Ignore:
Timestamp:
Nov 5, 2008 2:42:54 AM (16 years ago)
Author:
vboxsync
Message:

s/ELEMENTS/RT_ELEMENTS/g - retiring ELEMENTS (finally).

File:
1 edited

Legend:

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

    r13835 r13836  
    202202    mBootOrder [1] = DeviceType_DVD;
    203203    mBootOrder [2] = DeviceType_HardDisk;
    204     for (size_t i = 3; i < ELEMENTS (mBootOrder); i++)
     204    for (size_t i = 3; i < RT_ELEMENTS (mBootOrder); i++)
    205205        mBootOrder [i] = DeviceType_Null;
    206206
     
    231231        return false;
    232232
    233     for (size_t i = 0; i < ELEMENTS (mBootOrder); ++ i)
     233    for (size_t i = 0; i < RT_ELEMENTS (mBootOrder); ++ i)
    234234        if (mBootOrder [i] != that.mBootOrder [i])
    235235            return false;
     
    22582258    if (!port)
    22592259        return E_POINTER;
    2260     if (slot >= ELEMENTS (mSerialPorts))
     2260    if (slot >= RT_ELEMENTS (mSerialPorts))
    22612261        return setError (E_INVALIDARG, tr ("Invalid slot number: %d"), slot);
    22622262
     
    22752275    if (!port)
    22762276        return E_POINTER;
    2277     if (slot >= ELEMENTS (mParallelPorts))
     2277    if (slot >= RT_ELEMENTS (mParallelPorts))
    22782278        return setError (E_INVALIDARG, tr ("Invalid slot number: %d"), slot);
    22792279
     
    22922292    if (!adapter)
    22932293        return E_POINTER;
    2294     if (slot >= ELEMENTS (mNetworkAdapters))
     2294    if (slot >= RT_ELEMENTS (mNetworkAdapters))
    22952295        return setError (E_INVALIDARG, tr ("Invalid slot number: %d"), slot);
    22962296
     
    43494349
    43504350    /* create associated serial port objects */
    4351     for (ULONG slot = 0; slot < ELEMENTS (mSerialPorts); slot ++)
     4351    for (ULONG slot = 0; slot < RT_ELEMENTS (mSerialPorts); slot ++)
    43524352    {
    43534353        unconst (mSerialPorts [slot]).createObject();
     
    43564356
    43574357    /* create associated parallel port objects */
    4358     for (ULONG slot = 0; slot < ELEMENTS (mParallelPorts); slot ++)
     4358    for (ULONG slot = 0; slot < RT_ELEMENTS (mParallelPorts); slot ++)
    43594359    {
    43604360        unconst (mParallelPorts [slot]).createObject();
     
    43754375
    43764376    /* create associated network adapter objects */
    4377     for (ULONG slot = 0; slot < ELEMENTS (mNetworkAdapters); slot ++)
     4377    for (ULONG slot = 0; slot < RT_ELEMENTS (mNetworkAdapters); slot ++)
    43784378    {
    43794379        unconst (mNetworkAdapters [slot]).createObject();
     
    44064406    /* tell all our other child objects we've been uninitialized */
    44074407
    4408     for (ULONG slot = 0; slot < ELEMENTS (mNetworkAdapters); slot ++)
     4408    for (ULONG slot = 0; slot < RT_ELEMENTS (mNetworkAdapters); slot ++)
    44094409    {
    44104410        if (mNetworkAdapters [slot])
     
    44334433    }
    44344434
    4435     for (ULONG slot = 0; slot < ELEMENTS (mParallelPorts); slot ++)
     4435    for (ULONG slot = 0; slot < RT_ELEMENTS (mParallelPorts); slot ++)
    44364436    {
    44374437        if (mParallelPorts [slot])
     
    44424442    }
    44434443
    4444     for (ULONG slot = 0; slot < ELEMENTS (mSerialPorts); slot ++)
     4444    for (ULONG slot = 0; slot < RT_ELEMENTS (mSerialPorts); slot ++)
    44454445    {
    44464446        if (mSerialPorts [slot])
     
    50005000    {
    50015001        /* reset all boot order positions to NoDevice */
    5002         for (size_t i = 0; i < ELEMENTS (mHWData->mBootOrder); i++)
     5002        for (size_t i = 0; i < RT_ELEMENTS (mHWData->mBootOrder); i++)
    50035003            mHWData->mBootOrder [i] = DeviceType_Null;
    50045004
     
    50135013            uint32_t position = (*it).value <uint32_t> ("position");
    50145014            -- position;
    5015             Assert (position < ELEMENTS (mHWData->mBootOrder));
     5015            Assert (position < RT_ELEMENTS (mHWData->mBootOrder));
    50165016
    50175017            /* device (required) */
     
    50825082            /* slot unicity is guaranteed by XML Schema */
    50835083            uint32_t slot = (*it).value <uint32_t> ("slot");
    5084             AssertBreak (slot < ELEMENTS (mNetworkAdapters));
     5084            AssertBreak (slot < RT_ELEMENTS (mNetworkAdapters));
    50855085
    50865086            rc = mNetworkAdapters [slot]->loadSettings (*it);
     
    51025102            /* slot unicity is guaranteed by XML Schema */
    51035103            uint32_t slot = (*it).value <uint32_t> ("slot");
    5104             AssertBreak (slot < ELEMENTS (mSerialPorts));
     5104            AssertBreak (slot < RT_ELEMENTS (mSerialPorts));
    51055105
    51065106            rc = mSerialPorts [slot]->loadSettings (*it);
     
    51225122            /* slot unicity is guaranteed by XML Schema */
    51235123            uint32_t slot = (*it).value <uint32_t> ("slot");
    5124             AssertBreak (slot < ELEMENTS (mSerialPorts));
     5124            AssertBreak (slot < RT_ELEMENTS (mSerialPorts));
    51255125
    51265126            rc = mParallelPorts [slot]->loadSettings (*it);
     
    63736373        Key bootNode = aNode.createKey ("Boot");
    63746374
    6375         for (ULONG pos = 0; pos < ELEMENTS (mHWData->mBootOrder); ++ pos)
     6375        for (ULONG pos = 0; pos < RT_ELEMENTS (mHWData->mBootOrder); ++ pos)
    63766376        {
    63776377            const char *device = NULL;
     
    64376437        Key nwNode = aNode.createKey ("Network");
    64386438
    6439         for (ULONG slot = 0; slot < ELEMENTS (mNetworkAdapters); ++ slot)
     6439        for (ULONG slot = 0; slot < RT_ELEMENTS (mNetworkAdapters); ++ slot)
    64406440        {
    64416441            Key adapterNode = nwNode.appendKey ("Adapter");
     
    64526452        Key serialNode = aNode.createKey ("UART");
    64536453
    6454         for (ULONG slot = 0; slot < ELEMENTS (mSerialPorts); ++ slot)
     6454        for (ULONG slot = 0; slot < RT_ELEMENTS (mSerialPorts); ++ slot)
    64556455        {
    64566456            Key portNode = serialNode.appendKey ("Port");
     
    64676467        Key parallelNode = aNode.createKey ("LPT");
    64686468
    6469         for (ULONG slot = 0; slot < ELEMENTS (mParallelPorts); ++ slot)
     6469        for (ULONG slot = 0; slot < RT_ELEMENTS (mParallelPorts); ++ slot)
    64706470        {
    64716471            Key portNode = parallelNode.appendKey ("Port");
     
    71937193    AutoReadLock alock (this);
    71947194
    7195     for (ULONG slot = 0; slot < ELEMENTS (mNetworkAdapters); slot ++)
     7195    for (ULONG slot = 0; slot < RT_ELEMENTS (mNetworkAdapters); slot ++)
    71967196        if (mNetworkAdapters [slot] && mNetworkAdapters [slot]->isModified())
    71977197            return true;
    71987198
    7199     for (ULONG slot = 0; slot < ELEMENTS (mSerialPorts); slot ++)
     7199    for (ULONG slot = 0; slot < RT_ELEMENTS (mSerialPorts); slot ++)
    72007200        if (mSerialPorts [slot] && mSerialPorts [slot]->isModified())
    72017201            return true;
    72027202
    7203     for (ULONG slot = 0; slot < ELEMENTS (mParallelPorts); slot ++)
     7203    for (ULONG slot = 0; slot < RT_ELEMENTS (mParallelPorts); slot ++)
    72047204        if (mParallelPorts [slot] && mParallelPorts [slot]->isModified())
    72057205            return true;
     
    72357235    AutoReadLock alock (this);
    72367236
    7237     for (ULONG slot = 0; slot < ELEMENTS (mNetworkAdapters); slot ++)
     7237    for (ULONG slot = 0; slot < RT_ELEMENTS (mNetworkAdapters); slot ++)
    72387238        if (mNetworkAdapters [slot] && mNetworkAdapters [slot]->isReallyModified())
    72397239            return true;
    72407240
    7241     for (ULONG slot = 0; slot < ELEMENTS (mSerialPorts); slot ++)
     7241    for (ULONG slot = 0; slot < RT_ELEMENTS (mSerialPorts); slot ++)
    72427242        if (mSerialPorts [slot] && mSerialPorts [slot]->isReallyModified())
    72437243            return true;
    72447244
    7245     for (ULONG slot = 0; slot < ELEMENTS (mParallelPorts); slot ++)
     7245    for (ULONG slot = 0; slot < RT_ELEMENTS (mParallelPorts); slot ++)
    72467246        if (mParallelPorts [slot] && mParallelPorts [slot]->isReallyModified())
    72477247            return true;
     
    73207320         usbChanged = false, sataChanged = false;
    73217321
    7322     ComPtr <INetworkAdapter> networkAdapters [ELEMENTS (mNetworkAdapters)];
    7323     ComPtr <ISerialPort> serialPorts [ELEMENTS (mSerialPorts)];
    7324     ComPtr <IParallelPort> parallelPorts [ELEMENTS (mParallelPorts)];
     7322    ComPtr <INetworkAdapter> networkAdapters [RT_ELEMENTS (mNetworkAdapters)];
     7323    ComPtr <ISerialPort> serialPorts [RT_ELEMENTS (mSerialPorts)];
     7324    ComPtr <IParallelPort> parallelPorts [RT_ELEMENTS (mParallelPorts)];
    73257325
    73267326    if (mBIOSSettings)
     
    73477347        sataChanged = mSATAController->rollback();
    73487348
    7349     for (ULONG slot = 0; slot < ELEMENTS (mNetworkAdapters); slot ++)
     7349    for (ULONG slot = 0; slot < RT_ELEMENTS (mNetworkAdapters); slot ++)
    73507350        if (mNetworkAdapters [slot])
    73517351            if (mNetworkAdapters [slot]->rollback())
    73527352                networkAdapters [slot] = mNetworkAdapters [slot];
    73537353
    7354     for (ULONG slot = 0; slot < ELEMENTS (mSerialPorts); slot ++)
     7354    for (ULONG slot = 0; slot < RT_ELEMENTS (mSerialPorts); slot ++)
    73557355        if (mSerialPorts [slot])
    73567356            if (mSerialPorts [slot]->rollback())
    73577357                serialPorts [slot] = mSerialPorts [slot];
    73587358
    7359     for (ULONG slot = 0; slot < ELEMENTS (mParallelPorts); slot ++)
     7359    for (ULONG slot = 0; slot < RT_ELEMENTS (mParallelPorts); slot ++)
    73607360        if (mParallelPorts [slot])
    73617361            if (mParallelPorts [slot]->rollback())
     
    73837383            that->onSATAControllerChange();
    73847384
    7385         for (ULONG slot = 0; slot < ELEMENTS (networkAdapters); slot ++)
     7385        for (ULONG slot = 0; slot < RT_ELEMENTS (networkAdapters); slot ++)
    73867386            if (networkAdapters [slot])
    73877387                that->onNetworkAdapterChange (networkAdapters [slot]);
    7388         for (ULONG slot = 0; slot < ELEMENTS (serialPorts); slot ++)
     7388        for (ULONG slot = 0; slot < RT_ELEMENTS (serialPorts); slot ++)
    73897389            if (serialPorts [slot])
    73907390                that->onSerialPortChange (serialPorts [slot]);
    7391         for (ULONG slot = 0; slot < ELEMENTS (parallelPorts); slot ++)
     7391        for (ULONG slot = 0; slot < RT_ELEMENTS (parallelPorts); slot ++)
    73927392            if (parallelPorts [slot])
    73937393                that->onParallelPortChange (parallelPorts [slot]);
     
    74307430    mSATAController->commit();
    74317431
    7432     for (ULONG slot = 0; slot < ELEMENTS (mNetworkAdapters); slot ++)
     7432    for (ULONG slot = 0; slot < RT_ELEMENTS (mNetworkAdapters); slot ++)
    74337433        mNetworkAdapters [slot]->commit();
    7434     for (ULONG slot = 0; slot < ELEMENTS (mSerialPorts); slot ++)
     7434    for (ULONG slot = 0; slot < RT_ELEMENTS (mSerialPorts); slot ++)
    74357435        mSerialPorts [slot]->commit();
    7436     for (ULONG slot = 0; slot < ELEMENTS (mParallelPorts); slot ++)
     7436    for (ULONG slot = 0; slot < RT_ELEMENTS (mParallelPorts); slot ++)
    74377437        mParallelPorts [slot]->commit();
    74387438
     
    74877487    mSATAController->copyFrom (aThat->mSATAController);
    74887488
    7489     for (ULONG slot = 0; slot < ELEMENTS (mNetworkAdapters); slot ++)
     7489    for (ULONG slot = 0; slot < RT_ELEMENTS (mNetworkAdapters); slot ++)
    74907490        mNetworkAdapters [slot]->copyFrom (aThat->mNetworkAdapters [slot]);
    7491     for (ULONG slot = 0; slot < ELEMENTS (mSerialPorts); slot ++)
     7491    for (ULONG slot = 0; slot < RT_ELEMENTS (mSerialPorts); slot ++)
    74927492        mSerialPorts [slot]->copyFrom (aThat->mSerialPorts [slot]);
    7493     for (ULONG slot = 0; slot < ELEMENTS (mParallelPorts); slot ++)
     7493    for (ULONG slot = 0; slot < RT_ELEMENTS (mParallelPorts); slot ++)
    74947494        mParallelPorts [slot]->copyFrom (aThat->mParallelPorts [slot]);
    74957495}
     
    77387738    mAudioAdapter->init (this, aMachine->mAudioAdapter);
    77397739    /* create a list of serial ports that will be mutable */
    7740     for (ULONG slot = 0; slot < ELEMENTS (mSerialPorts); slot ++)
     7740    for (ULONG slot = 0; slot < RT_ELEMENTS (mSerialPorts); slot ++)
    77417741    {
    77427742        unconst (mSerialPorts [slot]).createObject();
     
    77447744    }
    77457745    /* create a list of parallel ports that will be mutable */
    7746     for (ULONG slot = 0; slot < ELEMENTS (mParallelPorts); slot ++)
     7746    for (ULONG slot = 0; slot < RT_ELEMENTS (mParallelPorts); slot ++)
    77477747    {
    77487748        unconst (mParallelPorts [slot]).createObject();
     
    77567756    mSATAController->init (this, aMachine->mSATAController);
    77577757    /* create a list of network adapters that will be mutable */
    7758     for (ULONG slot = 0; slot < ELEMENTS (mNetworkAdapters); slot ++)
     7758    for (ULONG slot = 0; slot < RT_ELEMENTS (mNetworkAdapters); slot ++)
    77597759    {
    77607760        unconst (mNetworkAdapters [slot]).createObject();
     
    1057810578    mSATAController->initCopy (this, mPeer->mSATAController);
    1057910579
    10580     for (ULONG slot = 0; slot < ELEMENTS (mNetworkAdapters); slot ++)
     10580    for (ULONG slot = 0; slot < RT_ELEMENTS (mNetworkAdapters); slot ++)
    1058110581    {
    1058210582        unconst (mNetworkAdapters [slot]).createObject();
     
    1058410584    }
    1058510585
    10586     for (ULONG slot = 0; slot < ELEMENTS (mSerialPorts); slot ++)
     10586    for (ULONG slot = 0; slot < RT_ELEMENTS (mSerialPorts); slot ++)
    1058710587    {
    1058810588        unconst (mSerialPorts [slot]).createObject();
     
    1059010590    }
    1059110591
    10592     for (ULONG slot = 0; slot < ELEMENTS (mParallelPorts); slot ++)
     10592    for (ULONG slot = 0; slot < RT_ELEMENTS (mParallelPorts); slot ++)
    1059310593    {
    1059410594        unconst (mParallelPorts [slot]).createObject();
     
    1068010680    mSATAController->init (this);
    1068110681
    10682     for (ULONG slot = 0; slot < ELEMENTS (mNetworkAdapters); slot ++)
     10682    for (ULONG slot = 0; slot < RT_ELEMENTS (mNetworkAdapters); slot ++)
    1068310683    {
    1068410684        unconst (mNetworkAdapters [slot]).createObject();
     
    1068610686    }
    1068710687
    10688     for (ULONG slot = 0; slot < ELEMENTS (mSerialPorts); slot ++)
     10688    for (ULONG slot = 0; slot < RT_ELEMENTS (mSerialPorts); slot ++)
    1068910689    {
    1069010690        unconst (mSerialPorts [slot]).createObject();
     
    1069210692    }
    1069310693
    10694     for (ULONG slot = 0; slot < ELEMENTS (mParallelPorts); slot ++)
     10694    for (ULONG slot = 0; slot < RT_ELEMENTS (mParallelPorts); slot ++)
    1069510695    {
    1069610696        unconst (mParallelPorts [slot]).createObject();
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