VirtualBox

Changeset 64766 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Nov 30, 2016 10:59:48 AM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
112111
Message:

src/VBox: Make the use of the iterator for RTListForEach()/RTListForEachSafe() more obvious. There is no need to initialize the iterator and we also must not depend on the iterator being NULL if the list was empty.

Location:
trunk/src/VBox/Runtime/common
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/dvm/dvm.cpp

    r62477 r64766  
    348348                    if (RT_FAILURE(rc))
    349349                    {
     350                        /* Remove all entries. */
    350351                        PRTDVMVOLUMEINTERNAL pItNext, pIt;
    351 
    352                         /* Remove all entries. */
    353352                        RTListForEachSafe(&pThis->VolumeList, pIt, pItNext, RTDVMVOLUMEINTERNAL, VolumeNode)
    354353                        {
     
    491490               && !fAllocated)
    492491        {
    493             PRTDVMVOLUMEINTERNAL pVol;
    494492            bool fVolFound = false;
    495493            uint64_t cbIntersect;
     
    503501             * contigous on the medium.
    504502             */
     503            PRTDVMVOLUMEINTERNAL pVol;
    505504            RTListForEach(&pThis->VolumeList, pVol, RTDVMVOLUMEINTERNAL, VolumeNode)
    506505            {
  • trunk/src/VBox/Runtime/common/misc/aiomgr.cpp

    r63561 r64766  
    677677    unsigned      cRequests = 0;
    678678    int           rc        = VINF_SUCCESS;
     679
     680    /* Go through the list and queue the requests. */
    679681    PRTAIOMGRREQ  pReqIt;
    680682    PRTAIOMGRREQ  pReqItNext;
    681 
    682     /* Go through the list and queue the requests. */
    683683    RTListForEachSafe(&pFile->AioMgr.ListWaitingReqs, pReqIt, pReqItNext, RTAIOMGRREQ, NodeWaitingList)
    684684    {
     
    764764{
    765765    int rc = VINF_SUCCESS;
     766
    766767    PRTAIOMGRFILEINT pIt;
    767 
    768768    RTListForEach(&pThis->ListFiles, pIt, RTAIOMGRFILEINT, AioMgr.NodeAioMgrFiles)
    769769    {
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