From 9ca5df90615aa3c6b60e1bc8f03db6cae98e816c Mon Sep 17 00:00:00 2001 From: Bo Yang Date: Thu, 6 May 2010 21:52:27 -0700 Subject: Add a macro DIFF_QUEUE_CLEAR. Refactor the diff_queue_struct code, this macro help to reset the structure. Signed-off-by: Bo Yang Signed-off-by: Junio C Hamano --- diffcore.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'diffcore.h') diff --git a/diffcore.h b/diffcore.h index fcd00bf27a..5d05deaf68 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 *, -- cgit v1.2.3