DORMANTno replies

[PATCH] Removes DEBUG code from rev-list.c and -DDEBUG from Makefile

From: Jon Seymour <hidden>
Date: 2016-06-15 22:42:01
Subsystem: kernel build + files below scripts/ (unless maintained elsewhere), the rest · Maintainers: Nathan Chancellor, Nicolas Schier, Linus Torvalds

This patch removes DEBUG code and -DDEBUG flag from Makefile.

Signed-off-by: Jon Seymour <redacted>
---

 Makefile   |    2 +-
 rev-list.c |   30 ------------------------------
 2 files changed, 1 insertions(+), 31 deletions(-)

be52c026e003b9774acc3d0f53ae5ed67d878b03
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -10,7 +10,7 @@
 # break unless your underlying filesystem supports those sub-second times
 # (my ext3 doesn't).
 COPTS=-O2
-CFLAGS=-DDEBUG -g $(COPTS) -Wall
+CFLAGS=-g $(COPTS) -Wall
 
 prefix=$(HOME)
 bin=$(prefix)/bin
diff --git a/rev-list.c b/rev-list.c
--- a/rev-list.c
+++ b/rev-list.c
@@ -44,10 +44,6 @@ static int merge_order = 0;
 static int show_breaks = 0;
 static int stop_traversal = 0;
 static int bisect_by_cut_option = 0;
-#ifdef DEBUG
-static int debug = 0;
-static unsigned int complexity = 0;
-#endif
 
 static void show_commit(struct commit *commit)
 {
@@ -283,9 +279,6 @@ static int count_distance(struct commit_
 
 static void clear_distance(struct commit_list *list)
 {
-#ifdef DEBUG
-	complexity++;
-#endif
 	while (list) {
 		struct commit *commit = list->item;
 		commit->object.flags &= ~COUNTED;
@@ -422,14 +415,6 @@ static inline struct bisect_by_cut_node 
 	return (struct bisect_by_cut_node *)commit->object.util;
 }
 
-#ifdef DEBUG
-static void print_bisect_by_cut_node(struct commit * commit, const char * prefix)
-{
-	struct bisect_by_cut_node * node = get_bisect_by_cut_node(commit);
-	fprintf(stderr, "%s%s %u %d\n", prefix, sha1_to_hex(commit->object.sha1), node->flags, node->count);
-}
-#endif
-
 /*
  * Find the best bisection point by cutting a topological order in two then
  * identifying a set of boundary nodes with a reachability known to be 
@@ -558,11 +543,6 @@ struct commit * bisect_by_cut(struct com
 			best = work_item;
 			fittest = fitness;
 		}
-#ifdef DEBUG
-		if (debug) {
-			print_bisect_by_cut_node(work_item, "work ");
-		}
-#endif
 		if (goal_test < goal) {
 			while (children) {
 				struct bisect_by_cut_node * cn 
@@ -666,12 +646,6 @@ int main(int argc, char **argv)
 			show_breaks = 1;
 			continue;
 		}
-#ifdef DEBUG
-		if (!strcmp(arg, "--debug")) {
-			debug = 1;
-			continue;
-		}
-#endif
 		flags = 0;
 		if (*arg == '^') {
 			flags = UNINTERESTING;
@@ -700,9 +674,5 @@ int main(int argc, char **argv)
 			  die("merge order sort failed\n");
 		}
 	}
-#ifdef DEBUG
-	if (debug) 
-		fprintf(stderr, "complexity=%d\n", complexity);
-#endif
 	return 0;
 }
------------
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help