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

[PATCH] list-objects-filter-options: fix up some sparse warnings

From
Ramsay Jones <ramsay@ramsayjones.plus.com>
Date
Nov 20, 2017, 23:39 UTC
Message-ID
<b1037774-6ae6-630b-f330-e95b1c3d681d@ramsayjones.plus.com>

In particular, sparse complains that the armor_{en,de}code_arg() functions are 'not declared - should they be static?'. Since the armor_decode_arg() symbol does not require more than file visibility, we can simply mark the declaration with static. The armor_encode_arg() function has no callers, so we simply remove the (unused) definition.

Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
---
Hi Jeff,

If you need to re-roll your 'jh/object-filtering' branch, could you please squash this (or something like it) into the relevant patch (commit bf0aedcbe1, "list-objects: filter objects in traverse_commit_list", 16-11-2017).

Thanks!

ATB, Ramsay Jones

 list-objects-filter-options.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)
diff --git a/list-objects-filter-options.c b/list-objects-filter-options.c
index 0e4ad70ab..bdbadd5a3 100644
--- a/list-objects-filter-options.c
+++ b/list-objects-filter-options.c
@@ -34,19 +34,7 @@ static int arg_needs_armor(const char *arg)
 	return 0;
 }
 
-void armor_encode_arg(struct strbuf *buf, const char *arg)
-{
-	static const char hex[] = "0123456789abcdef";
-	const unsigned char *p;
-
-	for (p = (const unsigned char *)arg; *p; p++) {
-		unsigned int val = *p;
-		strbuf_addch(buf, hex[val >> 4]);
-		strbuf_addch(buf, hex[val & 0xf]);
-	}
-}
-
-int armor_decode_arg(struct strbuf *buf, const char *arg)
+static int armor_decode_arg(struct strbuf *buf, const char *arg)
 {
 	const char *p;
 
-- 
2.15.0
Next: Jonathan Nieder
Message 1 of 5 in “list-objects-filter-options: fix up some sparse warnings”
  1. list-objects-filter-options: fix up some sparse warningsRamsay Jones, Nov 20, 2017
  2. Jonathan NiederNov 21, 2017
  3. Ramsay JonesNov 21, 2017
  4. Stefan BellerNov 22, 2017
  5. Jeff HostetlerNov 21, 2017

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.