Skip to content

Commit 5d0d7e8

Browse files
jeffhostetlerdscho
authored andcommitted
cache-tree.c: avoid reusing the DEBUG constant
In MSVC, the DEBUG constant is set automatically whenever compiling with debug information. This is clearly not what was intended in cache-tree.c, so let's use a less ambiguous constant there. Signed-off-by: Jeff Hostetler <[email protected]>
1 parent e4db46c commit 5d0d7e8

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

cache-tree.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
#include "tree-walk.h"
55
#include "cache-tree.h"
66

7-
#ifndef DEBUG
8-
#define DEBUG 0
7+
#ifndef DEBUG_CACHE_TREE
8+
#define DEBUG_CACHE_TREE 0
99
#endif
1010

1111
struct cache_tree *cache_tree(void)
@@ -109,7 +109,7 @@ static int do_invalidate_path(struct cache_tree *it, const char *path)
109109
int namelen;
110110
struct cache_tree_sub *down;
111111

112-
#if DEBUG
112+
#if DEBUG_CACHE_TREE
113113
fprintf(stderr, "cache-tree invalidate <%s>\n", path);
114114
#endif
115115

@@ -392,7 +392,7 @@ static int update_one(struct cache_tree *it,
392392
strbuf_addf(&buffer, "%o %.*s%c", mode, entlen, path + baselen, '\0');
393393
strbuf_add(&buffer, sha1, 20);
394394

395-
#if DEBUG
395+
#if DEBUG_CACHE_TREE
396396
fprintf(stderr, "cache-tree update-one %o %.*s\n",
397397
mode, entlen, path + baselen);
398398
#endif
@@ -415,7 +415,7 @@ static int update_one(struct cache_tree *it,
415415

416416
strbuf_release(&buffer);
417417
it->entry_count = to_invalidate ? -1 : i - *skip_count;
418-
#if DEBUG
418+
#if DEBUG_CACHE_TREE
419419
fprintf(stderr, "cache-tree update-one (%d ent, %d subtree) %s\n",
420420
it->entry_count, it->subtree_nr,
421421
oid_to_hex(&it->oid));
@@ -454,7 +454,7 @@ static void write_one(struct strbuf *buffer, struct cache_tree *it,
454454
strbuf_add(buffer, path, pathlen);
455455
strbuf_addf(buffer, "%c%d %d\n", 0, it->entry_count, it->subtree_nr);
456456

457-
#if DEBUG
457+
#if DEBUG_CACHE_TREE
458458
if (0 <= it->entry_count)
459459
fprintf(stderr, "cache-tree <%.*s> (%d ent, %d subtree) %s\n",
460460
pathlen, path, it->entry_count, it->subtree_nr,
@@ -527,7 +527,7 @@ static struct cache_tree *read_one(const char **buffer, unsigned long *size_p)
527527
size -= 20;
528528
}
529529

530-
#if DEBUG
530+
#if DEBUG_CACHE_TREE
531531
if (0 <= it->entry_count)
532532
fprintf(stderr, "cache-tree <%s> (%d ent, %d subtree) %s\n",
533533
*buffer, it->entry_count, subtree_nr,

0 commit comments

Comments
 (0)