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

[PATCH] git-apply: slightly clean up bitfield usage

From
Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Date
Nov 18, 2006, 12:07 UTC
Message-ID
<455EF76D.1040206@lsrfire.ath.cx>

This patch fixes a sparse warning about inaccurate_eof being a "dubious one-bit signed bitfield", makes three more binary variables members of this (now unsigned) bitfield and adds a short comment to indicate the nature of two ternary variables.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
---
 builtin-apply.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/builtin-apply.c b/builtin-apply.c
index aad5526..61f047f 100644
--- a/builtin-apply.c
+++ b/builtin-apply.c
@@ -140,12 +140,15 @@ struct fragment {
 struct patch {
 	char *new_name, *old_name, *def_name;
 	unsigned int old_mode, new_mode;
-	int is_rename, is_copy, is_new, is_delete, is_binary;
+	int is_new, is_delete;	/* -1 = unknown, 0 = false, 1 = true */
 	int rejected;
 	unsigned long deflate_origlen;
 	int lines_added, lines_deleted;
 	int score;
-	int inaccurate_eof:1;
+	unsigned int inaccurate_eof:1;
+	unsigned int is_binary:1;
+	unsigned int is_copy:1;
+	unsigned int is_rename:1;
 	struct fragment *fragments;
 	char *result;
 	unsigned long resultsize;
-- 
1.4.4
Message 1 of 1 in “git-apply: slightly clean up bitfield usage”
  1. git-apply: slightly clean up bitfield usageRene Scharfe, Nov 18, 2006

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.