summaryrefslogtreecommitdiff
path: root/diffcore.h
diff options
context:
space:
mode:
authorBo Yang <struggleyb.nku@gmail.com>2010-05-07 04:52:27 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-05-07 16:34:27 (GMT)
commit9ca5df90615aa3c6b60e1bc8f03db6cae98e816c (patch)
tree807f76999f2c9a7aca03d7b308ae8e36bdfd5658 /diffcore.h
parent3bf7886705b4ea7189f046fa5258fdf6edcdbe23 (diff)
downloadgit-9ca5df90615aa3c6b60e1bc8f03db6cae98e816c.zip
git-9ca5df90615aa3c6b60e1bc8f03db6cae98e816c.tar.gz
git-9ca5df90615aa3c6b60e1bc8f03db6cae98e816c.tar.bz2
Add a macro DIFF_QUEUE_CLEAR.
Refactor the diff_queue_struct code, this macro help to reset the structure. Signed-off-by: Bo Yang <struggleyb.nku@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diffcore.h')
-rw-r--r--diffcore.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/diffcore.h b/diffcore.h
index fcd00bf..5d05dea 100644
--- a/diffcore.h
+++ b/diffcore.h
@@ -92,6 +92,11 @@ struct diff_queue_struct {
int alloc;
int nr;
};
+#define DIFF_QUEUE_CLEAR(q) \
+ do { \
+ (q)->queue = NULL; \
+ (q)->nr = (q)->alloc = 0; \
+ } while(0);
extern struct diff_queue_struct diff_queued_diff;
extern struct diff_filepair *diff_queue(struct diff_queue_struct *,