]> err.no Git - dpkg/commitdiff
Replace function pointer declarations with new error_printer type
authorIan Jackson <ian@davenant.greenend.org.uk>
Mon, 24 Mar 2008 18:03:00 +0000 (20:03 +0200)
committerGuillem Jover <guillem@debian.org>
Mon, 24 Mar 2008 18:03:00 +0000 (20:03 +0200)
ChangeLog
lib/dpkg.h
lib/ehandle.c

index 1264c515251cc6dbb32aed9da7229f44be971580..233db45ab4e07ad6958735899d88af64c8b853db 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-03-24  Ian Jackson  <ian@davenant.greenend.org.uk>
+
+       * 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  <guillem@debian.org>
 
        * configure.ac (DPKG_CHECK_COMPAT_FUNCS): Add 'strnlen'.
index 7184c681f0b760ce6d68c98c3fda7db34bfcf66b..4a53d92e3330dce3e8afc68479c3205f645398e0 100644 (file)
@@ -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,
index f494582655e10300a2300f6cb2e6c90dc2fd8e32..5d857ede202f1fa3a2eb35b5fd8af2fa02ec2651 100644 (file)
@@ -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));