Skip to content

Commit b6fd0a7

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 6fcdff0 commit b6fd0a7

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)
@@ -110,7 +110,7 @@ static int do_invalidate_path(struct cache_tree *it, const char *path)
110110
int namelen;
111111
struct cache_tree_sub *down;
112112

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

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

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

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

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

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

0 commit comments

Comments
 (0)