git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/5] cache.h: realign and use (1 << x) form for CE_* constants

From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date
Nov 27, 2010, 06:22 UTC
Message-ID
<1290838936-25601-1-git-send-email-pclouds@gmail.com>
In-Reply-To
<AANLkTinwP=tDYyeyjX8uUChtvOeVmT4QfZjxT0A67hop@mail.gmail.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 2010/11/27 Thiago Farina <tfransosi@gmail.com>:
 > Thanks for fixing this. Maybe these hex can be rewriting as 1 << 0, 1
 > << 1 and so on?
 >
 It does look better. There a few 0xXXXX constants above, but they
 are short enough.
 cache.h |   25 ++++++++++++-------------
 1 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/cache.h b/cache.h
index 33decd9..f9545a1 100644
--- a/cache.h
+++ b/cache.h
@@ -170,26 +170,25 @@ struct cache_entry {
  *
  * In-memory only flags
  */
-#define CE_UPDATE    (0x10000)
-#define CE_REMOVE    (0x20000)
-#define CE_UPTODATE  (0x40000)
-#define CE_ADDED     (0x80000)
+#define CE_UPDATE            (1 << 16)
+#define CE_REMOVE            (1 << 17)
+#define CE_UPTODATE          (1 << 18)
+#define CE_ADDED             (1 << 19)
 
-#define CE_HASHED    (0x100000)
-#define CE_UNHASHED  (0x200000)
-#define CE_CONFLICTED (0x800000)
+#define CE_HASHED            (1 << 20)
+#define CE_UNHASHED          (1 << 21)
+#define CE_WT_REMOVE         (1 << 22) /* remove in work directory */
+#define CE_CONFLICTED        (1 << 23)
 
-#define CE_WT_REMOVE (0x400000) /* remove in work directory */
-
-#define CE_UNPACKED  (0x1000000)
+#define CE_UNPACKED          (1 << 24)
 
 /*
  * Extended on-disk flags
  */
-#define CE_INTENT_TO_ADD 0x20000000
-#define CE_SKIP_WORKTREE 0x40000000
+#define CE_INTENT_TO_ADD     (1 << 29)
+#define CE_SKIP_WORKTREE     (1 << 30)
 /* CE_EXTENDED2 is for future extension */
-#define CE_EXTENDED2 0x80000000
+#define CE_EXTENDED2         (1 << 31)
 
 #define CE_EXTENDED_FLAGS (CE_INTENT_TO_ADD | CE_SKIP_WORKTREE)
 
-- 
1.7.3.2.316.gda8b3
Previous: Thiago FarinaNext: Nguyễn Thái Ngọc Duy
Message 4 of 9 in “Sparse checkout fixes”
  1. 0/5 Sparse checkout fixesNguyễn Thái Ngọc Duy, Nov 26, 2010
  2. 1/5 cache.h: remove surrounding brackes and realign CE_* constantsNguyễn Thái Ngọc Duy, Nov 26, 2010
  3. Thiago FarinaNov 26, 2010
  4. 1/5 cache.h: realign and use (1 << x) form for CE_* constantsNguyễn Thái Ngọc Duy, Nov 27, 2010
  5. 2/5 dir.c: add free_excludes()Nguyễn Thái Ngọc Duy, Nov 26, 2010
  6. 3/5 unpack-trees: move all skip-worktree checks back to unpack_trees()Nguyễn Thái Ngọc Duy, Nov 26, 2010
  7. 3/5 unpack-trees: move all skip-worktree checks back to unpack_trees()Nguyễn Thái Ngọc Duy, Nov 27, 2010
  8. 4/5 unpack-trees: fix sparse checkout's "unable to match directories"Nguyễn Thái Ngọc Duy, Nov 26, 2010
  9. 5/5 Revert "excluded_1(): support exclude files in index"Nguyễn Thái Ngọc Duy, Nov 26, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.