Thread (19 messages) flat view 19 messages, 6 authors, 2016-06-15
STALE3751d

[PATCH 05/10] diffcore-pickaxe.c: set up funcname pattern

From: David A. Dalrymple (and Bhushan G. Lodha) <hidden>
Date: 2016-06-15 23:00:33
Subsystem: the rest · Maintainer: Linus Torvalds

From: "Bhushan G. Lodha & David A. Dalrymple" <redacted>

We use userdiff_funcname to make the filetype-dependent function name
pattern available to pickaxe functions.

Signed-off-by: David Dalrymple (on zayin) <redacted>
---
 diffcore-pickaxe.c | 9 +++++++++
 1 file changed, 9 insertions(+)
diff --git a/diffcore-pickaxe.c b/diffcore-pickaxe.c
index 7e65095..103fe6c 100644
--- a/diffcore-pickaxe.c
+++ b/diffcore-pickaxe.c
@@ -7,10 +7,12 @@
 #include "diffcore.h"
 #include "xdiff-interface.h"
 #include "kwset.h"
+#include "userdiff.h"
 
 struct fn_options {
 	regex_t *regex;
 	kwset_t kws;
+	const struct userdiff_funcname *funcname_pattern;
 };
 
 typedef int (*pickaxe_fn)(mmfile_t *one, mmfile_t *two,
@@ -224,6 +226,13 @@ static int pickaxe_match(struct diff_filepair *p, struct diff_options *o,
 	if (textconv_one == textconv_two && diff_unmodified_pair(p))
 		return 0;
 
+	const struct userdiff_funcname *funcname_pattern;
+	funcname_pattern = diff_funcname_pattern(p->one);
+	if (!funcname_pattern)
+		funcname_pattern = diff_funcname_pattern(p->two);
+
+	fno->funcname_pattern = funcname_pattern;
+
 	mf1.size = fill_textconv(textconv_one, p->one, &mf1.ptr);
 	mf2.size = fill_textconv(textconv_two, p->two, &mf2.ptr);
 
-- 
1.7.12.4 (Apple Git-37)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help