Array fields are not handled

Bug #570683 reported by vldmrrr
4
This bug affects 1 person
Affects Status Importance Assigned to Milestone
PyBindGen
Confirmed
Low
Unassigned

Bug Description

Attached is proposed patch to handle array fields in structures. Also adds few missing type aliases

Revision history for this message
vldmrrr (vldmrrr) wrote :
Revision history for this message
Gustavo Carneiro (gjc) wrote :

Hi. Sorry for not merging this yet. I had look at the patch a long time ago, found something wrong, wanted to fix it myself, but then I ran out of time.

IIRC, one thing I found wrong is:

 class UnsignedIntPtrParam(PointerParameter):

     DIRECTIONS = [Parameter.DIRECTION_IN, Parameter.DIRECTION_OUT, Parameter.DIRECTION_INOUT]
- CTYPES = ['unsigned int*', 'uint32_t*']
+ CTYPES = ['uint32_t*', 'unsigned int*', 'unsigned long*', 'long unsigned*', 'long unsigned int*', 'unsigned long int*']

The problem is that "unsigned long" is a 64-bit integer on LP64 platforms (64-bit linux, for instance), and 32-bit one in ILP32 (32-bit system) or LLP64 (64-bit Windows). So we really can't mix "long int" and "int".

I think there was something wrong in the gccxmlparser.py part, but I don't remember exactly what it was. I hope to eventually find time to review this patch. If you're in a hurry to get this in, one thing that can help is the inclusion of unit tests to exercise this new array field functionality.

Gustavo Carneiro (gjc)
Changed in pybindgen:
status: New → Confirmed
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.