Thread (34 messages) 34 messages, 4 authors, 2021-12-29

[RFC PATCH 15/21] usage.[ch] API users: use report_fn, not hardcoded prototype

flat view
STALE1760d

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2021-11-15 23:28:50
Subsystem: the rest · Maintainer: Linus Torvalds

Change a couple of users of "report_fn" that hardcoded a definition of
it to use the definition of report_fn instead.

Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
 apply.h       | 4 ++--
 run-command.c | 3 +--
 2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/apply.h b/apply.h
index da3d95fa509..8dca3703d3b 100644
--- a/apply.h
+++ b/apply.h
@@ -106,8 +106,8 @@ struct apply_state {
 	 * set_error_routine() or set_warn_routine() to install muting
 	 * routines when in verbosity_silent mode.
 	 */
-	void (*saved_error_routine)(const char *err, va_list params);
-	void (*saved_warn_routine)(const char *warn, va_list params);
+	report_fn saved_error_routine;
+	report_fn saved_warn_routine;
 
 	/* These control whitespace errors */
 	enum apply_ws_error_action ws_error_action;
diff --git a/run-command.c b/run-command.c
index a790fe9799d..4792d170be7 100644
--- a/run-command.c
+++ b/run-command.c
@@ -362,10 +362,9 @@ static void NORETURN child_die_fn(const char *err, va_list params)
 /* this runs in the parent process */
 static void child_err_spew(struct child_process *cmd, struct child_err *cerr)
 {
-	static void (*old_errfn)(const char *err, va_list params);
+	report_fn old_errfn = get_error_routine();
 	report_fn die_message_routine = get_die_message_routine();
 
-	old_errfn = get_error_routine();
 	set_error_routine(die_message_routine);
 	errno = cerr->syserr;
 
-- 
2.34.0.rc2.809.g11e21d44b24
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help