util/texcompress: fix comparison warning

Fixes warnings reported by static analysis. It shouldn't change
the behavior as numxpixels/numypixels should always be smaller
than 255.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35877>
This commit is contained in:
Pierre-Eric Pelloux-Prayer
2025-06-27 10:25:03 +02:00
committed by Marge Bot
parent 41c7e6b17c
commit fddd5bc2e5
3 changed files with 8 additions and 6 deletions

View File

@@ -49,7 +49,7 @@
static void extractsrc_u( GLubyte srcpixels[4][4], const GLubyte *srcaddr,
GLint srcRowStride, GLint numxpixels, GLint numypixels, GLint comps)
{
GLubyte i, j;
GLint i, j;
const GLubyte *curaddr;
for (j = 0; j < numypixels; j++) {
curaddr = srcaddr + j * srcRowStride * comps;
@@ -63,7 +63,7 @@ static void extractsrc_u( GLubyte srcpixels[4][4], const GLubyte *srcaddr,
static void extractsrc_s( GLbyte srcpixels[4][4], const GLbyte *srcaddr,
GLint srcRowStride, GLint numxpixels, GLint numypixels, GLint comps)
{
GLubyte i, j;
GLint i, j;
const GLbyte *curaddr;
for (j = 0; j < numypixels; j++) {
curaddr = srcaddr + j * srcRowStride * comps;

View File

@@ -509,7 +509,7 @@ static void encodedxtcolorblockfaster( GLubyte *blkaddr, GLubyte srccolors[4][4]
GLubyte *bestcolor[2];
GLubyte basecolors[2][3];
GLubyte i, j;
GLint i, j;
GLuint lowcv, highcv, testcv;
GLboolean haveAlpha = GL_FALSE;
@@ -570,7 +570,8 @@ static void encodedxt5alpha(GLubyte *blkaddr, GLubyte srccolors[4][4][4],
GLubyte alphabase[2], alphause[2];
GLshort alphatest[2];
GLuint alphablockerror1, alphablockerror2, alphablockerror3;
GLubyte i, j, aindex, acutValues[7];
GLint i, j;
GLubyte aindex, acutValues[7];
GLubyte alphaenc1[16], alphaenc2[16], alphaenc3[16];
GLboolean alphaabsmin = GL_FALSE;
GLboolean alphaabsmax = GL_FALSE;
@@ -889,7 +890,7 @@ static void encodedxt5alpha(GLubyte *blkaddr, GLubyte srccolors[4][4][4],
static void extractsrccolors( GLubyte srcpixels[4][4][4], const GLchan *srcaddr,
GLint srcRowStride, GLint numxpixels, GLint numypixels, GLint comps)
{
GLubyte i, j, c;
GLint i, j, c;
const GLchan *curaddr;
for (j = 0; j < numypixels; j++) {
curaddr = srcaddr + j * srcRowStride * comps;

View File

@@ -79,7 +79,8 @@ void TAG(encode_rgtc_ubyte)(TYPE *blkaddr, TYPE srccolors[4][4],
TYPE alphabase[2], alphause[2];
short alphatest[2] = { 0 };
unsigned int alphablockerror1, alphablockerror2, alphablockerror3;
TYPE i, j, aindex, acutValues[7];
int i, j;
TYPE aindex, acutValues[7];
TYPE alphaenc1[16], alphaenc2[16], alphaenc3[16];
int alphaabsmin = 0, alphaabsmax = 0;
short alphadist;