{"thread":{"id":"50416","subject":"[PATCH] test-date: drop unused parameter to getnanos()","startedAt":"2019-02-06T19:35:56Z","lastAt":"2019-02-06T19:35:56Z","messageCount":1,"participants":["Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"368636","messageId":"20190206193552.GA6539@sigill.intra.peff.net","threadId":"50416","inReplyTo":null,"subject":"[PATCH] test-date: drop unused parameter to getnanos()","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2019-02-06T19:35:52Z","receivedAt":"2019-02-06T19:35:56Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"The getnanos() helper always gets the current time from our\ngetnanotime() facility. The caller cannot override it via TEST_DATE_NOW,\nand hence we simply ignore the \"now\" parameter to the function. Let's\nremove it, as it may mislead callers into thinking it does something.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\nThis goes on the js/vsts-ci branch.\n\nNoticed by merging 'next' with my -Wunused-parameters work-in-progress. :)\n\n t/helper/test-date.c | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/helper/test-date.c b/t/helper/test-date.c\nindex 792a805374..f9e2b91ed1 100644\n--- a/t/helper/test-date.c\n+++ b/t/helper/test-date.c\n@@ -83,7 +83,7 @@ static void parse_approx_timestamp(const char **argv, struct timeval *now)\n \t}\n }\n \n-static void getnanos(const char **argv, struct timeval *now)\n+static void getnanos(const char **argv)\n {\n \tdouble seconds = getnanotime() / 1.0e9;\n \n@@ -119,7 +119,7 @@ int cmd__date(int argc, const char **argv)\n \telse if (!strcmp(*argv, \"timestamp\"))\n \t\tparse_approx_timestamp(argv+1, &now);\n \telse if (!strcmp(*argv, \"getnanos\"))\n-\t\tgetnanos(argv+1, &now);\n+\t\tgetnanos(argv+1);\n \telse if (!strcmp(*argv, \"is64bit\"))\n \t\treturn sizeof(timestamp_t) == 8 ? 0 : 1;\n \telse if (!strcmp(*argv, \"time_t-is64bit\"))\n-- \n2.20.1.1122.g2972e48916\n"}]}