[gtk-doc] scan,mkdb: handle short,long for (external) variables
- From: Stefan Kost <stefkost src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk-doc] scan,mkdb: handle short,long for (external) variables
- Date: Mon, 22 Aug 2011 11:55:47 +0000 (UTC)
commit 347b08b3e52aaa971e7ead20b15b164920f3cd0b
Author: Stefan Kost <ensonic users sf net>
Date: Mon Aug 22 13:54:40 2011 +0200
scan,mkdb: handle short,long for (external) variables
Improve the parser to handle more type variants. Add a test. Fixes #656946
gtkdoc-mkdb.in | 4 ++--
gtkdoc-scan.in | 4 ++--
tests/bugs/docs/tester-sections.txt | 1 +
tests/bugs/src/tester.h | 6 ++++++
4 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/gtkdoc-mkdb.in b/gtkdoc-mkdb.in
index 5245a48..3bf33df 100755
--- a/gtkdoc-mkdb.in
+++ b/gtkdoc-mkdb.in
@@ -1918,13 +1918,13 @@ sub OutputVariable {
@TRACE@("ouputing variable: '$symbol' '$declaration'");
my $synop;
- if ($declaration =~ m/^\s*extern\s+((const\s+|signed\s+|unsigned\s+)*\w+)(\s+\*+|\*+|\s)(\s*)(const\s+)*([A-Za-z]\w*)\s*;/) {
+ if ($declaration =~ m/^\s*extern\s+((const\s+|signed\s+|unsigned\s+|long\s+|short\s+)*\w+)(\s+\*+|\*+|\s)(\s*)(const\s+)*([A-Za-z]\w*)\s*;/) {
my $mod1 = defined ($1) ? $1 : "";
my $ptr = defined ($3) ? $3 : "";
my $space = defined ($4) ? $4 : "";
my $mod2 = defined ($5) ? $5 : "";
$synop = &MakeReturnField("extern $mod1$ptr$space$mod2") . "<link linkend=\"$id\">$symbol</link>;\n";
- } elsif ($declaration =~ m/^\s*((const\s+|signed\s+|unsigned\s+)*\w+)(\s+\*+|\*+|\s)(\s*)(const\s+)*([A-Za-z]\w*)\s*=/) {
+ } elsif ($declaration =~ m/^\s*((const\s+|signed\s+|unsigned\s+|long\s+|short\s+)*\w+)(\s+\*+|\*+|\s)(\s*)(const\s+)*([A-Za-z]\w*)\s*=/) {
my $mod1 = defined ($1) ? $1 : "";
my $ptr = defined ($3) ? $3 : "";
my $space = defined ($4) ? $4 : "";
diff --git a/gtkdoc-scan.in b/gtkdoc-scan.in
index 7a7e4d9..cce2d5d 100755
--- a/gtkdoc-scan.in
+++ b/gtkdoc-scan.in
@@ -530,7 +530,7 @@ sub ScanHeader {
# VARIABLES (extern'ed variables)
- } elsif (m/^\s*(extern|[A-Za-z_]+VAR)\s+((const\s+|signed\s+|unsigned\s+)*\w+)(\s+\*+|\*+|\s)\s*(const\s+)*([A-Za-z]\w*)\s*;/) {
+ } elsif (m/^\s*(extern|[A-Za-z_]+VAR)\s+((const\s+|signed\s+|unsigned\s+|long\s+|short\s+)*\w+)(\s+\*+|\*+|\s)\s*(const\s+)*([A-Za-z]\w*)\s*;/) {
$symbol = $6;
s/^\s*([A-Za-z_]+VAR)\b/extern/;
$decl = $_;
@@ -542,7 +542,7 @@ sub ScanHeader {
# VARIABLES
- } elsif (m/^\s*((const\s+|signed\s+|unsigned\s+)*\w+)(\s+\*+|\*+|\s)\s*(const\s+)*([A-Za-z]\w*)\s*\=/) {
+ } elsif (m/^\s*((const\s+|signed\s+|unsigned\s+|long\s+|short\s+)*\w+)(\s+\*+|\*+|\s)\s*(const\s+)*([A-Za-z]\w*)\s*\=/) {
$symbol = $5;
$decl = $_;
@TRACE@("Possible global var $5: $decl");
diff --git a/tests/bugs/docs/tester-sections.txt b/tests/bugs/docs/tester-sections.txt
index 2b8108e..5decc1b 100644
--- a/tests/bugs/docs/tester-sections.txt
+++ b/tests/bugs/docs/tester-sections.txt
@@ -56,6 +56,7 @@ bug_638330
BUG_656773a
BUG_656773b
BUG_656773c
+BUG_656946
gst_play_marshal_BUFFER__BOXED
<SUBSECTION Standard>
diff --git a/tests/bugs/src/tester.h b/tests/bugs/src/tester.h
index 74928c4..ef9d1a3 100644
--- a/tests/bugs/src/tester.h
+++ b/tests/bugs/src/tester.h
@@ -453,5 +453,11 @@ extern const char* BUG_656773b;
*/
const char* const BUG_656773c = "bug";
+/**
+ * BUG_656946:
+ *
+ * https://bugzilla.gnome.org/show_bug.cgi?id=656946
+ */
+extern short int BUG_656946;
#endif // GTKDOC_TESTER_H
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]