VirtualBox

Changeset 64763 in vbox for trunk/src/VBox/GuestHost/OpenGL


Ignore:
Timestamp:
Nov 29, 2016 5:59:55 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
112107
Message:

pixel.c: Compile with older gcc without failing on global shadow declaration of 'index'.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/OpenGL/util/pixel.c

    r63199 r64763  
    382382        }
    383383    }
    384     else if (srcFormat == GL_LUMINANCE 
     384    else if (srcFormat == GL_LUMINANCE
    385385#ifdef CR_EXT_texture_sRGB
    386386             || srcFormat == GL_SLUMINANCE_EXT
     
    983983#endif
    984984             ) {
    985         int index;
     985        int idx;
    986986        if (dstFormat == GL_RED)
    987             index = 0;
    988         else if (dstFormat == GL_LUMINANCE 
     987            idx = 0;
     988        else if (dstFormat == GL_LUMINANCE
    989989#ifdef CR_EXT_texture_sRGB
    990990                 || dstFormat == GL_SLUMINANCE_EXT
     
    992992#endif
    993993                )
    994             index = 0;
     994            idx = 0;
    995995        else if (dstFormat == GL_INTENSITY)
    996             index = 0;
     996            idx = 0;
    997997        else if (dstFormat == GL_GREEN)
    998             index = 1;
     998            idx = 1;
    999999        else if (dstFormat == GL_BLUE)
    1000             index = 2;
     1000            idx = 2;
    10011001        else
    1002             index = 3;
     1002            idx = 3;
    10031003        switch (dstType) {
    10041004            case GL_BYTE:
    10051005                for (i = 0; i < width; i++)
    1006                     bDst[i] = FLOAT_TO_BYTE(tmpRow[i*4+index]);
     1006                    bDst[i] = FLOAT_TO_BYTE(tmpRow[i*4+idx]);
    10071007                break;
    10081008            case GL_UNSIGNED_BYTE:
    10091009                for (i = 0; i < width; i++)
    1010                     ubDst[i] = FLOAT_TO_UBYTE(tmpRow[i*4+index]);
     1010                    ubDst[i] = FLOAT_TO_UBYTE(tmpRow[i*4+idx]);
    10111011                break;
    10121012            case GL_SHORT:
    10131013                for (i = 0; i < width; i++)
    1014                     sDst[i] = FLOAT_TO_SHORT(tmpRow[i*4+index]);
     1014                    sDst[i] = FLOAT_TO_SHORT(tmpRow[i*4+idx]);
    10151015                break;
    10161016            case GL_UNSIGNED_SHORT:
    10171017                for (i = 0; i < width; i++)
    1018                     usDst[i] = FLOAT_TO_USHORT(tmpRow[i*4+index]);
     1018                    usDst[i] = FLOAT_TO_USHORT(tmpRow[i*4+idx]);
    10191019                break;
    10201020            case GL_INT:
    10211021                for (i = 0; i < width; i++)
    1022                     iDst[i] = FLOAT_TO_INT(tmpRow[i*4+index]);
     1022                    iDst[i] = FLOAT_TO_INT(tmpRow[i*4+idx]);
    10231023                break;
    10241024            case GL_UNSIGNED_INT:
    10251025                for (i = 0; i < width; i++)
    1026                     uiDst[i] = FLOAT_TO_UINT(tmpRow[i*4+index]);
     1026                    uiDst[i] = FLOAT_TO_UINT(tmpRow[i*4+idx]);
    10271027                break;
    10281028            case GL_FLOAT:
    10291029                for (i = 0; i < width; i++)
    1030                     fDst[i] = tmpRow[i*4+index];
     1030                    fDst[i] = tmpRow[i*4+idx];
    10311031                break;
    10321032            case GL_DOUBLE:
    10331033                for (i = 0; i < width; i++)
    1034                     dDst[i] = tmpRow[i*4+index];
     1034                    dDst[i] = tmpRow[i*4+idx];
    10351035                break;
    10361036            default:
     
    15891589        {
    15901590            CRASSERT(srcBytesPerRow == dstBytesPerRow);
    1591            
    1592             if (srcBytesPerRow==srcRowStrideBytes 
     1591
     1592            if (srcBytesPerRow==srcRowStrideBytes
    15931593                && srcRowStrideBytes==dstRowStrideBytes)
    15941594            {
     
    18061806    char  depth;
    18071807    char  imagedesc;
    1808    
     1808
    18091809} tgaheader_t;
    18101810#pragma pack()
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