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

[PATCH] test-date: drop unused parameter to getnanos()

From
Jeff King <peff@peff.net>
Date
Feb 6, 2019, 19:35 UTC
Message-ID
<20190206193552.GA6539@sigill.intra.peff.net>

The getnanos() helper always gets the current time from our getnanotime() facility. The caller cannot override it via TEST_DATE_NOW, and hence we simply ignore the "now" parameter to the function. Let's remove it, as it may mislead callers into thinking it does something.

Signed-off-by: Jeff King <peff@peff.net>
---
This goes on the js/vsts-ci branch.
Noticed by merging 'next' with my -Wunused-parameters work-in-progress. :)
 t/helper/test-date.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/helper/test-date.c b/t/helper/test-date.c
index 792a805374..f9e2b91ed1 100644
--- a/t/helper/test-date.c
+++ b/t/helper/test-date.c
@@ -83,7 +83,7 @@ static void parse_approx_timestamp(const char **argv, struct timeval *now)
 	}
 }
 
-static void getnanos(const char **argv, struct timeval *now)
+static void getnanos(const char **argv)
 {
 	double seconds = getnanotime() / 1.0e9;
 
@@ -119,7 +119,7 @@ int cmd__date(int argc, const char **argv)
 	else if (!strcmp(*argv, "timestamp"))
 		parse_approx_timestamp(argv+1, &now);
 	else if (!strcmp(*argv, "getnanos"))
-		getnanos(argv+1, &now);
+		getnanos(argv+1);
 	else if (!strcmp(*argv, "is64bit"))
 		return sizeof(timestamp_t) == 8 ? 0 : 1;
 	else if (!strcmp(*argv, "time_t-is64bit"))
-- 
2.20.1.1122.g2972e48916
Message 1 of 1 in “test-date: drop unused parameter to getnanos()”
  1. test-date: drop unused parameter to getnanos()Jeff King, Feb 6, 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.