VirtualBox

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/Additions/common/VBoxService
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlProcess.cpp

    r62882 r64766  
    11521152        /* Search old threads using the desired PID and shut them down completely -- it's
    11531153         * not used anymore. */
    1154         PVBOXSERVICECTRLPROCESS pProcessCur;
    11551154        bool fTryAgain;
    11561155        do
    11571156        {
    11581157            fTryAgain = false;
     1158            PVBOXSERVICECTRLPROCESS pProcessCur;
    11591159            RTListForEach(&pProcess->pSession->lstProcesses, pProcessCur, VBOXSERVICECTRLPROCESS, Node)
    11601160            {
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServicePropCache.cpp

    r62851 r64766  
    4545     *        implementation (AVL tree). However, this is not important at the
    4646     *        moment. */
    47     PVBOXSERVICEVEPROPCACHEENTRY pNodeIt, pNode = NULL;
     47    PVBOXSERVICEVEPROPCACHEENTRY pNode = NULL;
    4848    if (RT_SUCCESS(RTCritSectEnter(&pCache->CritSect)))
    4949    {
     50        PVBOXSERVICEVEPROPCACHEENTRY pNodeIt;
    5051        RTListForEach(&pCache->NodeHead, pNodeIt, VBOXSERVICEVEPROPCACHEENTRY, NodeSucc)
    5152        {
     
    323324
    324325    int rc = VERR_NOT_FOUND;
    325     PVBOXSERVICEVEPROPCACHEENTRY pNodeIt = NULL;
    326326    if (RT_SUCCESS(RTCritSectEnter(&pCache->CritSect)))
    327327    {
     
    341341        {
    342342            /* Iterate through all nodes and compare their paths. */
     343            PVBOXSERVICEVEPROPCACHEENTRY pNodeIt;
    343344            RTListForEach(&pCache->NodeHead, pNodeIt, VBOXSERVICEVEPROPCACHEENTRY, NodeSucc)
    344345            {
     
    369370
    370371    int rc = VINF_SUCCESS;
    371     PVBOXSERVICEVEPROPCACHEENTRY pNodeIt = NULL;
    372372    if (RT_SUCCESS(RTCritSectEnter(&pCache->CritSect)))
    373373    {
     374        PVBOXSERVICEVEPROPCACHEENTRY pNodeIt;
    374375        RTListForEach(&pCache->NodeHead, pNodeIt, VBOXSERVICEVEPROPCACHEENTRY, NodeSucc)
    375376        {
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceToolBox.cpp

    r62850 r64766  
    492492        {
    493493            /* Process each input file. */
     494            RTFILE hInput = NIL_RTFILE;
    494495            PVBOXSERVICETOOLBOXPATHENTRY pNodeIt;
    495             RTFILE hInput = NIL_RTFILE;
    496496            RTListForEach(&inputList, pNodeIt, VBOXSERVICETOOLBOXPATHENTRY, Node)
    497497            {
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