threads / patch / 50213

patchrevision.c: fix sparse warnings (sparse algorithm)

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

## tl;dr

3 messages between Jan 13, 2019 and Jan 15, 2019. Diffs are folded; open one to read it.

replies: 2people: 3as markdown or json

Ramsay Jones· Jan 13, 2019, 20:55 UTC · lore
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(-)
Show changes to revision.c +1 −2
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
Derrick Stolee· Jan 15, 2019, 14:42 UTC · re: Ramsay Jones · lore

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

On 1/13/2019 3:55 PM, Ramsay Jones wrote:
Show 18 quoted lines
> 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
Thanks, Ramsay! I'm rerolling the series today, so I will make this change.
-Stolee
Junio C Hamano· Jan 15, 2019, 18:29 UTC · re: Derrick Stolee · lore

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

Derrick Stolee <stolee@gmail.com> writes:
Show 23 quoted lines
> On 1/13/2019 3:55 PM, Ramsay Jones wrote:
>> 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
>
> Thanks, Ramsay! I'm rerolling the series today, so I will make this change.
>
> -Stolee
Thanks, both.

← back to recent threads