diff options
author | Demi Marie Obenour <demiobenour@gmail.com> | 2022-10-16 01:50:53 -0400 |
---|---|---|
committer | Demi Marie Obenour <demiobenour@gmail.com> | 2022-10-16 15:44:42 -0400 |
commit | 33f3dbe3699a92e8ca18f470adac456e0b935e75 (patch) | |
tree | 2db4be3b80e8a1a7a8efcfaa0f5a348f0163f284 /src | |
parent | c9513aac2d78808f63b83d71072c2c483b20162d (diff) |
Fix handling of documented enum parameters
Previously this would crash the code generator.
Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/c_client.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/c_client.py b/src/c_client.py index fd256f0..0213d01 100644 --- a/src/c_client.py +++ b/src/c_client.py @@ -2266,13 +2266,13 @@ def _c_request_helper(self, name, void, regular, aux=False, reply_fds=False): elif base_func_name == 'xcb_create_window' and field.c_field_name == 'value_mask': field.enum = 'CW' if field.enum: - # XXX: why the 'xcb' prefix? - key = ('xcb', field.enum) + assert 2 <= len(self.name) <= 3 + key = (*self.name[:-1], field.enum) tname = _t(key) if namecount[tname] > 1: tname = _t(key + ('enum',)) - _h(' * @param %s A bitmask of #%s values.' % (field.c_field_name, tname)) + _h(' * @param %s A bitmask of #%s values.', field.c_field_name, tname) if self.doc and field.field_name in self.doc.fields: desc = self.doc.fields[field.field_name] @@ -2280,7 +2280,8 @@ def _c_request_helper(self, name, void, regular, aux=False, reply_fds=False): desc = desc.replace('`%s`' % name, '\\a %s' % (name)) desc = desc.split("\n") desc = [line if line != '' else '\\n' for line in desc] - _h(' * @param %s %s' % (field.c_field_name, "\n * ".join(desc))) + _h(' * @param %s %s', field.c_field_name, "\n * ".join(desc)) + # If there is no documentation yet, we simply don't generate an # @param tag. Doxygen will then warn about missing documentation. |