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

[PATCH] revision.c: fix sparse warnings (sparse algorithm)

From
Ramsay Jones <ramsay@ramsayjones.plus.com>
Date
Jan 13, 2019, 20:55 UTC
Message-ID
<0f69cce6-a0a0-8972-93dd-5c1aa428f508@ramsayjones.plus.com>
Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
---
Hi Derrick,

If you need to re-roll your 'ds/push-sparse-tree-walk' branch, could you please squash this into the relevant patch [commit 9949aaeef4 ("revision: implement sparse algorithm", 2018-12-14)].

This commit caused both 'sparse' and my 'static-check.pl' script to complain about the visibility of the 'map_flags' variable (it is a file local variable), so one solution would be to mark it 'static'. However, it is simply not being used, so ...

Thanks!

ATB, Ramsay Jones

 revision.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/revision.c b/revision.c
index a048da3cf5..c4982a70b1 100644
--- a/revision.c
+++ b/revision.c
@@ -114,10 +114,9 @@ static int path_and_oids_cmp(const void *hashmap_cmp_fn_data,
 	return strcmp(e1->path, e2->path);
 }
 
-int map_flags = 0;
 static void paths_and_oids_init(struct hashmap *map)
 {
-	hashmap_init(map, (hashmap_cmp_fn) path_and_oids_cmp, &map_flags, 0);
+	hashmap_init(map, (hashmap_cmp_fn) path_and_oids_cmp, NULL, 0);
 }
 
 static void paths_and_oids_clear(struct hashmap *map)
-- 
2.20.0
Next: Derrick Stolee
Message 1 of 3 in “revision.c: fix sparse warnings (sparse algorithm)”
  1. revision.c: fix sparse warnings (sparse algorithm)Ramsay Jones, Jan 13, 2019
  2. Derrick StoleeJan 15, 2019
  3. Junio C HamanoJan 15, 2019

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.