summaryrefslogtreecommitdiff
path: root/riscos/gui.c
diff options
context:
space:
mode:
Diffstat (limited to 'riscos/gui.c')
-rw-r--r--riscos/gui.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/riscos/gui.c b/riscos/gui.c
index 10e77685e..840cc0364 100644
--- a/riscos/gui.c
+++ b/riscos/gui.c
@@ -2176,20 +2176,16 @@ void gui_launch_url(const char *url)
void warn_user(const char *warning, const char *detail)
{
- union {
- char warn_buffer[300];
- os_error error;
- } d;
-
LOG(("%s %s", warning, detail));
if (dialog_warning) {
- snprintf(d.warn_buffer, sizeof d.warn_buffer, "%s %s",
+ char warn_buffer[300];
+ snprintf(warn_buffer, sizeof warn_buffer, "%s %s",
messages_get(warning),
detail ? detail : "");
- d.warn_buffer[sizeof d.warn_buffer - 1] = 0;
+ warn_buffer[sizeof warn_buffer - 1] = 0;
ro_gui_set_icon_string(dialog_warning, ICON_WARNING_MESSAGE,
- d.warn_buffer);
+ warn_buffer);
xwimp_set_icon_state(dialog_warning, ICON_WARNING_HELP,
wimp_ICON_DELETED, wimp_ICON_DELETED);
ro_gui_dialog_open(dialog_warning);
@@ -2198,11 +2194,12 @@ void warn_user(const char *warning, const char *detail)
else {
/* probably haven't initialised (properly), use a
non-multitasking error box */
- snprintf(d.error.errmess, sizeof d.error.errmess, "%s %s",
+ os_error error;
+ snprintf(error.errmess, sizeof error.errmess, "%s %s",
messages_get(warning),
detail ? detail : "");
- d.error.errmess[sizeof d.error.errmess - 1] = 0;
- xwimp_report_error_by_category(&d.error,
+ error.errmess[sizeof error.errmess - 1] = 0;
+ xwimp_report_error_by_category(&error,
wimp_ERROR_BOX_OK_ICON |
wimp_ERROR_BOX_GIVEN_CATEGORY |
wimp_ERROR_BOX_CATEGORY_ERROR <<