cache-tree/blame: avoid reusing the DEBUG constant

In MS Visual C, the `DEBUG` constant is set automatically whenever compiling with debug information. This is clearly not what was intended in `cache-tree.c` nor in `builtin/blame.c`, so let's use a less ambiguous name there. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff Hostetler committed Jun 19, 2019 at 14:05 UTC e9b9cc56bbc0a223798c731798da1bee9f599cab
2 files changed +10 -10
builtin/blame.c
+3 -3
@@ -59,8 +59,8 @@ static size_t blame_date_width;
59
60 static struct string_list mailmap = STRING_LIST_INIT_NODUP;
61
62 -#ifndef DEBUG
63 -#define DEBUG 0
62 +#ifndef DEBUG_BLAME
63 +#define DEBUG_BLAME 0
64 #endif
65
66 static unsigned blame_move_score;
@@ -1062,7 +1062,7 @@ parse_done:
1062 if (blame_copy_score)
1063 sb.copy_score = blame_copy_score;
1064
1065 - sb.debug = DEBUG;
1065 + sb.debug = DEBUG_BLAME;
1066 sb.on_sanity_fail = &sanity_check_on_fail;
1067
1068 sb.show_root = show_root;
cache-tree.c
+7 -7
@@ -6,8 +6,8 @@
6 #include "object-store.h"
7 #include "replace-object.h"
8
9 -#ifndef DEBUG
10 -#define DEBUG 0
9 +#ifndef DEBUG_CACHE_TREE
10 +#define DEBUG_CACHE_TREE 0
11 #endif
12
13 struct cache_tree *cache_tree(void)
@@ -111,7 +111,7 @@ static int do_invalidate_path(struct cache_tree *it, const char *path)
111 int namelen;
112 struct cache_tree_sub *down;
113
114 -#if DEBUG
114 +#if DEBUG_CACHE_TREE
115 fprintf(stderr, "cache-tree invalidate <%s>\n", path);
116 #endif
117
@@ -398,7 +398,7 @@ static int update_one(struct cache_tree *it,
398 strbuf_addf(&buffer, "%o %.*s%c", mode, entlen, path + baselen, '\0');
399 strbuf_add(&buffer, oid->hash, the_hash_algo->rawsz);
400
401 -#if DEBUG
401 +#if DEBUG_CACHE_TREE
402 fprintf(stderr, "cache-tree update-one %o %.*s\n",
403 mode, entlen, path + baselen);
404 #endif
@@ -421,7 +421,7 @@ static int update_one(struct cache_tree *it,
421
422 strbuf_release(&buffer);
423 it->entry_count = to_invalidate ? -1 : i - *skip_count;
424 -#if DEBUG
424 +#if DEBUG_CACHE_TREE
425 fprintf(stderr, "cache-tree update-one (%d ent, %d subtree) %s\n",
426 it->entry_count, it->subtree_nr,
427 oid_to_hex(&it->oid));
@@ -462,7 +462,7 @@ static void write_one(struct strbuf *buffer, struct cache_tree *it,
462 strbuf_add(buffer, path, pathlen);
463 strbuf_addf(buffer, "%c%d %d\n", 0, it->entry_count, it->subtree_nr);
464
465 -#if DEBUG
465 +#if DEBUG_CACHE_TREE
466 if (0 <= it->entry_count)
467 fprintf(stderr, "cache-tree <%.*s> (%d ent, %d subtree) %s\n",
468 pathlen, path, it->entry_count, it->subtree_nr,
@@ -536,7 +536,7 @@ static struct cache_tree *read_one(const char **buffer, unsigned long *size_p)
536 size -= rawsz;
537 }
538
539 -#if DEBUG
539 +#if DEBUG_CACHE_TREE
540 if (0 <= it->entry_count)
541 fprintf(stderr, "cache-tree <%s> (%d ent, %d subtree) %s\n",
542 *buffer, it->entry_count, subtree_nr,