mirror of
https://gitlab.freedesktop.org/xorg/lib/libxcb.git
synced 2025-12-20 04:30:12 +01:00
c_client.py: document complex reply field accessor
Part-of: <https://gitlab.freedesktop.org/xorg/lib/libxcb/-/merge_requests/74>
This commit is contained in:
parent
a6deeded59
commit
a0d4be4593
1 changed files with 3 additions and 0 deletions
|
|
@ -1926,6 +1926,9 @@ def _c_accessors_list(self, field):
|
|||
if f == field:
|
||||
break
|
||||
prev_field = f
|
||||
# utilize the previous field and its number of elements to index past the end of the reply
|
||||
# e.g. if the final field is uint8_t pad[2], generate &R->pad + 2
|
||||
# e.g. if the final field is uint16_t len, generate &R->len + 1
|
||||
_c(' return (%s *) (&R->%s + %d);', field.c_field_type, prev_field.c_field_name, prev_field.type.nmemb)
|
||||
else:
|
||||
_c(' return (%s *) (R + 1);', field.c_field_type)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue