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

[PATCH 1/6] gc: mark unused config parameter in virtual functions

From
Jeff King <peff@peff.net>
Date
Aug 28, 2024, 03:57 UTC
Message-ID
<20240828035746.GA3999193@coredump.intra.peff.net>
In-Reply-To
<20240828035722.GA3998881@coredump.intra.peff.net>

Commit d1ae15d68b (builtin/gc: refactor to read config into structure, 2024-08-16) added a new parameter to the maintenance_task virtual functions, but most of them don't need to look at it.

Signed-off-by: Jeff King <peff@peff.net>
---
 builtin/gc.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/builtin/gc.c b/builtin/gc.c
index 427faf1cfe..0e361253e3 100644
--- a/builtin/gc.c
+++ b/builtin/gc.c
@@ -967,7 +967,7 @@ static int dfs_on_ref(const char *refname UNUSED,
 	return result;
 }
 
-static int should_write_commit_graph(struct gc_config *cfg)
+static int should_write_commit_graph(struct gc_config *cfg UNUSED)
 {
 	int result;
 	struct cg_auto_data data;
@@ -1005,7 +1005,7 @@ static int run_write_commit_graph(struct maintenance_run_opts *opts)
 }
 
 static int maintenance_task_commit_graph(struct maintenance_run_opts *opts,
-					 struct gc_config *cfg)
+					 struct gc_config *cfg UNUSED)
 {
 	prepare_repo_settings(the_repository);
 	if (!the_repository->settings.core_commit_graph)
@@ -1040,7 +1040,7 @@ static int fetch_remote(struct remote *remote, void *cbdata)
 }
 
 static int maintenance_task_prefetch(struct maintenance_run_opts *opts,
-				     struct gc_config *cfg)
+				     struct gc_config *cfg UNUSED)
 {
 	if (for_each_remote(fetch_remote, opts)) {
 		error(_("failed to prefetch remotes"));
@@ -1051,7 +1051,7 @@ static int maintenance_task_prefetch(struct maintenance_run_opts *opts,
 }
 
 static int maintenance_task_gc(struct maintenance_run_opts *opts,
-			       struct gc_config *cfg)
+			       struct gc_config *cfg UNUSED)
 {
 	struct child_process child = CHILD_PROCESS_INIT;
 
@@ -1100,7 +1100,7 @@ static int loose_object_count(const struct object_id *oid UNUSED,
 	return 0;
 }
 
-static int loose_object_auto_condition(struct gc_config *cfg)
+static int loose_object_auto_condition(struct gc_config *cfg UNUSED)
 {
 	int count = 0;
 
@@ -1192,12 +1192,12 @@ static int pack_loose(struct maintenance_run_opts *opts)
 }
 
 static int maintenance_task_loose_objects(struct maintenance_run_opts *opts,
-					  struct gc_config *cfg)
+					  struct gc_config *cfg UNUSED)
 {
 	return prune_packed(opts) || pack_loose(opts);
 }
 
-static int incremental_repack_auto_condition(struct gc_config *cfg)
+static int incremental_repack_auto_condition(struct gc_config *cfg UNUSED)
 {
 	struct packed_git *p;
 	int incremental_repack_auto_limit = 10;
@@ -1317,7 +1317,7 @@ static int multi_pack_index_repack(struct maintenance_run_opts *opts)
 }
 
 static int maintenance_task_incremental_repack(struct maintenance_run_opts *opts,
-					       struct gc_config *cfg)
+					       struct gc_config *cfg UNUSED)
 {
 	prepare_repo_settings(the_repository);
 	if (!the_repository->settings.core_multi_pack_index) {
-- 
2.46.0.754.g24c813f009
Previous: Jeff KingNext: Jeff King
Message 2 of 13 in “unused parameters: the final countdown”
  1. 0/6 unused parameters: the final countdownJeff King, Aug 28, 2024
  2. 1/6 gc: mark unused config parameter in virtual functionsJeff King, Aug 28, 2024
  3. 2/6 t-reftable-readwrite: mark unused parameter in callback functionJeff King, Aug 28, 2024
  4. 3/6 compat: disable -Wunused-parameter in 3rd-party codeJeff King, Aug 28, 2024
  5. 4/6 compat: disable -Wunused-parameter in win32/headless.cJeff King, Aug 28, 2024
  6. 5/6 compat: mark unused parameters in win32/mingw functionsJeff King, Aug 28, 2024
  7. 6/6 config.mak.dev: enable -Wunused-parameter by defaultJeff King, Aug 28, 2024
  8. Eric SunshineAug 28, 2024
  9. Patrick SteinhardtAug 28, 2024
  10. 7/6 CodingGuidelines: mention -Wunused-parameter and UNUSEDJeff King, Aug 28, 2024
  11. Eric SunshineAug 28, 2024
  12. Junio C HamanoAug 28, 2024
  13. Jeff KingAug 28, 2024

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.