Commit de8c478c authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

glu32: Avoid an ARRAY_SIZE-like macro.

parent 9477a0ad
......@@ -91,7 +91,6 @@ static const struct { GLuint err; const char *str; } errors[] =
{ GLU_NURBS_ERROR36, "null control point reference" },
{ GLU_NURBS_ERROR37, "duplicate point on piecewise linear trimming curve" },
};
#define NB_ERRORS (sizeof(errors) / sizeof(errors[0]))
typedef void (*_GLUfuncptr)(void);
......@@ -148,7 +147,7 @@ const GLubyte * WINAPI wine_gluErrorString( GLenum errCode )
{
unsigned int i;
for (i = 0; i < NB_ERRORS; i++)
for (i = 0; i < ARRAY_SIZE(errors); i++)
if (errors[i].err == errCode) return (const GLubyte *)errors[i].str;
return NULL;
......@@ -159,10 +158,10 @@ const GLubyte * WINAPI wine_gluErrorString( GLenum errCode )
*/
const WCHAR * WINAPI wine_gluErrorUnicodeStringEXT( GLenum errCode )
{
static WCHAR errorsW[NB_ERRORS][64];
static WCHAR errorsW[ARRAY_SIZE(errors)][64];
unsigned int i, j;
for (i = 0; i < NB_ERRORS; i++)
for (i = 0; i < ARRAY_SIZE(errors); i++)
{
if (errors[i].err != errCode) continue;
if (!errorsW[i][0]) /* errors use only ASCII, do a simple mapping */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment