[PATCH 1/7] Make unpack_trees_options bit flags actual bitfields

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linus Torvalds
Date: Saturday, March 22, 2008 - 10:22 am

From: Linus Torvalds <torvalds@woody.linux-foundation.org>
Date: Fri, 21 Mar 2008 13:14:47 -0700

Instead of wasting space with whole integers for a single bit.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
---

This is really unrelated to the rest of the series, except for the fact 
that it irritated me when I was thinking about the required changes to 
unpack-trees.

 unpack-trees.h |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/unpack-trees.h b/unpack-trees.h
index 50453ed..ad8cc65 100644
--- a/unpack-trees.h
+++ b/unpack-trees.h
@@ -9,16 +9,16 @@ typedef int (*merge_fn_t)(struct cache_entry **src,
 		struct unpack_trees_options *options);
 
 struct unpack_trees_options {
-	int reset;
-	int merge;
-	int update;
-	int index_only;
-	int nontrivial_merge;
-	int trivial_merges_only;
-	int verbose_update;
-	int aggressive;
-	int skip_unmerged;
-	int gently;
+	unsigned int reset:1,
+		     merge:1,
+		     update:1,
+		     index_only:1,
+		     nontrivial_merge:1,
+		     trivial_merges_only:1,
+		     verbose_update:1,
+		     aggressive:1,
+		     skip_unmerged:1,
+		     gently:1;
 	const char *prefix;
 	int pos;
 	struct dir_struct *dir;
-- 
1.5.5.rc0.28.g61a0.dirty

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/7] Case-insensitive filesystem support, take 1, Linus Torvalds, (Sat Mar 22, 10:21 am)
[PATCH 1/7] Make unpack_trees_options bit flags actual bit ..., Linus Torvalds, (Sat Mar 22, 10:22 am)
[PATCH 5/7] Add 'core.ignorecase' option, Linus Torvalds, (Sat Mar 22, 10:33 am)
Re: [PATCH 1/7] Make unpack_trees_options bit flags actual ..., Johannes Schindelin, (Sat Mar 22, 10:36 am)
Re: [PATCH 1/7] Make unpack_trees_options bit flags actual ..., Johannes Schindelin, (Sat Mar 22, 10:57 am)
[PATCH 0/7] Final words, Linus Torvalds, (Sat Mar 22, 11:06 am)
Re: [PATCH 0/7] Final words, Linus Torvalds, (Sat Mar 22, 11:28 am)
[PATCH] git-init: autodetect core.ignorecase, Dmitry Potapov, (Mon Mar 24, 11:57 pm)
Re: [PATCH] git-init: autodetect core.ignorecase, Johannes Schindelin, (Tue Mar 25, 2:59 am)
[PATCH v2] git-init: autodetect core.ignorecase, Dmitry Potapov, (Tue Mar 25, 3:49 am)
Re: [PATCH] git-init: autodetect core.ignorecase, Dmitry Potapov, (Tue Mar 25, 4:03 am)