* dlg.c (find_widget_type): Take pointer to void to avoid casts

everywhere.  Adjust all callers.
This commit is contained in:
Pavel Roskin 2003-09-07 07:16:12 +00:00
parent 39968fa7af
commit 1e0850ab07
6 changed files with 10 additions and 8 deletions

View File

@ -127,7 +127,7 @@ edit_adjust_size (Dlg_head *h)
WEdit *edit;
WButtonBar *edit_bar;
edit = (WEdit *) find_widget_type (h, (callback_fn) edit_callback);
edit = (WEdit *) find_widget_type (h, edit_callback);
edit_bar = find_buttonbar (h);
widget_set_size (&edit->widget, 0, 0, LINES - 1, COLS);
@ -150,7 +150,7 @@ edit_dialog_callback (Dlg_head *h, int id, int msg)
edit_adjust_size (h);
return MSG_HANDLED;
case DLG_VALIDATE:
edit = (WEdit *) find_widget_type (h, (callback_fn) edit_callback);
edit = (WEdit *) find_widget_type (h, edit_callback);
if (!edit_ok_to_exit (edit)) {
h->running = 1;
}

View File

@ -1,5 +1,8 @@
2003-09-07 Pavel Roskin <proski@gnu.org>
* dlg.c (find_widget_type): Take pointer to void to avoid casts
everywhere. Adjust all callers.
* main.c (midnight_callback): Fix for the last commit - repaint
the panel if the search mode is unset.

View File

@ -399,7 +399,7 @@ int dlg_overlap (Widget *a, Widget *b)
/* Find the widget with the given callback in the dialog h */
Widget *
find_widget_type (Dlg_head *h, callback_fn signature)
find_widget_type (Dlg_head *h, void *callback)
{
Widget *w;
Widget_Item *item;
@ -412,7 +412,7 @@ find_widget_type (Dlg_head *h, callback_fn signature)
w = 0;
for (i = 0, item = h->current; i < h->count; i++, item = item->next) {
if (item->widget->callback == signature) {
if (item->widget->callback == callback) {
w = item->widget;
break;
}

View File

@ -207,7 +207,7 @@ void dlg_one_down (Dlg_head *h);
int dlg_focus (Dlg_head *h);
int dlg_select_nth_widget (Dlg_head *h, int n);
int dlg_item_number (Dlg_head *h);
Widget *find_widget_type (Dlg_head *h, callback_fn signature);
Widget *find_widget_type (Dlg_head *h, void *callback);
/* Sets/clear the specified flag in the options field */
#define widget_option(w,f,i) \

View File

@ -2599,7 +2599,7 @@ view_adjust_size (Dlg_head *h)
WButtonBar *bar;
/* Look up the viewer and the buttonbar, we assume only two widgets here */
view = (WView *) find_widget_type (h, (callback_fn) view_callback);
view = (WView *) find_widget_type (h, view_callback);
bar = find_buttonbar (h);
widget_set_size (&view->widget, 0, 0, LINES - 1, COLS);
widget_set_size (&bar->widget, LINES - 1, 0, 1, COLS);

View File

@ -2318,8 +2318,7 @@ find_buttonbar (Dlg_head *h)
{
WButtonBar *bb;
bb = (WButtonBar *) find_widget_type (h, (callback_fn)
buttonbar_callback);
bb = (WButtonBar *) find_widget_type (h, buttonbar_callback);
return bb;
}