From: "Jeff Hostetler via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>,
Jeff Hostetler <jeffhost@microsoft.com>
Subject: [PATCH 03/17] cache-tree.c: avoid reusing the DEBUG constant
Date: Tue, 18 Jun 2019 05:23:57 -0700 (PDT) [thread overview]
Message-ID: <486297ec8c146e0ed47cd1dd8fe8f6496c2b54c2.1560860634.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.149.git.gitgitgadget@gmail.com>
From: Jeff Hostetler <jeffhost@microsoft.com>
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 <jeffhost@microsoft.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
cache-tree.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/cache-tree.c b/cache-tree.c
index b13bfaf71e..706ffcf188 100644
--- a/cache-tree.c
+++ b/cache-tree.c
@@ -6,8 +6,8 @@
#include "object-store.h"
#include "replace-object.h"
-#ifndef DEBUG
-#define DEBUG 0
+#ifndef DEBUG_CACHE_TREE
+#define DEBUG_CACHE_TREE 0
#endif
struct cache_tree *cache_tree(void)
@@ -111,7 +111,7 @@ static int do_invalidate_path(struct cache_tree *it, const char *path)
int namelen;
struct cache_tree_sub *down;
-#if DEBUG
+#if DEBUG_CACHE_TREE
fprintf(stderr, "cache-tree invalidate <%s>\n", path);
#endif
@@ -398,7 +398,7 @@ static int update_one(struct cache_tree *it,
strbuf_addf(&buffer, "%o %.*s%c", mode, entlen, path + baselen, '\0');
strbuf_add(&buffer, oid->hash, the_hash_algo->rawsz);
-#if DEBUG
+#if DEBUG_CACHE_TREE
fprintf(stderr, "cache-tree update-one %o %.*s\n",
mode, entlen, path + baselen);
#endif
@@ -421,7 +421,7 @@ static int update_one(struct cache_tree *it,
strbuf_release(&buffer);
it->entry_count = to_invalidate ? -1 : i - *skip_count;
-#if DEBUG
+#if DEBUG_CACHE_TREE
fprintf(stderr, "cache-tree update-one (%d ent, %d subtree) %s\n",
it->entry_count, it->subtree_nr,
oid_to_hex(&it->oid));
@@ -462,7 +462,7 @@ static void write_one(struct strbuf *buffer, struct cache_tree *it,
strbuf_add(buffer, path, pathlen);
strbuf_addf(buffer, "%c%d %d\n", 0, it->entry_count, it->subtree_nr);
-#if DEBUG
+#if DEBUG_CACHE_TREE
if (0 <= it->entry_count)
fprintf(stderr, "cache-tree <%.*s> (%d ent, %d subtree) %s\n",
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)
size -= rawsz;
}
-#if DEBUG
+#if DEBUG_CACHE_TREE
if (0 <= it->entry_count)
fprintf(stderr, "cache-tree <%s> (%d ent, %d subtree) %s\n",
*buffer, it->entry_count, subtree_nr,
--
gitgitgadget
next prev parent reply other threads:[~2019-06-18 12:24 UTC|newest]
Thread overview: 83+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-18 12:23 [PATCH 00/17] Fix MSVC support, at long last Johannes Schindelin via GitGitGadget
2019-06-18 12:23 ` [PATCH 01/17] Mark .bat files as requiring CR/LF endings Johannes Schindelin via GitGitGadget
2019-06-18 12:23 ` [PATCH 02/17] t0001 (mingw): do not expect a specific order of stdout/stderr Johannes Schindelin via GitGitGadget
2019-06-18 23:12 ` Eric Sunshine
2019-06-19 6:19 ` Johannes Sixt
2019-06-19 6:40 ` Eric Sunshine
2019-06-19 11:26 ` Johannes Schindelin
2019-06-19 11:30 ` Johannes Schindelin
2019-06-19 17:24 ` Johannes Sixt
2019-06-19 20:58 ` Johannes Schindelin
2019-06-18 12:23 ` Jeff Hostetler via GitGitGadget [this message]
2019-06-18 23:14 ` [PATCH 03/17] cache-tree.c: avoid reusing the DEBUG constant Eric Sunshine
2019-06-19 11:19 ` Johannes Schindelin
2019-06-19 15:21 ` Junio C Hamano
2019-06-19 0:08 ` Carlo Arenas
2019-06-19 11:17 ` Johannes Schindelin
2019-06-19 17:15 ` Carlo Arenas
2019-06-19 21:03 ` Johannes Schindelin
2019-06-18 12:23 ` [PATCH 04/17] obstack: fix compiler warning Johannes Schindelin via GitGitGadget
2019-06-18 12:23 ` [PATCH 06/17] msvc: fix dependencies of compat/msvc.c Johannes Schindelin via GitGitGadget
2019-06-18 12:23 ` [PATCH 05/17] mingw: replace mingw_startup() hack Johannes Schindelin via GitGitGadget
2019-06-18 12:24 ` [PATCH 07/17] msvc: include sigset_t definition Philip Oakley via GitGitGadget
2019-06-18 12:24 ` [PATCH 09/17] msvc: mark a variable as non-const Jeff Hostetler via GitGitGadget
2019-06-18 12:24 ` [PATCH 08/17] msvc: define O_ACCMODE Philip Oakley via GitGitGadget
2019-06-18 12:24 ` [PATCH 10/17] msvc: do not re-declare the timespec struct Jeff Hostetler via GitGitGadget
2019-06-18 12:24 ` [PATCH 11/17] msvc: define ftello() Jeff Hostetler via GitGitGadget
2019-06-18 12:24 ` [PATCH 12/17] msvc: fix detect_msys_tty() Jeff Hostetler via GitGitGadget
2019-06-18 12:24 ` [PATCH 13/17] msvc: support building Git using MS Visual C++ Jeff Hostetler via GitGitGadget
2019-06-19 0:51 ` Carlo Arenas
2019-06-19 12:50 ` Johannes Schindelin
2019-06-19 8:35 ` Eric Sunshine
2019-06-19 15:11 ` Johannes Schindelin
2019-06-18 12:24 ` [PATCH 14/17] msvc: add pragmas for common warnings Philip Oakley via GitGitGadget
2019-06-18 12:24 ` [PATCH 15/17] msvc: do not pretend to support all signals Jeff Hostetler via GitGitGadget
2019-06-19 4:10 ` Eric Sunshine
2019-06-19 16:49 ` Johannes Schindelin
2019-06-18 12:24 ` [PATCH 16/17] msvc: avoid debug assertion windows in Debug Mode Johannes Schindelin via GitGitGadget
2019-06-18 12:24 ` [PATCH 17/17] msvc: ignore .dll and incremental compile output Jeff Hostetler via GitGitGadget
2019-06-19 21:05 ` [PATCH v2 00/20] Fix MSVC support, at long last Johannes Schindelin via GitGitGadget
2019-06-19 21:05 ` [PATCH v2 01/20] mingw: fix a typo in the msysGit-specific section Johannes Schindelin via GitGitGadget
2019-06-19 21:05 ` [PATCH v2 02/20] Mark .bat files as requiring CR/LF endings Johannes Schindelin via GitGitGadget
2019-06-19 21:05 ` [PATCH v2 03/20] t0001 (mingw): do not expect a specific order of stdout/stderr Johannes Schindelin via GitGitGadget
2019-06-19 21:05 ` [PATCH v2 04/20] cache-tree/blame: avoid reusing the DEBUG constant Jeff Hostetler via GitGitGadget
2019-06-19 21:05 ` [PATCH v2 06/20] mingw: replace mingw_startup() hack Johannes Schindelin via GitGitGadget
2019-06-19 21:05 ` [PATCH v2 05/20] obstack: fix compiler warning Johannes Schindelin via GitGitGadget
2019-06-19 21:06 ` [PATCH v2 07/20] msvc: fix dependencies of compat/msvc.c Johannes Schindelin via GitGitGadget
2019-06-19 21:06 ` [PATCH v2 08/20] msvc: include sigset_t definition Philip Oakley via GitGitGadget
2019-06-19 21:06 ` [PATCH v2 10/20] msvc: mark a variable as non-const Jeff Hostetler via GitGitGadget
2019-06-19 21:06 ` [PATCH v2 09/20] msvc: define O_ACCMODE Philip Oakley via GitGitGadget
2019-06-19 21:06 ` [PATCH v2 11/20] msvc: do not re-declare the timespec struct Jeff Hostetler via GitGitGadget
2019-06-19 21:06 ` [PATCH v2 12/20] msvc: define ftello() Jeff Hostetler via GitGitGadget
2019-06-19 21:06 ` [PATCH v2 13/20] msvc: fix detect_msys_tty() Jeff Hostetler via GitGitGadget
2019-06-19 21:06 ` [PATCH v2 14/20] msvc: update Makefile to allow for spaces in the compiler path Jeff Hostetler via GitGitGadget
2019-06-19 21:06 ` [PATCH v2 15/20] msvc: support building Git using MS Visual C++ Jeff Hostetler via GitGitGadget
2019-06-21 20:17 ` Johannes Schindelin
2019-06-21 20:45 ` Junio C Hamano
2019-06-19 21:06 ` [PATCH v2 16/20] msvc: add a compile-time flag to allow detailed heap debugging Jeff Hostetler via GitGitGadget
2019-06-19 21:06 ` [PATCH v2 18/20] msvc: do not pretend to support all signals Jeff Hostetler via GitGitGadget
2019-06-19 21:06 ` [PATCH v2 17/20] msvc: add pragmas for common warnings Philip Oakley via GitGitGadget
2019-06-19 21:06 ` [PATCH v2 19/20] msvc: avoid debug assertion windows in Debug Mode Johannes Schindelin via GitGitGadget
2019-06-19 21:06 ` [PATCH v2 20/20] msvc: ignore .dll and incremental compile output Jeff Hostetler via GitGitGadget
2019-06-25 14:49 ` [PATCH v3 00/20] Fix MSVC support, at long last Johannes Schindelin via GitGitGadget
2019-06-25 14:49 ` [PATCH v3 01/20] mingw: fix a typo in the msysGit-specific section Johannes Schindelin via GitGitGadget
2019-06-25 14:49 ` [PATCH v3 02/20] Mark .bat files as requiring CR/LF endings Johannes Schindelin via GitGitGadget
2019-06-25 14:49 ` [PATCH v3 03/20] t0001 (mingw): do not expect a specific order of stdout/stderr Johannes Schindelin via GitGitGadget
2019-06-25 14:49 ` [PATCH v3 04/20] cache-tree/blame: avoid reusing the DEBUG constant Jeff Hostetler via GitGitGadget
2019-06-25 14:49 ` [PATCH v3 05/20] obstack: fix compiler warning Johannes Schindelin via GitGitGadget
2019-06-25 14:49 ` [PATCH v3 06/20] mingw: replace mingw_startup() hack Johannes Schindelin via GitGitGadget
2019-06-25 14:49 ` [PATCH v3 07/20] msvc: fix dependencies of compat/msvc.c Johannes Schindelin via GitGitGadget
2019-06-25 14:49 ` [PATCH v3 08/20] msvc: include sigset_t definition Philip Oakley via GitGitGadget
2019-06-25 14:49 ` [PATCH v3 10/20] msvc: mark a variable as non-const Jeff Hostetler via GitGitGadget
2019-06-25 14:49 ` [PATCH v3 09/20] msvc: define O_ACCMODE Philip Oakley via GitGitGadget
2019-06-25 14:49 ` [PATCH v3 11/20] msvc: do not re-declare the timespec struct Jeff Hostetler via GitGitGadget
2019-06-25 14:49 ` [PATCH v3 13/20] msvc: fix detect_msys_tty() Jeff Hostetler via GitGitGadget
2019-06-25 14:49 ` [PATCH v3 12/20] msvc: define ftello() Jeff Hostetler via GitGitGadget
2019-06-25 14:49 ` [PATCH v3 14/20] msvc: update Makefile to allow for spaces in the compiler path Jeff Hostetler via GitGitGadget
2019-06-25 14:49 ` [PATCH v3 15/20] msvc: support building Git using MS Visual C++ Jeff Hostetler via GitGitGadget
2019-06-25 14:49 ` [PATCH v3 16/20] msvc: add a compile-time flag to allow detailed heap debugging Jeff Hostetler via GitGitGadget
2019-06-25 14:49 ` [PATCH v3 17/20] msvc: add pragmas for common warnings Philip Oakley via GitGitGadget
2019-06-25 14:49 ` [PATCH v3 18/20] msvc: do not pretend to support all signals Jeff Hostetler via GitGitGadget
2019-06-25 14:49 ` [PATCH v3 20/20] msvc: ignore .dll and incremental compile output Jeff Hostetler via GitGitGadget
2019-06-25 14:49 ` [PATCH v3 19/20] msvc: avoid debug assertion windows in Debug Mode Johannes Schindelin via GitGitGadget
2019-06-25 17:50 ` [PATCH v3 00/20] Fix MSVC support, at long last Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=486297ec8c146e0ed47cd1dd8fe8f6496c2b54c2.1560860634.git.gitgitgadget@gmail.com \
--to=gitgitgadget@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jeffhost@microsoft.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).