diff options
author | Guy Harris <guy@alum.mit.edu> | 2016-03-26 19:05:20 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2016-03-27 02:06:28 +0000 |
commit | f0ada20a91b2f8aeb785dfd121060af0442dd307 (patch) | |
tree | 39d7e386b3c00d1e2b4372811c7c53d956a3fb05 /ui | |
parent | 445a57bdc35f5f09ef878b6bf5a46d7018ddddcc (diff) |
Make failure_alert_box() be printf-like.
Have it be printf-like, and have vfailure_alert_box() be vprintf-like.
Rename a few variables to make it clearer what pointers point to
vprintf-like functions.
Change-Id: I960e2138a18edcc742c450d68a0c6f7248f50c3f
Reviewed-on: https://code.wireshark.org/review/14646
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/alert_box.c | 12 | ||||
-rw-r--r-- | ui/alert_box.h | 3 | ||||
-rw-r--r-- | ui/gtk/main.c | 2 |
3 files changed, 14 insertions, 3 deletions
diff --git a/ui/alert_box.c b/ui/alert_box.c index aac268558d..c367fb43c7 100644 --- a/ui/alert_box.c +++ b/ui/alert_box.c @@ -37,7 +37,17 @@ * Alert box for general errors. */ void -failure_alert_box(const char *msg_format, va_list ap) +failure_alert_box(const char *msg_format, ...) +{ + va_list ap; + + va_start(ap, msg_format); + vsimple_error_message_box(msg_format, ap); + va_end(ap); +} + +void +vfailure_alert_box(const char *msg_format, va_list ap) { vsimple_error_message_box(msg_format, ap); } diff --git a/ui/alert_box.h b/ui/alert_box.h index 69f11faa51..1028027eb1 100644 --- a/ui/alert_box.h +++ b/ui/alert_box.h @@ -31,7 +31,8 @@ extern "C" { /* * Alert box for general errors. */ -extern void failure_alert_box(const char *msg_format, va_list ap); +extern void failure_alert_box(const char *msg_format, ...) G_GNUC_PRINTF(1, 2); +extern void vfailure_alert_box(const char *msg_format, va_list ap); /* * Alert box for a failed attempt to open or create a file. diff --git a/ui/gtk/main.c b/ui/gtk/main.c index b2e096d483..1a4e53383d 100644 --- a/ui/gtk/main.c +++ b/ui/gtk/main.c @@ -2528,7 +2528,7 @@ main(int argc, char *argv[]) capture_session_init(&global_capture_session, &cfile); #endif - init_report_err(failure_alert_box, open_failure_alert_box, + init_report_err(vfailure_alert_box, open_failure_alert_box, read_failure_alert_box, write_failure_alert_box); /* Non-blank filter means we're remote. Throttle splash screen and resolution updates. */ |