[GSoC][PATCH 1/1] add: use unsigned type for collection of bits
From: Eugenio Gigante <hidden>
Date: 2024-02-24 11:27:57
Subsystem:
the rest · Maintainer:
Linus Torvalds
From: Eugenio Gigante <hidden>
Date: 2024-02-24 11:27:57
Subsystem:
the rest · Maintainer:
Linus Torvalds
The function 'refresh' in 'builtin/add.c' declares 'flags' as signed, while the function 'refresh_index' defined in 'read-cache-ll.h' expects an unsigned value. Since in this case 'flags' represents a bag of bits, whose MSB is not used in special ways, this commit changes the type of 'flags' to unsigned. Signed-off-by: Eugenio Gigante <redacted> --- builtin/add.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/add.c b/builtin/add.c
index ada7719561..393c10cbcf 100644
--- a/builtin/add.c
+++ b/builtin/add.c@@ -115,7 +115,7 @@ static int refresh(int verbose, const struct pathspec *pathspec) int i, ret = 0; char *skip_worktree_seen = NULL; struct string_list only_match_skip_worktree = STRING_LIST_INIT_NODUP; - int flags = REFRESH_IGNORE_SKIP_WORKTREE | + unsigned int flags = REFRESH_IGNORE_SKIP_WORKTREE | (verbose ? REFRESH_IN_PORCELAIN : REFRESH_QUIET); seen = xcalloc(pathspec->nr, 1);
--
2.43.0