[Mesa-dev] [PATCH] mesa: Silence GCC unused variable warnings.

Vinson Lee vlee at freedesktop.org
Tue Jan 3 00:03:36 PST 2012


Silences these GCC warnings.
warning: unused variable 'texelBytes'

Signed-off-by: Vinson Lee <vlee at freedesktop.org>
---
 src/mesa/main/texstore.c |   34 ++++++++++++++++++++++++++++++++++
 1 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index bb2fe25..90aa97d 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -981,6 +981,7 @@ _mesa_texstore_z32(TEXSTORE_PARAMS)
    ASSERT(dstFormat == MESA_FORMAT_Z32 ||
           dstFormat == MESA_FORMAT_Z32_FLOAT);
    ASSERT(texelBytes == sizeof(GLuint));
+   (void) texelBytes;
 
    if (dstFormat == MESA_FORMAT_Z32)
       dstType = GL_UNSIGNED_INT;
@@ -1094,6 +1095,7 @@ _mesa_texstore_z16(TEXSTORE_PARAMS)
    (void) dims;
    ASSERT(dstFormat == MESA_FORMAT_Z16);
    ASSERT(texelBytes == sizeof(GLushort));
+   (void) texelBytes;
 
    if (ctx->Pixel.DepthScale == 1.0f &&
        ctx->Pixel.DepthBias == 0.0f &&
@@ -1140,6 +1142,7 @@ _mesa_texstore_rgb565(TEXSTORE_PARAMS)
    ASSERT(dstFormat == MESA_FORMAT_RGB565 ||
           dstFormat == MESA_FORMAT_RGB565_REV);
    ASSERT(texelBytes == 2);
+   (void) texelBytes;
 
    if (!ctx->_ImageTransferState &&
        !srcPacking->SwapBytes &&
@@ -1245,6 +1248,7 @@ _mesa_texstore_rgba8888(TEXSTORE_PARAMS)
           dstFormat == MESA_FORMAT_RGBX8888 ||
           dstFormat == MESA_FORMAT_RGBX8888_REV);
    ASSERT(texelBytes == 4);
+   (void) texelBytes;
 
    if (!ctx->_ImageTransferState &&
        !srcPacking->SwapBytes &&
@@ -1370,6 +1374,7 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS)
           dstFormat == MESA_FORMAT_XRGB8888 ||
           dstFormat == MESA_FORMAT_XRGB8888_REV );
    ASSERT(texelBytes == 4);
+   (void) texelBytes;
 
    if (!ctx->_ImageTransferState &&
        !srcPacking->SwapBytes &&
@@ -1564,6 +1569,7 @@ _mesa_texstore_rgb888(TEXSTORE_PARAMS)
 
    ASSERT(dstFormat == MESA_FORMAT_RGB888);
    ASSERT(texelBytes == 3);
+   (void) texelBytes;
 
    if (!ctx->_ImageTransferState &&
        !srcPacking->SwapBytes &&
@@ -1682,6 +1688,7 @@ _mesa_texstore_bgr888(TEXSTORE_PARAMS)
 
    ASSERT(dstFormat == MESA_FORMAT_BGR888);
    ASSERT(texelBytes == 3);
+   (void) texelBytes;
 
    if (!ctx->_ImageTransferState &&
        !srcPacking->SwapBytes &&
@@ -1781,6 +1788,7 @@ _mesa_texstore_argb4444(TEXSTORE_PARAMS)
    ASSERT(dstFormat == MESA_FORMAT_ARGB4444 ||
           dstFormat == MESA_FORMAT_ARGB4444_REV);
    ASSERT(texelBytes == 2);
+   (void) texelBytes;
 
    if (!ctx->_ImageTransferState &&
        !srcPacking->SwapBytes &&
@@ -1845,6 +1853,7 @@ _mesa_texstore_rgba5551(TEXSTORE_PARAMS)
 
    ASSERT(dstFormat == MESA_FORMAT_RGBA5551);
    ASSERT(texelBytes == 2);
+   (void) texelBytes;
 
    if (!ctx->_ImageTransferState &&
        !srcPacking->SwapBytes &&
@@ -1899,6 +1908,7 @@ _mesa_texstore_argb1555(TEXSTORE_PARAMS)
    ASSERT(dstFormat == MESA_FORMAT_ARGB1555 ||
           dstFormat == MESA_FORMAT_ARGB1555_REV);
    ASSERT(texelBytes == 2);
+   (void) texelBytes;
 
    if (!ctx->_ImageTransferState &&
        !srcPacking->SwapBytes &&
@@ -1964,6 +1974,7 @@ _mesa_texstore_argb2101010(TEXSTORE_PARAMS)
 
    ASSERT(dstFormat == MESA_FORMAT_ARGB2101010);
    ASSERT(texelBytes == 4);
+   (void) texelBytes;
 
    if (!ctx->_ImageTransferState &&
        !srcPacking->SwapBytes &&
@@ -2043,6 +2054,7 @@ _mesa_texstore_unorm44(TEXSTORE_PARAMS)
 
    ASSERT(dstFormat == MESA_FORMAT_AL44);
    ASSERT(texelBytes == 1);
+   (void) texelBytes;
 
    {
       /* general path */
@@ -2090,6 +2102,7 @@ _mesa_texstore_unorm88(TEXSTORE_PARAMS)
           dstFormat == MESA_FORMAT_GR88 ||
           dstFormat == MESA_FORMAT_RG88);
    ASSERT(texelBytes == 2);
+   (void) texelBytes;
 
    if (!ctx->_ImageTransferState &&
        !srcPacking->SwapBytes &&
@@ -2207,6 +2220,7 @@ _mesa_texstore_unorm1616(TEXSTORE_PARAMS)
 	  dstFormat == MESA_FORMAT_RG1616 ||
           dstFormat == MESA_FORMAT_RG1616_REV);
    ASSERT(texelBytes == 4);
+   (void) texelBytes;
 
    if (!ctx->_ImageTransferState &&
        !srcPacking->SwapBytes &&
@@ -2284,6 +2298,7 @@ _mesa_texstore_unorm16(TEXSTORE_PARAMS)
           dstFormat == MESA_FORMAT_L16 ||
           dstFormat == MESA_FORMAT_I16);
    ASSERT(texelBytes == 2);
+   (void) texelBytes;
 
    if (!ctx->_ImageTransferState &&
        !srcPacking->SwapBytes &&
@@ -2338,6 +2353,7 @@ _mesa_texstore_rgba_16(TEXSTORE_PARAMS)
 
    ASSERT(dstFormat == MESA_FORMAT_RGBA_16);
    ASSERT(texelBytes == 8);
+   (void) texelBytes;
 
    if (!ctx->_ImageTransferState &&
        !srcPacking->SwapBytes &&
@@ -2473,6 +2489,7 @@ _mesa_texstore_rgb332(TEXSTORE_PARAMS)
 
    ASSERT(dstFormat == MESA_FORMAT_RGB332);
    ASSERT(texelBytes == 1);
+   (void) texelBytes;
 
    if (!ctx->_ImageTransferState &&
        !srcPacking->SwapBytes &&
@@ -2529,6 +2546,7 @@ _mesa_texstore_unorm8(TEXSTORE_PARAMS)
           dstFormat == MESA_FORMAT_I8 ||
           dstFormat == MESA_FORMAT_R8);
    ASSERT(texelBytes == 1);
+   (void) texelBytes;
 
    if (!ctx->_ImageTransferState &&
        !srcPacking->SwapBytes &&
@@ -2611,6 +2629,7 @@ _mesa_texstore_ycbcr(TEXSTORE_PARAMS)
    ASSERT((dstFormat == MESA_FORMAT_YCBCR) ||
           (dstFormat == MESA_FORMAT_YCBCR_REV));
    ASSERT(texelBytes == 2);
+   (void) texelBytes;
    ASSERT(ctx->Extensions.MESA_ycbcr_texture);
    ASSERT(srcFormat == GL_YCBCR_MESA);
    ASSERT((srcType == GL_UNSIGNED_SHORT_8_8_MESA) ||
@@ -2743,6 +2762,7 @@ _mesa_texstore_snorm8(TEXSTORE_PARAMS)
           dstFormat == MESA_FORMAT_SIGNED_I8 ||
           dstFormat == MESA_FORMAT_SIGNED_R8);
    ASSERT(texelBytes == 1);
+   (void) texelBytes;
 
    if (!ctx->_ImageTransferState &&
        !srcPacking->SwapBytes &&
@@ -2797,6 +2817,7 @@ _mesa_texstore_snorm88(TEXSTORE_PARAMS)
    ASSERT(dstFormat == MESA_FORMAT_SIGNED_AL88 ||
           dstFormat == MESA_FORMAT_SIGNED_RG88_REV);
    ASSERT(texelBytes == 2);
+   (void) texelBytes;
 
    if (!ctx->_ImageTransferState &&
        !srcPacking->SwapBytes &&
@@ -2854,6 +2875,7 @@ _mesa_texstore_snorm16(TEXSTORE_PARAMS)
           dstFormat == MESA_FORMAT_SIGNED_L16 ||
           dstFormat == MESA_FORMAT_SIGNED_I16);
    ASSERT(texelBytes == 2);
+   (void) texelBytes;
 
    if (!ctx->_ImageTransferState &&
        !srcPacking->SwapBytes &&
@@ -2912,6 +2934,7 @@ _mesa_texstore_snorm1616(TEXSTORE_PARAMS)
    ASSERT(dstFormat == MESA_FORMAT_SIGNED_AL1616 ||
           dstFormat == MESA_FORMAT_SIGNED_GR1616);
    ASSERT(texelBytes == 4);
+   (void) texelBytes;
 
    if (!ctx->_ImageTransferState &&
        !srcPacking->SwapBytes &&
@@ -2971,6 +2994,7 @@ _mesa_texstore_signed_rgbx8888(TEXSTORE_PARAMS)
 
    ASSERT(dstFormat == MESA_FORMAT_SIGNED_RGBX8888);
    ASSERT(texelBytes == 4);
+   (void) texelBytes;
 
    {
       /* general path */
@@ -3021,6 +3045,7 @@ _mesa_texstore_signed_rgba8888(TEXSTORE_PARAMS)
    ASSERT(dstFormat == MESA_FORMAT_SIGNED_RGBA8888 ||
           dstFormat == MESA_FORMAT_SIGNED_RGBA8888_REV);
    ASSERT(texelBytes == 4);
+   (void) texelBytes;
 
    if (!ctx->_ImageTransferState &&
        !srcPacking->SwapBytes &&
@@ -3336,6 +3361,7 @@ _mesa_texstore_rgba_float32(TEXSTORE_PARAMS)
           baseInternalFormat == GL_RED ||
           baseInternalFormat == GL_RG);
    ASSERT(texelBytes == components * sizeof(GLfloat));
+   (void) texelBytes;
 
    if (!ctx->_ImageTransferState &&
        !srcPacking->SwapBytes &&
@@ -3407,6 +3433,7 @@ _mesa_texstore_rgba_float16(TEXSTORE_PARAMS)
           baseInternalFormat == GL_RED ||
           baseInternalFormat == GL_RG);
    ASSERT(texelBytes == components * sizeof(GLhalfARB));
+   (void) texelBytes;
 
    if (!ctx->_ImageTransferState &&
        !srcPacking->SwapBytes &&
@@ -3477,6 +3504,7 @@ _mesa_texstore_rgba_int8(TEXSTORE_PARAMS)
           baseInternalFormat == GL_LUMINANCE_ALPHA ||
           baseInternalFormat == GL_INTENSITY);
    ASSERT(texelBytes == components * sizeof(GLbyte));
+   (void) texelBytes;
 
    /* Note: Pixel transfer ops (scale, bias, table lookup) do not apply
     * to integer formats.
@@ -3547,6 +3575,7 @@ _mesa_texstore_rgba_int16(TEXSTORE_PARAMS)
           baseInternalFormat == GL_LUMINANCE_ALPHA ||
           baseInternalFormat == GL_INTENSITY);
    ASSERT(texelBytes == components * sizeof(GLshort));
+   (void) texelBytes;
 
    /* Note: Pixel transfer ops (scale, bias, table lookup) do not apply
     * to integer formats.
@@ -3617,6 +3646,7 @@ _mesa_texstore_rgba_int32(TEXSTORE_PARAMS)
           baseInternalFormat == GL_LUMINANCE_ALPHA ||
           baseInternalFormat == GL_INTENSITY);
    ASSERT(texelBytes == components * sizeof(GLint));
+   (void) texelBytes;
 
    /* Note: Pixel transfer ops (scale, bias, table lookup) do not apply
     * to integer formats.
@@ -3687,6 +3717,7 @@ _mesa_texstore_rgba_uint8(TEXSTORE_PARAMS)
           baseInternalFormat == GL_LUMINANCE_ALPHA ||
           baseInternalFormat == GL_INTENSITY);
    ASSERT(texelBytes == components * sizeof(GLubyte));
+   (void) texelBytes;
 
    /* Note: Pixel transfer ops (scale, bias, table lookup) do not apply
     * to integer formats.
@@ -3755,6 +3786,7 @@ _mesa_texstore_rgba_uint16(TEXSTORE_PARAMS)
           baseInternalFormat == GL_LUMINANCE_ALPHA ||
           baseInternalFormat == GL_INTENSITY);
    ASSERT(texelBytes == components * sizeof(GLushort));
+   (void) texelBytes;
 
    /* Note: Pixel transfer ops (scale, bias, table lookup) do not apply
     * to integer formats.
@@ -3823,6 +3855,7 @@ _mesa_texstore_rgba_uint32(TEXSTORE_PARAMS)
           baseInternalFormat == GL_LUMINANCE_ALPHA ||
           baseInternalFormat == GL_INTENSITY);
    ASSERT(texelBytes == components * sizeof(GLuint));
+   (void) texelBytes;
 
    /* Note: Pixel transfer ops (scale, bias, table lookup) do not apply
     * to integer formats.
@@ -4152,6 +4185,7 @@ _mesa_texstore_argb2101010_uint(TEXSTORE_PARAMS)
 
    ASSERT(dstFormat == MESA_FORMAT_ARGB2101010_UINT);
    ASSERT(texelBytes == 4);
+   (void) texelBytes;
 
    if (!srcPacking->SwapBytes &&
        dstFormat == MESA_FORMAT_ARGB2101010_UINT &&
-- 
1.7.7.3



More information about the mesa-dev mailing list