|
|
565b65 |
From e1b4cbc93529b07b3217928e8f9b1f43b80f9b06 Mon Sep 17 00:00:00 2001
|
|
|
565b65 |
From: Jiri Slaby <jslaby@suse.cz>
|
|
|
565b65 |
Date: Fri, 5 Dec 2014 19:15:53 +0100
|
|
|
565b65 |
Subject: [PATCH 8/9] fscanner: swallow function as parameters
|
|
|
565b65 |
MIME-Version: 1.0
|
|
|
565b65 |
Content-Type: text/plain; charset=UTF-8
|
|
|
565b65 |
Content-Transfer-Encoding: 8bit
|
|
|
565b65 |
|
|
|
565b65 |
Some functions take as a parameter a pointer to another function. This
|
|
|
565b65 |
causes troubles in the cscope scanner and such function definition is
|
|
|
565b65 |
dropped on the floor.
|
|
|
565b65 |
|
|
|
565b65 |
Instead of choking and skipping the definition/declaration, teach the
|
|
|
565b65 |
scanner about this case. So now cscope will not skip those and put
|
|
|
565b65 |
them properly in the index.
|
|
|
565b65 |
|
|
|
565b65 |
I carry this patch for a couple of months and using cscope daily on
|
|
|
565b65 |
the Linux kernel and see no problems.
|
|
|
565b65 |
|
|
|
565b65 |
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
|
|
|
565b65 |
Cc: Hans-Bernhard Bröker <broeker@users.sourceforge.net>
|
|
|
565b65 |
Cc: Neil Horman <nhorman@users.sourceforge.net>
|
|
|
565b65 |
Signed-off-by: Vladis Dronov <vdronov@redhat.com>
|
|
|
565b65 |
---
|
|
|
565b65 |
src/fscanner.l | 2 +-
|
|
|
565b65 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
565b65 |
|
|
|
565b65 |
diff --git a/src/fscanner.l b/src/fscanner.l
|
|
|
565b65 |
index 8a93192..43880bf 100644
|
|
|
565b65 |
--- a/src/fscanner.l
|
|
|
565b65 |
+++ b/src/fscanner.l
|
|
|
565b65 |
@@ -505,7 +505,7 @@ if{wsnl}*\( { /* ignore 'if' */
|
|
|
565b65 |
}
|
|
|
565b65 |
|
|
|
565b65 |
<WAS_IDENTIFIER>{
|
|
|
565b65 |
-{ws}*\(({wsnl}|{identifier}|{number}|[*&[\]=,.:])*\)([()]|{wsnl})*[:a-zA-Z_#{] {
|
|
|
565b65 |
+{ws}*\(({wsnl}|{identifier}|\({ws}*\*{ws}*{identifier}{ws}*\){ws}*\([^()]*\)|{number}|[*&[\]=,.:])*\)([()]|{wsnl})*[:a-zA-Z_#{] {
|
|
|
565b65 |
/* a function definition */
|
|
|
565b65 |
/* note: "#define a (b) {" and "#if defined(a)\n#"
|
|
|
565b65 |
* are not fcn definitions! */
|
|
|
565b65 |
--
|
|
|
565b65 |
2.26.2
|
|
|
565b65 |
|