Skip to content

Commit 73536e6

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 f6dc09d commit 73536e6

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
@@ -7,8 +7,8 @@
77
#include "replace-object.h"
88
#include "promisor-remote.h"
99

10-
#ifndef DEBUG
11-
#define DEBUG 0
10+
#ifndef DEBUG_CACHE_TREE
11+
#define DEBUG_CACHE_TREE 0
1212
#endif
1313

1414
struct cache_tree *cache_tree(void)
@@ -112,7 +112,7 @@ static int do_invalidate_path(struct cache_tree *it, const char *path)
112112
int namelen;
113113
struct cache_tree_sub *down;
114114

115-
#if DEBUG
115+
#if DEBUG_CACHE_TREE
116116
fprintf(stderr, "cache-tree invalidate <%s>\n", path);
117117
#endif
118118

@@ -399,7 +399,7 @@ static int update_one(struct cache_tree *it,
399399
strbuf_addf(&buffer, "%o %.*s%c", mode, entlen, path + baselen, '\0');
400400
strbuf_add(&buffer, oid->hash, the_hash_algo->rawsz);
401401

402-
#if DEBUG
402+
#if DEBUG_CACHE_TREE
403403
fprintf(stderr, "cache-tree update-one %o %.*s\n",
404404
mode, entlen, path + baselen);
405405
#endif
@@ -422,7 +422,7 @@ static int update_one(struct cache_tree *it,
422422

423423
strbuf_release(&buffer);
424424
it->entry_count = to_invalidate ? -1 : i - *skip_count;
425-
#if DEBUG
425+
#if DEBUG_CACHE_TREE
426426
fprintf(stderr, "cache-tree update-one (%d ent, %d subtree) %s\n",
427427
it->entry_count, it->subtree_nr,
428428
oid_to_hex(&it->oid));
@@ -463,7 +463,7 @@ static void write_one(struct strbuf *buffer, struct cache_tree *it,
463463
strbuf_add(buffer, path, pathlen);
464464
strbuf_addf(buffer, "%c%d %d\n", 0, it->entry_count, it->subtree_nr);
465465

466-
#if DEBUG
466+
#if DEBUG_CACHE_TREE
467467
if (0 <= it->entry_count)
468468
fprintf(stderr, "cache-tree <%.*s> (%d ent, %d subtree) %s\n",
469469
pathlen, path, it->entry_count, it->subtree_nr,
@@ -537,7 +537,7 @@ static struct cache_tree *read_one(const char **buffer, unsigned long *size_p)
537537
size -= rawsz;
538538
}
539539

540-
#if DEBUG
540+
#if DEBUG_CACHE_TREE
541541
if (0 <= it->entry_count)
542542
fprintf(stderr, "cache-tree <%s> (%d ent, %d subtree) %s\n",
543543
*buffer, it->entry_count, subtree_nr,

0 commit comments

Comments
 (0)