Bug 8113 - Invalid define in varray.c
Summary: Invalid define in varray.c
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: 6.5
Hardware: x86 (IA32) Windows (All)
: high normal
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-03 12:38 UTC by Marcus
Modified: 2006-09-04 07:09 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Marcus 2006-09-03 12:38:38 UTC
In the function 

void GLAPIENTRY _mesa_EdgeFlagPointer(GLsizei stride, const GLvoid *ptr)
(Line 436 of the file varray.c) 

it says:

   update_array(ctx, &ctx->Array.ArrayObj->EdgeFlag, _NEW_ARRAY_EDGEFLAG,
	   sizeof(GLboolean), 1, GL_BOOLEAN, stride, GL_FALSE, ptr);

while it should be:

   update_array(ctx, &ctx->Array.ArrayObj->EdgeFlag, _NEW_ARRAY_EDGEFLAG,
	   sizeof(GLboolean), 1, GL_UNSIGNED_BYTE, stride, GL_FALSE, ptr);

Someone has defined GL_BOOLEAN and only used it in this place ! Shame on him :)
Comment 1 Brian Paul 2006-09-04 07:06:09 UTC
Well, the implicit type of an edge flag _is_ GLboolean, but there's not a
GL_BOOLEAN token defined by gl.h, so it's not unreasonable.

But since the Type field of edge flag arrays is never used, it could just as
well be GL_UNSIGNED_BYTE.  I'll change it just to get rid of the extra #define.
Comment 2 Marcus 2006-09-04 07:09:55 UTC
(In reply to comment #1)
> Well, the implicit type of an edge flag _is_ GLboolean, but there's not a
> GL_BOOLEAN token defined by gl.h, so it's not unreasonable.

I have no problem with such an extra define, but giving it the value 9999
results in a crash, because it is used later on.

> But since the Type field of edge flag arrays is never used, it could just as
> well be GL_UNSIGNED_BYTE.  I'll change it just to get rid of the extra #define.
> 

Thats not correct, it is used. (Don't known the exact location atm, but I can
look if you wish )



Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.