[Mesa-dev] [PATCH v2 17/29] mesa/main/framebuffer.h: Fix one -Wsign-compare warning in ?: construct.

Gert Wollny gw.fossdev at gmail.com
Tue Nov 21 10:47:07 UTC 2017


Am Donnerstag, den 16.11.2017, 22:52 +0100 schrieb Gert Wollny:
> Am Donnerstag, den 16.11.2017, 17:13 +0000 schrieb Emil Velikov:
> > 
> > According to the spec both of these are 'Z + Non-negative integer
> > or enumerated value' Worth doing that instead?
> 
> After having a short look into it, I guess it is doable, but I'd then
> prefer to drop this patch from the series and do this separately,
> i.e. really track this value to make its use consistent (also with
> respect to function parameters etc). 

I had now a closer look at this: AFAICS the Visual.samples parameter is
ultimately a user provided value via glXChooseVisual and could be set
to a negative value. 

Right now a negative value is silently interpreted as if it would be 
zero. When one changes the definition of this variable
(gl_config::samples) to unsigned, one should check that no negative
value is passed. The question is, should it be silently set to zero
thereby keeping the current behaviour, or should glXChooseVisual return
NULL (i.e. an error)? 

Best, 
Gert 





More information about the mesa-dev mailing list