From: Ian Jackson Date: Mon, 24 Mar 2008 18:03:00 +0000 (+0200) Subject: Replace function pointer declarations with new error_printer type X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b2ac874fee1f76c0869b5cbf72fbf8b556dfe916;p=dpkg Replace function pointer declarations with new error_printer type --- diff --git a/ChangeLog b/ChangeLog index 1264c515..233db45a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-03-24 Ian Jackson + + * lib/dpkg.h (error_printer): New function pointer type. + (push_error_handler): Use error_printer instead of an explicit + declaration in the argument list. + (set_error_display): Likewise. + * lib/ehandle.c (push_error_handler): Likewise. + (set_error_display): Likewise. + 2008-03-23 Guillem Jover * configure.ac (DPKG_CHECK_COMPAT_FUNCS): Add 'strnlen'. diff --git a/lib/dpkg.h b/lib/dpkg.h index 7184c681..4a53d92e 100644 --- a/lib/dpkg.h +++ b/lib/dpkg.h @@ -181,11 +181,11 @@ extern const char printforhelp[]; /*** from ehandle.c ***/ -void push_error_handler(jmp_buf *jbufp, - void (*printerror)(const char *, const char *), +typedef void error_printer(const char *emsg, const char *contextstring); + +void push_error_handler(jmp_buf *jbufp, error_printer *printerror, const char *contextstring); -void set_error_display(void (*printerror)(const char *, const char *), - const char *contextstring); +void set_error_display(error_printer *printerror, const char *contextstring); void print_error_fatal(const char *emsg, const char *contextstring); void error_unwind(int flagset); void push_cleanup(void (*f1)(int argc, void **argv), int flagmask1, diff --git a/lib/ehandle.c b/lib/ehandle.c index f4945826..5d857ede 100644 --- a/lib/ehandle.c +++ b/lib/ehandle.c @@ -63,7 +63,7 @@ struct errorcontext { static struct errorcontext *volatile econtext= NULL; static struct { struct cleanupentry ce; void *args[20]; } emergency; -void set_error_display(void (*printerror)(const char *, const char *), +void set_error_display(error_printer *printerror, const char *contextstring) { assert(econtext); econtext->printerror= printerror; @@ -71,7 +71,7 @@ void set_error_display(void (*printerror)(const char *, const char *), } void push_error_handler(jmp_buf *jbufp, - void (*printerror)(const char *, const char *), + error_printer *printerror, const char *contextstring) { struct errorcontext *necp; necp= malloc(sizeof(struct errorcontext));