[gtk-doc] scan: allow static inline functions in headers. Fixes #481811
- From: Stefan Kost <stefkost src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk-doc] scan: allow static inline functions in headers. Fixes #481811
- Date: Tue, 13 Jul 2010 13:45:45 +0000 (UTC)
commit 9569daae7fbf4f542050034191cc0798dc53dda5
Author: Stefan Kost <ensonic users sf net>
Date: Tue Jul 13 16:44:18 2010 +0300
scan: allow static inline functions in headers. Fixes #481811
Also fix the test case - G_INLINE_FUNC != static inline
gtkdoc-scan.in | 17 ++++++++++++++---
tests/bugs/src/tester.c | 2 ++
tests/bugs/src/tester.h | 2 +-
3 files changed, 17 insertions(+), 4 deletions(-)
---
diff --git a/gtkdoc-scan.in b/gtkdoc-scan.in
index 87df993..58d48ab 100755
--- a/gtkdoc-scan.in
+++ b/gtkdoc-scan.in
@@ -560,6 +560,17 @@ sub ScanHeader {
#print "DEBUG: Function (2): $symbol, Returns: $ret_type\n";
$in_declaration = "function";
}
+ } else {
+ #print "DEBUG: skip block after inline function\n";
+ # now we we need to skip a whole { } block
+ $skip_block = 1;
+ # $1 $2
+ if ($previous_line =~ m/^\s*(?:\b(?:extern|static|inline|${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*(?:\*+|\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";
+ $in_declaration = "function";
+ }
}
}
else {
@@ -571,7 +582,7 @@ sub ScanHeader {
if ($previous_line =~ 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*(?:\*+|\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";
+ #print "DEBUG: Function (4): $symbol, Returns: $ret_type\n";
$in_declaration = "function";
}
}
@@ -584,7 +595,7 @@ sub ScanHeader {
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";
+ #print "DEBUG: Function (5): $symbol, Returns: $ret_type\n";
$in_declaration = "function";
} elsif ($previous_line =~ m/^\s*\w+\s*$/
@@ -596,7 +607,7 @@ sub ScanHeader {
$symbol = $previous_line;
$symbol =~ s/^\s+//;
$symbol =~ s/\s*\n//;
- #print "DEBUG: Function (5): $symbol, Returns: $ret_type\n";
+ #print "DEBUG: Function (6): $symbol, Returns: $ret_type\n";
}
#} elsif (m/^extern\s+/) {
diff --git a/tests/bugs/src/tester.c b/tests/bugs/src/tester.c
index a2fac06..470e3d3 100644
--- a/tests/bugs/src/tester.c
+++ b/tests/bugs/src/tester.c
@@ -29,6 +29,8 @@
* http://bugzilla.gnome.org/show_bug.cgi?id=141869
*/
void bug_141869_a (unsigned pid) {
+ /* just silence a compiler warning */
+ bug_481811((double)pid);
}
/**
diff --git a/tests/bugs/src/tester.h b/tests/bugs/src/tester.h
index 6eb16da..aadc5b0 100644
--- a/tests/bugs/src/tester.h
+++ b/tests/bugs/src/tester.h
@@ -27,7 +27,7 @@ typedef enum {
*
* http://bugzilla.gnome.org/show_bug.cgi?id=481811
**/
-G_INLINE_FUNC double
+static inline double
bug_481811(double x)
{
return g_random_double_range(x,x*x);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]