[Mesa-dev] [PATCH 1/3] mesa: use GLsizeiptrARB, GLintptrARB in bufferobj.c

Brian Paul brianp at vmware.com
Tue Sep 18 13:27:18 UTC 2018


On 09/17/2018 10:32 PM, Mathias Fröhlich wrote:
> Good Morning,
> 
> On Tuesday, 18 September 2018 05:10:04 CEST Brian Paul wrote:
>> The function pointer declarations in dd.h for the BufferData() and
>> BufferSubData() use the ARB-suffixed datatypes.  This patch changes
>> the buffer_data_fallback() and buffer_sub_data_fallback() functions
>> to use those datatypes too.
>>
>> This fixes a build warning when building 32-bit libraries.  Evidently,
>> GLsizeiptrARB and GLsizeiptr are defined differently in that situation.
>>
>> All all implementations of these driver hooks use the ARB-suffixed
>> types.
> 
> Hmm, all of GL{int,sizei}ptr{,ARB} are typedefs to ptrdiff_t by gl.xml.

gl.xml doesn't seem relevant to this.  In GL/glext.h we have:

typedef khronos_ssize_t GLsizeiptr;
[...]
typedef ptrdiff_t GLsizeiptrARB;

and in KHR/khrplatform.h:

typedef unsigned long  int     khronos_uintptr_t;

and in stdef.h:

typedef __PTRDIFF_TYPE__ ptrdiff_t;

And it looks like __PTRDIFF_TYPE__ is a compiler built-in.

So, gcc is warning that __PTRDIFF_TYPE__ is not the same as unsigned 
long int.  Seems reasonable.


> That makes me think that you may be running into some other problem
> for your build that you may want to know the reason for?
> 
> Anyhow, for mesa itself, it seems reasonable to assign functions with
> exactly the same argument signature to the appropriate driver function pointers.
> 
> This one as well as the other two warning fixes:
> Reviewed-by: Mathias Fröhlich <Mathias.Froehlich at web.de>

Thanks.

-Brian


More information about the mesa-dev mailing list