[Mesa-dev] [PATCH 02/27] gbm: Fix width height getters return type (trivial)

Ben Widawsky ben at bwidawsk.net
Fri Dec 2 18:17:36 UTC 2016


On 16-12-02 18:07:22, Daniel Stone wrote:
>Hi,
>
>On 2 December 2016 at 17:56, Eric Engestrom <eric.engestrom at imgtec.com> wrote:
>> On Thursday, 2016-12-01 14:09:43 -0800, Ben Widawsky wrote:
>>> --- a/src/gbm/main/gbm.h
>>> +++ b/src/gbm/main/gbm.h
>>> @@ -294,10 +294,10 @@ gbm_bo_map(struct gbm_bo *bo,
>>>  void
>>>  gbm_bo_unmap(struct gbm_bo *bo, void *map_data);
>>>
>>> -uint32_t
>>> +unsigned int
>>>  gbm_bo_get_width(struct gbm_bo *bo);
>>>
>>> -uint32_t
>>> +unsigned int
>>>  gbm_bo_get_height(struct gbm_bo *bo);
>>
>> I'm not sure I understand this change. Why would you want to remove the
>> information of the type size? If the point is to increase it on 64-bit
>> machines, I'd go with an explicit `uint64_t` instead.
>
>I have to admit I didn't catch this one. It doesn't help on 64-bit
>since unsigned int is still 32-bit there, and in any case it's library
>ABI, so if it doesn't change anything then it doesn't help, and if it
>does then it's an ABI break, so NAK from me.
>
>Cheers,
>Daniel

It was like the patch says, meant to match the definition of the implementation.
The exported symbol is defined as unsigned int. It had nothing to do with
64-bit.

GBM_EXPORT unsigned int
gbm_bo_get_height(struct gbm_bo *bo)

I'd say they should match, and both can be uint32_t. I don't care much either
way.


More information about the mesa-dev mailing list