svga: add missing fallthrough comments
[mesa.git] / src / mesa / main / texcompress_s3tc_tmp.h
index 61630f24751ee3b280849fe97d1589370157c835..5dd25222f15a112af84e7870533b431dbf284c43 100644 (file)
@@ -22,6 +22,9 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
+#ifndef TEXCOMPRESS_S3TC_TMP_H
+#define TEXCOMPRESS_S3TC_TMP_H
+
 #ifdef __APPLE__
 #include <OpenGL/gl.h>
 #else
@@ -56,7 +59,7 @@ static void dxt135_decode_imageblock ( const GLubyte *img_block_src,
    const GLushort color0 = img_block_src[0] | (img_block_src[1] << 8);
    const GLushort color1 = img_block_src[2] | (img_block_src[3] << 8);
    const GLuint bits = img_block_src[4] | (img_block_src[5] << 8) |
-      (img_block_src[6] << 16) | (img_block_src[7] << 24);
+      (img_block_src[6] << 16) | ((GLuint)img_block_src[7] << 24);
    /* What about big/little endian? */
    GLubyte bit_pos = 2 * (j * 4 + i) ;
    GLubyte code = (GLubyte) ((bits >> bit_pos) & 3);
@@ -182,8 +185,8 @@ static void fetch_2d_texel_rgba_dxt5(GLint srcRowStride, const GLubyte *pixdata,
 
 #define ALPHACUT 127
 
-static void fancybasecolorsearch( GLubyte *blkaddr, GLubyte srccolors[4][4][4], GLubyte *bestcolor[2],
-                           GLint numxpixels, GLint numypixels, GLint type, GLboolean haveAlpha)
+static void fancybasecolorsearch( UNUSED GLubyte *blkaddr, GLubyte srccolors[4][4][4], GLubyte *bestcolor[2],
+                           GLint numxpixels, GLint numypixels, UNUSED GLint type, UNUSED GLboolean haveAlpha)
 {
    /* use same luminance-weighted distance metric to determine encoding as for finding the base colors */
 
@@ -194,7 +197,7 @@ static void fancybasecolorsearch( GLubyte *blkaddr, GLubyte srccolors[4][4][4],
    GLuint pixerror, pixerrorred, pixerrorgreen, pixerrorblue, pixerrorbest;
    GLint colordist, blockerrlin[2][3];
    GLubyte nrcolor[2];
-   GLint pixerrorcolorbest[3];
+   GLint pixerrorcolorbest[3] = {0};
    GLubyte enc = 0;
    GLubyte cv[4][4];
    GLubyte testcolor[2][3];
@@ -427,7 +430,7 @@ static void storedxtencodedblock( GLubyte *blkaddr, GLubyte srccolors[4][4][4],
             }
          }
          testerror += pixerrorbest;
-         bits |= enc << (2 * (j * 4 + i));
+         bits |= (uint32_t)enc << (2 * (j * 4 + i));
       }
    }
    /* some hw might disagree but actually decoding should always use 4-color encoding
@@ -467,7 +470,7 @@ static void storedxtencodedblock( GLubyte *blkaddr, GLubyte srccolors[4][4][4],
                }
             }
             testerror2 += pixerrorbest;
-            bits2 |= enc << (2 * (j * 4 + i));
+            bits2 |= (uint32_t)enc << (2 * (j * 4 + i));
          }
       }
    } else {
@@ -987,3 +990,5 @@ static void tx_compress_dxtn(GLint srccomps, GLint width, GLint height, const GL
       return;
    }
 }
+
+#endif