X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fmain%2Fquerymatrix.c;h=18361c929fb5d2627bbd6112c98f7b6ec2eb73f3;hb=29d70f5de966c18d563475bc5f60f252e9a900a3;hp=ca6b023379efcd1677a0fa38599b01b1465dbe91;hpb=97f6d50f7247c40eeef33219e5cf5ccb7bf6d4ea;p=mesa.git diff --git a/src/mesa/main/querymatrix.c b/src/mesa/main/querymatrix.c index ca6b023379e..18361c929fb 100644 --- a/src/mesa/main/querymatrix.c +++ b/src/mesa/main/querymatrix.c @@ -49,13 +49,12 @@ _mesa_QueryMatrixxOES(GLfixed mantissa[16], GLint exponent[16]) * NaN or Inf). In case of error, everything is invalid. */ GLbitfield rv; - register unsigned int i; - unsigned int bit; + unsigned i, bit; /* This data structure defines the mapping between the current matrix * mode and the desired matrix identifier. */ - static struct { + static const struct { GLenum currentMode; GLenum desiredMatrix; } modes[] = { @@ -76,7 +75,7 @@ _mesa_QueryMatrixxOES(GLfixed mantissa[16], GLint exponent[16]) * we can return immediately, as _mesa_GetInteger() will have * logged the necessary error already. */ - for (i = 0; i < sizeof(modes)/sizeof(modes[0]); i++) { + for (i = 0; i < ARRAY_SIZE(modes); i++) { if (modes[i].currentMode == currentMode) { desiredMatrix = modes[i].desiredMatrix; break;