Make what the final code is doing a bit more clear to slow readers like me.
Showing the changes to scripts (1 of 1 file). Show all
Unified · Split
| @@ -568,12 +568,18 @@ class KernelDoc: · 567 unmodified lines | |||
| 568 | 568 | ||
| 569 | bitfield_re = KernRe(r'(.*?):(\w+)') | 569 | bitfield_re = KernRe(r'(.*?):(\w+)') |
| 570 | for param in args: | 570 | for param in args: |
| 571 | # | ||
| 572 | # For pointers, shift the star(s) from the variable name to the | ||
| 573 | # type declaration. | ||
| 574 | # | ||
| 571 | r = KernRe(r'^(\*+)\s*(.*)') | 575 | r = KernRe(r'^(\*+)\s*(.*)') |
| 572 | if r.match(param): | 576 | if r.match(param): |
| 573 | self.push_parameter(ln, decl_type, r.group(2), | 577 | self.push_parameter(ln, decl_type, r.group(2), |
| 574 | f"{dtype} {r.group(1)}", | 578 | f"{dtype} {r.group(1)}", |
| 575 | arg, declaration_name) | 579 | arg, declaration_name) |
| 576 | 580 | # | |
| 581 | # Perform a similar shift for bitfields. | ||
| 582 | # | ||
| 577 | elif bitfield_re.search(param): | 583 | elif bitfield_re.search(param): |
| 578 | if dtype != "": # Skip unnamed bit-fields | 584 | if dtype != "": # Skip unnamed bit-fields |
| 579 | self.push_parameter(ln, decl_type, bitfield_re.group(1), | 585 | self.push_parameter(ln, decl_type, bitfield_re.group(1), |