Some typedef expressions are output as normal functions. As we need to be clearer about the type with Sphinx 3.x, detect such cases. While here, fix a wrongly-indented block.
Showing the changes to scripts (1 of 1 file). Show all
Unified · Split
| @@ -1748,30 +1748,48 @@ sub dump_function($$) { · 1747 unmodified lines | |||
| 1748 | return; | 1748 | return; |
| 1749 | } | 1749 | } |
| 1750 | 1750 | ||
| 1751 | my $prms = join " ", @parameterlist; | 1751 | my $prms = join " ", @parameterlist; |
| 1752 | check_sections($file, $declaration_name, "function", $sectcheck, $prms); | 1752 | check_sections($file, $declaration_name, "function", $sectcheck, $prms); |
| 1753 | 1753 | ||
| 1754 | # This check emits a lot of warnings at the moment, because many | 1754 | # This check emits a lot of warnings at the moment, because many |
| 1755 | # functions don't have a 'Return' doc section. So until the number | 1755 | # functions don't have a 'Return' doc section. So until the number |
| 1756 | # of warnings goes sufficiently down, the check is only performed in | 1756 | # of warnings goes sufficiently down, the check is only performed in |
| 1757 | # verbose mode. | 1757 | # verbose mode. |
| 1758 | # TODO: always perform the check. | 1758 | # TODO: always perform the check. |
| 1759 | if ($verbose && !$noret) { | 1759 | if ($verbose && !$noret) { |
| 1760 | check_return_section($file, $declaration_name, $return_type); | 1760 | check_return_section($file, $declaration_name, $return_type); |
| 1761 | } | 1761 | } |
| 1762 | 1762 | ||
| 1763 | output_declaration($declaration_name, | 1763 | # The function parser can be called with a typedef parameter. |
| 1764 | 'function', | 1764 | # Handle it. |
| 1765 | {'function' => $declaration_name, | 1765 | if ($return_type =~ /typedef/) { |
| 1766 | 'module' => $modulename, | 1766 | output_declaration($declaration_name, |
| 1767 | 'functiontype' => $return_type, | 1767 | 'function', |
| 1768 | 'parameterlist' => \@parameterlist, | 1768 | {'function' => $declaration_name, |
| 1769 | 'parameterdescs' => \%parameterdescs, | 1769 | 'typedef' => 1, |
| 1770 | 'parametertypes' => \%parametertypes, | 1770 | 'module' => $modulename, |
| 1771 | 'sectionlist' => \@sectionlist, | 1771 | 'functiontype' => $return_type, |
| 1772 | 'sections' => \%sections, | 1772 | 'parameterlist' => \@parameterlist, |
| 1773 | 'purpose' => $declaration_purpose | 1773 | 'parameterdescs' => \%parameterdescs, |
| 1774 | }); | 1774 | 'parametertypes' => \%parametertypes, |
| 1775 | 'sectionlist' => \@sectionlist, | ||
| 1776 | 'sections' => \%sections, | ||
| 1777 | 'purpose' => $declaration_purpose | ||
| 1778 | }); | ||
| 1779 | } else { | ||
| 1780 | output_declaration($declaration_name, | ||
| 1781 | 'function', | ||
| 1782 | {'function' => $declaration_name, | ||
| 1783 | 'module' => $modulename, | ||
| 1784 | 'functiontype' => $return_type, | ||
| 1785 | 'parameterlist' => \@parameterlist, | ||
| 1786 | 'parameterdescs' => \%parameterdescs, | ||
| 1787 | 'parametertypes' => \%parametertypes, | ||
| 1788 | 'sectionlist' => \@sectionlist, | ||
| 1789 | 'sections' => \%sections, | ||
| 1790 | 'purpose' => $declaration_purpose | ||
| 1791 | }); | ||
| 1792 | } | ||
| 1775 | } | 1793 | } |
| 1776 | 1794 | ||
| 1777 | sub reset_state { | 1795 | sub reset_state { |