diff options
author | Jeff King <peff@peff.net> | 2020-10-15 15:30:04 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-10-16 08:33:58 -0700 |
commit | 5710dcce74ac2a8a8d6f8f131aaa498cb04aa253 (patch) | |
tree | 8ac5b6b0b4d1e5e95e0bb902f148d754f79ddacd /utf8.c | |
parent | Git 2.28 (diff) | |
download | tgif-5710dcce74ac2a8a8d6f8f131aaa498cb04aa253.tar.xz |
usage: define a type for a reporting function
The usage, die, warning, and error routines all work with a function
pointer that takes the message to be reported. We usually just mention
the function's full type inline. But this makes the use of these
pointers hard to read, especially because C's syntax for returning a
function pointer is so awful:
void (*get_error_routine(void))(const char *err, va_list params);
Unless you read it very carefully, this looks like a function pointer
declaration. Let's instead use a single typedef to define a reporting
function, which is the same for all four types.
Note that this also removes the "extern" from these declarations to
match the surrounding functions. They were missed in 554544276a (*.[ch]:
remove extern from function declarations using spatch, 2019-04-29)
presumably because of the unusual syntax.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'utf8.c')
0 files changed, 0 insertions, 0 deletions