[gtk-doc] gtkdoc-mkdb/mktmpl/scan: Handle 'signed' keywords too. Fixes #610257.
- From: Stefan Kost <stefkost src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk-doc] gtkdoc-mkdb/mktmpl/scan: Handle 'signed' keywords too. Fixes #610257.
- Date: Wed, 17 Feb 2010 13:21:59 +0000 (UTC)
commit 9fb8c523e3ce0121117db857f04815ab307437e9
Author: Simon Josefsson <simon josefsson org>
Date: Wed Feb 17 13:30:47 2010 +0100
gtkdoc-mkdb/mktmpl/scan: Handle 'signed' keywords too. Fixes #610257.
Add signed keyword to regexps. Add a test.
Signed-off-by: Simon Josefsson <simon josefsson org>
gtkdoc-mkdb.in | 6 +++---
gtkdoc-mktmpl.in | 2 +-
gtkdoc-scan.in | 14 +++++++-------
tests/bugs/docs/tester-sections.txt | 1 +
tests/bugs/src/tester.c | 12 ++++++++++++
5 files changed, 24 insertions(+), 11 deletions(-)
---
diff --git a/gtkdoc-mkdb.in b/gtkdoc-mkdb.in
index fdc5e65..58647a8 100755
--- a/gtkdoc-mkdb.in
+++ b/gtkdoc-mkdb.in
@@ -1871,7 +1871,7 @@ sub OutputVariable {
my $condition = &MakeConditionDescription ($symbol);
my $synop;
- if ($declaration =~ m/^\s*extern\s+((const\s+|unsigned\s+)*\w+)(\s+\*+|\*+|\s)(\s*)([A-Za-z]\w*)\s*;/) {
+ if ($declaration =~ m/^\s*extern\s+((const\s+|signed\s+|unsigned\s+)*\w+)(\s+\*+|\*+|\s)(\s*)([A-Za-z]\w*)\s*;/) {
my $mod = defined ($1) ? $1 : "";
my $ptr = defined ($3) ? $3 : "";
my $space = defined ($4) ? $4 : "";
@@ -1913,8 +1913,8 @@ sub OutputFunction {
my $id = &CreateValidSGMLID ($symbol);
my $condition = &MakeConditionDescription ($symbol);
- # Take out the return type $1 $3 $4
- $declaration =~ s/<RETURNS>\s*((const\s+|G_CONST_RETURN\s+|unsigned\s+|long\s+|short\s+|struct\s+|enum\s+)*)(\w+)(\s*\**\s*(const|G_CONST_RETURN)?\s*\**\s*(restrict)?\s*)<\/RETURNS>\n//;
+ # Take out the return type $1 $3 $4
+ $declaration =~ s/<RETURNS>\s*((const\s+|G_CONST_RETURN\s+|signed\s+|unsigned\s+|long\s+|short\s+|struct\s+|enum\s+)*)(\w+)(\s*\**\s*(const|G_CONST_RETURN)?\s*\**\s*(restrict)?\s*)<\/RETURNS>\n//;
my $type_modifier = defined($1) ? $1 : "";
my $type = $3;
my $pointer = $4;
diff --git a/gtkdoc-mktmpl.in b/gtkdoc-mktmpl.in
index 5c0da62..705ec6f 100755
--- a/gtkdoc-mktmpl.in
+++ b/gtkdoc-mktmpl.in
@@ -373,7 +373,7 @@ EOF
# For functions and function typedefs we also output the return value.
if ($type eq "FUNCTION" || $type eq "USER_FUNCTION") {
# Take out the return type
- $declaration =~ s/<RETURNS>\s*((const\s+|G_CONST_RETURN\s+|unsigned\s+|struct\s+|enum\s+)*)(\w+)\s*(\**\s*(const|G_CONST_RETURN)?\s*\**\s*(restrict)?\s*)<\/RETURNS>\n//;
+ $declaration =~ s/<RETURNS>\s*((const\s+|G_CONST_RETURN\s+|signed\s+|unsigned\s+|struct\s+|enum\s+)*)(\w+)\s*(\**\s*(const|G_CONST_RETURN)?\s*\**\s*(restrict)?\s*)<\/RETURNS>\n//;
my $ret_type_modifier = defined($1) ? $1 : "";
my $ret_type = $3;
my $ret_type_pointer = $4;
diff --git a/gtkdoc-scan.in b/gtkdoc-scan.in
index c986f36..f243ce5 100755
--- a/gtkdoc-scan.in
+++ b/gtkdoc-scan.in
@@ -512,7 +512,7 @@ sub ScanHeader {
# VARIABLES (extern'ed variables)
- } elsif (m/^\s*(extern|[A-Za-z_]+VAR)\s+((const\s+|unsigned\s+)*\w+)(\s+\*+|\*+|\s)\s*([A-Za-z]\w*)\s*;/) {
+ } elsif (m/^\s*(extern|[A-Za-z_]+VAR)\s+((const\s+|signed\s+|unsigned\s+)*\w+)(\s+\*+|\*+|\s)\s*([A-Za-z]\w*)\s*;/) {
$symbol = $5;
s/^\s*([A-Za-z_]+VAR)\b/extern/;
#print "DEBUG: Possible extern: $_";
@@ -525,7 +525,7 @@ sub ScanHeader {
# We assume that functions which start with '_' are private, so
# we skip them.
# $1 $2
- } elsif (m/^\s*(?:\b(?:extern|G_INLINE_FUNC|${IGNORE_DECORATORS})\b\s*)*((?:const\s+|G_CONST_RETURN\s+|unsigned\s+|long\s+|short\s+|struct\s+|union\s+|enum\s+)*_\w+(?:\**\s+\**(?:const|G_CONST_RETURN))?(?:\s+|\s*\*+))\s*\(\s*\*+\s*([A-Za-z]\w*)\s*\)\s*\(/o) {
+ } elsif (m/^\s*(?:\b(?:extern|G_INLINE_FUNC|${IGNORE_DECORATORS})\b\s*)*((?:const\s+|G_CONST_RETURN\s+|signed\s+|unsigned\s+|long\s+|short\s+|struct\s+|union\s+|enum\s+)*_\w+(?:\**\s+\**(?:const|G_CONST_RETURN))?(?:\s+|\s*\*+))\s*\(\s*\*+\s*([A-Za-z]\w*)\s*\)\s*\(/o) {
$ret_type = $1;
$symbol = $2;
$decl = $';
@@ -533,7 +533,7 @@ sub ScanHeader {
$in_declaration = "function";
# $1 $2
- } elsif (m/^\s*(?:\b(?:extern|G_INLINE_FUNC|${IGNORE_DECORATORS})\b\s*)*((?:const\s+|G_CONST_RETURN\s+|unsigned\s+|long\s+|short\s+|struct\s+|union\s+|enum\s+)*\w+(?:\**\s+\**(?:const|G_CONST_RETURN))?(?:\s+|\s*\*+))\s*([A-Za-z]\w*)\s*\(/o) {
+ } elsif (m/^\s*(?:\b(?:extern|G_INLINE_FUNC|${IGNORE_DECORATORS})\b\s*)*((?:const\s+|G_CONST_RETURN\s+|signed\s+|unsigned\s+|long\s+|short\s+|struct\s+|union\s+|enum\s+)*\w+(?:\**\s+\**(?:const|G_CONST_RETURN))?(?:\s+|\s*\*+))\s*([A-Za-z]\w*)\s*\(/o) {
$ret_type = $1;
$symbol = $2;
$decl = $';
@@ -551,7 +551,7 @@ sub ScanHeader {
if ($previous_line !~ m/^\s*G_INLINE_FUNC/) {
if ($previous_line !~ m/^\s*static\s+/) {
# $1 $2
- if ($previous_line =~ m/^\s*(?:\b(?:extern|${IGNORE_DECORATORS})\b\s*)*((?:const\s+|G_CONST_RETURN\s+|unsigned\s+|struct\s+|union\s+|enum\s+)?\w+)((?:\s*(?:\*+|\bconst\b|\bG_CONST_RETURN\b))*)\s*$/o) {
+ if ($previous_line =~ m/^\s*(?:\b(?:extern|${IGNORE_DECORATORS})\b\s*)*((?:const\s+|G_CONST_RETURN\s+|signed\s+|unsigned\s+|struct\s+|union\s+|enum\s+)?\w+)((?:\s*(?:\*+|\bconst\b|\bG_CONST_RETURN\b))*)\s*$/o) {
$ret_type = $1;
if (defined ($2)) { $ret_type .= " $2"; }
#print "DEBUG: Function (2): $symbol, Returns: $ret_type\n";
@@ -565,7 +565,7 @@ sub ScanHeader {
# now we we need to skip a whole { } block
$skip_block = 1;
# $1 $2
- if ($previous_line =~ m/^\s*(?:\b(?:extern|G_INLINE_FUNC|${IGNORE_DECORATORS})\b\s*)*((?:const\s+|G_CONST_RETURN\s+|unsigned\s+|struct\s+|union\s+|enum\s+)?\w+)((?:\s*(?:\*+|\bconst\b|\bG_CONST_RETURN\b))*)\s*$/o) {
+ if ($previous_line =~ m/^\s*(?:\b(?:extern|G_INLINE_FUNC|${IGNORE_DECORATORS})\b\s*)*((?:const\s+|G_CONST_RETURN\s+|signed\s+|unsigned\s+|struct\s+|union\s+|enum\s+)?\w+)((?:\s*(?:\*+|\bconst\b|\bG_CONST_RETURN\b))*)\s*$/o) {
$ret_type = $1;
if (defined ($2)) { $ret_type .= " $2"; }
#print "DEBUG: Function (3): $symbol, Returns: $ret_type\n";
@@ -580,14 +580,14 @@ sub ScanHeader {
# on the previous line(s), and the start of the parameters on this.
} elsif (m/^\s*\(/) {
$decl = $';
- if ($previous_line =~ m/^\s*(?:\b(?:extern|G_INLINE_FUNC|${IGNORE_DECORATORS})\b\s*)*((?:const\s+|G_CONST_RETURN\s+|unsigned\s+|enum\s+)*\w+)(\s+\*+|\*+|\s)\s*([A-Za-z]\w*)\s*$/o) {
+ if ($previous_line =~ m/^\s*(?:\b(?:extern|G_INLINE_FUNC|${IGNORE_DECORATORS})\b\s*)*((?:const\s+|G_CONST_RETURN\s+|signed\s+|unsigned\s+|enum\s+)*\w+)(\s+\*+|\*+|\s)\s*([A-Za-z]\w*)\s*$/o) {
$ret_type = "$1 $2";
$symbol = $3;
#print "DEBUG: Function (4): $symbol, Returns: $ret_type\n";
$in_declaration = "function";
} elsif ($previous_line =~ m/^\s*\w+\s*$/
- && $pre_previous_line =~ m/^\s*(?:\b(?:extern|G_INLINE_FUNC|${IGNORE_DECORATORS})\b\s*)*((?:const\s+|G_CONST_RETURN\s+|unsigned\s+|struct\s+|union\s+|enum\s+)*\w+(?:\**\s+\**(?:const|G_CONST_RETURN))?(?:\s+|\s*\*+))\s*$/o) {
+ && $pre_previous_line =~ m/^\s*(?:\b(?:extern|G_INLINE_FUNC|${IGNORE_DECORATORS})\b\s*)*((?:const\s+|G_CONST_RETURN\s+|signed\s+|unsigned\s+|struct\s+|union\s+|enum\s+)*\w+(?:\**\s+\**(?:const|G_CONST_RETURN))?(?:\s+|\s*\*+))\s*$/o) {
$ret_type = $1;
$ret_type =~ s/\s*\n//;
$in_declaration = "function";
diff --git a/tests/bugs/docs/tester-sections.txt b/tests/bugs/docs/tester-sections.txt
index 784a4a2..5f48682 100644
--- a/tests/bugs/docs/tester-sections.txt
+++ b/tests/bugs/docs/tester-sections.txt
@@ -37,6 +37,7 @@ bug_580300d_get_type
bug_602518a
bug_602518b
bug_602518c
+bug_610257
<SUBSECTION Standard>
<SUBSECTION Private>
GTKDOC_GNUC_CONST
diff --git a/tests/bugs/src/tester.c b/tests/bugs/src/tester.c
index 5d7ea50..929e1c3 100644
--- a/tests/bugs/src/tester.c
+++ b/tests/bugs/src/tester.c
@@ -206,3 +206,15 @@ unsigned long int bug_602518b(void) {
unsigned int bug_602518c(void) {
return (unsigned int)0;
}
+
+/**
+ * bug_610257:
+ *
+ * http://bugzilla.gnome.org/show_bug.cgi?id=610257
+ */
+signed long
+bug_610257 (const unsigned char *der, int der_len, int *len)
+{
+ return 1L;
+}
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]