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

[RFC 3/3] Alternates API: Remove unused parameter

From
Michael Witten <mfwitten@gmail.com>
Date
Mar 30, 2011, 21:28 UTC
Message-ID
<3c357acd119aa836f6cd3298d62cc5098f4c053c.1301521244.git.mfwitten@gmail.com>
In-Reply-To
<cover.1301521243.git.mfwitten@gmail.com>
Signed-off-by: Michael Witten <mfwitten@gmail.com>
---
 builtin/fetch-pack.c   |    2 +-
 builtin/receive-pack.c |    2 +-
 transport.c            |    2 +-
 transport.h            |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/transport.h b/transport.h
index 88fa484..cf6fda4 100644
--- a/transport.h
+++ b/transport.h
@@ -166,7 +166,7 @@ int transport_refs_pushed(struct ref *ref);
 void transport_print_push_status(const char *dest, struct ref *refs,
 		  int verbose, int porcelain, int *nonfastforward);
 
-typedef void (*transport_alt_refs_fn)(const struct ref *, void *);
+typedef void (*transport_alt_refs_fn)(const struct ref *);
 extern int transport_alt_refs(struct alternate_object_database *, transport_alt_refs_fn);
 
 #endif
diff --git a/transport.c b/transport.c
index 53d37a9..165f69e 100644
--- a/transport.c
+++ b/transport.c
@@ -1217,7 +1217,7 @@ int transport_alt_refs(struct alternate_object_database *d, transport_alt_refs_f
 	for (extra = transport_get_remote_refs(transport);
 	     extra;
 	     extra = extra->next)
-		ref_fn(extra, NULL);
+		ref_fn(extra);
 	transport_disconnect(transport);
 	free(other);
 	return 0;
diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c
index b3a9f74..d2e0111 100644
--- a/builtin/fetch-pack.c
+++ b/builtin/fetch-pack.c
@@ -219,7 +219,7 @@ static void send_request(int fd, struct strbuf *buf)
 		safe_write(fd, buf->buf, buf->len);
 }
 
-static void insert_one_alternate_ref(const struct ref *ref, void *unused)
+static void insert_one_alternate_ref(const struct ref *ref)
 {
 	rev_list_insert_ref(NULL, ref->old_sha1, 0, NULL);
 }
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index a761332..47a5aaa 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -731,7 +731,7 @@ static int delete_only(struct command *commands)
 	return 1;
 }
 
-static void add_one_alternate_ref(const struct ref *ref, void *unused)
+static void add_one_alternate_ref(const struct ref *ref)
 {
 	add_extra_ref(".have", ref->old_sha1, 0);
 }
-- 
1.7.4.18.g68fe8
Previous: Junio C HamanoNext: Michael Witten
Message 10 of 12 in “[RFC 1/2] Portability: Convert strictly between function pointers”
  1. Michael WittenMar 29, 2011
  2. 2/2 Future Proofing: Pass around pointers to either functions or dataMichael Witten, Mar 29, 2011
  3. Erik Faye-LundMar 30, 2011
  4. Michael WittenMar 30, 2011
  5. Junio C HamanoMar 30, 2011
  6. 1/3 Alternates API: Untangle the interfaceMichael Witten, Mar 30, 2011
  7. Junio C HamanoMar 30, 2011
  8. 2/3 Alternates API: Improve namingMichael Witten, Mar 30, 2011
  9. Junio C HamanoMar 30, 2011
  10. 3/3 Alternates API: Remove unused parameterMichael Witten, Mar 30, 2011
  11. 0/3 Alternates APIMichael Witten, Mar 30, 2011
  12. Junio C HamanoMar 30, 2011

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.