VirtualBox

Changeset 25000 in vbox for trunk/src/VBox/Runtime/common


Ignore:
Timestamp:
Nov 26, 2009 2:22:44 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
55308
Message:

IPRT: Fixed -Wshadow warnings, found two bugs in error paths.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/ldr/ldrELFRelocatable.cpp.h

    r24678 r25000  
    489489                 */
    490490                AssertMsgReturn(Value == (RTUINTPTR)Value, (FMT_ELF_ADDR "\n", Value), VERR_SYMBOL_VALUE_TOO_BIG);
    491                 int rc = pfnCallback(pMod, pszName, ~0, (RTUINTPTR)Value, pvUser);
     491                rc = pfnCallback(pMod, pszName, ~0, (RTUINTPTR)Value, pvUser);
    492492                if (rc)
    493493                    return rc;
     
    873873        for (unsigned i = 0; i < cbName; i++, off++)
    874874        {
    875             int rc = pModElf->pReader->pfnRead(pModElf->pReader, pszName + i, 1, off);
     875            rc = pModElf->pReader->pfnRead(pModElf->pReader, pszName + i, 1, off);
    876876            if (RT_FAILURE(rc))
    877877            {
  • trunk/src/VBox/Runtime/common/misc/handletablectx.cpp

    r24181 r25000  
    176176                &&  pThis->cCur < pThis->cMax)
    177177            {
    178                 uint32_t i;
    179 
    180178                pThis->papvLevel1[iLevel1New] = paTable;
    181179
  • trunk/src/VBox/Runtime/common/misc/handletablesimple.cpp

    r24181 r25000  
    170170                /* link all entries into a free list. */
    171171                Assert(!(pThis->cCur % RTHT_LEVEL2_ENTRIES));
    172                 for (uint32_t i = 0; i < RTHT_LEVEL2_ENTRIES - 1; i++)
     172                for (i = 0; i < RTHT_LEVEL2_ENTRIES - 1; i++)
    173173                    RTHT_SET_FREE_IDX((PRTHTENTRYFREE)&paTable[i], i + 1 + pThis->cCur);
    174174                RTHT_SET_FREE_IDX((PRTHTENTRYFREE)&paTable[RTHT_LEVEL2_ENTRIES - 1], NIL_RTHT_INDEX);
  • trunk/src/VBox/Runtime/common/misc/thread.cpp

    r23125 r25000  
    136136         * But first, we'll create the semaphore.
    137137         */
    138         int rc = RTSemRWCreate(&g_ThreadRWSem);
     138        rc = RTSemRWCreate(&g_ThreadRWSem);
    139139        if (RT_SUCCESS(rc))
    140140        {
  • trunk/src/VBox/Runtime/common/misc/zip.cpp

    r22007 r25000  
    565565    pZip->u.Zlib.next_out = (Bytef *)pvBuf;
    566566    pZip->u.Zlib.avail_out = (uInt)cbBuf;                   Assert(pZip->u.Zlib.avail_out == cbBuf);
    567     int rc = Z_OK;
    568     /* Be greedy reading input, even if no output buffer is left. It's possible
     567
     568    /*
     569     * Be greedy reading input, even if no output buffer is left. It's possible
    569570     * that it's just the end of stream marker which needs to be read. Happens
    570      * for incompressible blocks just larger than the input buffer size.*/
     571     * for incompressible blocks just larger than the input buffer size.
     572     */
    571573    while (pZip->u.Zlib.avail_out > 0 || pZip->u.Zlib.avail_in <= 0)
    572574    {
     
    587589         * Pass it on to zlib.
    588590         */
    589         rc = inflate(&pZip->u.Zlib, Z_NO_FLUSH);
     591        int rc = inflate(&pZip->u.Zlib, Z_NO_FLUSH);
    590592        if (rc == Z_STREAM_END)
    591593        {
  • trunk/src/VBox/Runtime/common/string/strformatrt.cpp

    r23961 r25000  
    572572            case 'f':
    573573            {
    574                 char ch = *(*ppszFormat)++;
    575                 switch (ch)
     574                switch (*(*ppszFormat)++)
    576575                {
    577576                    /*
     
    607606
    608607                    default:
    609                         AssertMsgFailed(("Invalid status code format type '%.10s'!\n", ch, pszFormatOrg));
     608                        AssertMsgFailed(("Invalid status code format type '%.10s'!\n", pszFormatOrg));
    610609                        break;
    611610                }
     
    619618            case 'h':
    620619            {
    621                 char ch = *(*ppszFormat)++;
    622                 switch (ch)
     620                switch (*(*ppszFormat)++)
    623621                {
    624622                    /*
     
    632630                        if (pu8)
    633631                        {
    634                             ch = *(*ppszFormat)++;
    635                             switch (ch)
     632                            switch (*(*ppszFormat)++)
    636633                            {
    637634                                /*
     
    687684
    688685                                default:
    689                                     AssertMsgFailed(("Invalid status code format type '%.10s'!\n", ch, pszFormatOrg));
     686                                    AssertMsgFailed(("Invalid status code format type '%.10s'!\n", pszFormatOrg));
    690687                                    break;
    691688                            }
     
    704701                    case 'r':
    705702                    {
    706 
    707                         char ch = *(*ppszFormat)++;
    708703                        uint32_t hrc = va_arg(*pArgs, uint32_t);
    709704                        PCRTCOMERRMSG pMsg = RTErrCOMGet(hrc);
    710                         switch (ch)
     705                        switch (*(*ppszFormat)++)
    711706                        {
    712707                            case 'c':
     
    725720
    726721                    default:
    727                         AssertMsgFailed(("Invalid status code format type '%.10s'!\n", ch, pszFormatOrg));
     722                        AssertMsgFailed(("Invalid status code format type '%.10s'!\n", pszFormatOrg));
    728723                        return 0;
    729724
     
    738733            {
    739734                int rc = va_arg(*pArgs, int);
    740                 char ch = *(*ppszFormat)++;
    741735#ifdef IN_RING3                         /* we don't want this anywhere else yet. */
    742736                PCRTSTATUSMSG pMsg = RTErrGet(rc);
    743                 switch (ch)
     737                switch (*(*ppszFormat)++)
    744738                {
    745739                    case 'c':
     
    756750                }
    757751#else /* !IN_RING3 */
    758                 switch (ch)
     752                switch (*(*ppszFormat)++)
    759753                {
    760754                    case 'c':
     
    778772            {
    779773                long rc = va_arg(*pArgs, long);
    780                 char ch = *(*ppszFormat)++;
    781774# if defined(RT_OS_WINDOWS)
    782775                PCRTWINERRMSG pMsg = RTErrWinGet(rc);
    783776# endif
    784                 switch (ch)
     777                switch (*(*ppszFormat)++)
    785778                {
    786779# if defined(RT_OS_WINDOWS)
  • trunk/src/VBox/Runtime/common/string/utf-8.cpp

    r21791 r25000  
    11601160               &&   !(uMask & 1))
    11611161        {
    1162             unsigned uch = *--puch;
     1162            uch = *--puch;
    11631163            if ((uch & 0xc0) != 0x80)
    11641164            {
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