diff --git a/lib/widget/dialog.c b/lib/widget/dialog.c index 72ca9234a..24e9cce7a 100644 --- a/lib/widget/dialog.c +++ b/lib/widget/dialog.c @@ -427,7 +427,7 @@ dlg_create (gboolean modal, int y1, int x1, int lines, int cols, widget_pos_flag new_d->colors = colors; new_d->help_ctx = help_ctx; new_d->compact = compact; - new_d->data = NULL; + new_d->data.p = NULL; if (modal) { diff --git a/lib/widget/dialog.h b/lib/widget/dialog.h index 0ebf51051..8367905db 100644 --- a/lib/widget/dialog.h +++ b/lib/widget/dialog.h @@ -69,10 +69,16 @@ struct WDialog int ret_value; /* Result of dlg_run() */ /* Internal variables */ - void *data; /* Data can be passed to dialog */ char *event_group; /* Name of event group for this dialog */ Widget *bg; /* WFrame or WBackground */ + /* Data can be passed to dialog */ + union + { + void *p; + int i; + } data; + dlg_shortcut_str get_shortcut; /* Shortcut string */ dlg_title_str get_title; /* useless for modal dialogs */ }; diff --git a/lib/widget/history.c b/lib/widget/history.c index d56bc51f3..27e86a1f4 100644 --- a/lib/widget/history.c +++ b/lib/widget/history.c @@ -73,10 +73,10 @@ history_dlg_reposition (WDialog * dlg_head) WRect r; /* guard checks */ - if ((dlg_head == NULL) || (dlg_head->data == NULL)) + if (dlg_head == NULL || dlg_head->data.p == NULL) return MSG_NOT_HANDLED; - data = (history_dlg_data *) dlg_head->data; + data = (history_dlg_data *) dlg_head->data.p; y = data->y; he = data->count + 2; @@ -227,7 +227,7 @@ history_show (history_descriptor_t * hd) query_dlg = dlg_create (TRUE, 0, 0, 4, 4, WPOS_KEEP_DEFAULT, TRUE, dialog_colors, history_dlg_callback, NULL, "[History-query]", _("History")); - query_dlg->data = &hist_data; + query_dlg->data.p = &hist_data; /* this call makes list stick to all sides of dialog, effectively make it be resized with dialog */ diff --git a/src/filemanager/boxes.c b/src/filemanager/boxes.c index 07c2a67df..f6612128b 100644 --- a/src/filemanager/boxes.c +++ b/src/filemanager/boxes.c @@ -189,7 +189,7 @@ skin_dlg_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void case MSG_RESIZE: { WDialog *d = DIALOG (w); - const WRect *wd = &WIDGET (d->data)->rect; + const WRect *wd = &WIDGET (d->data.p)->rect; WRect r = w->rect; r.y = wd->y + (wd->lines - r.lines) / 2; @@ -221,7 +221,7 @@ sel_skin_button (WButton * button, int action) dlg_create (TRUE, 0, 0, 13, 24, WPOS_KEEP_DEFAULT, TRUE, dialog_colors, skin_dlg_callback, NULL, "[Appearance]", _("Skins")); /* use Appearance dialog for positioning */ - skin_dlg->data = WIDGET (button)->owner; + skin_dlg->data.p = WIDGET (button)->owner; /* set dialog location before all */ send_message (skin_dlg, NULL, MSG_RESIZE, 0, NULL);