mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
Make all instances of struct widget_ops const.
And widget_type_to_ops[] too.
This commit is contained in:
parent
d40cccef0f
commit
be9660f7d0
@ -331,7 +331,7 @@ select_button(struct dialog_data *dlg_data, struct widget_data *widget_data)
|
||||
return widget_data->widget->handler(dlg_data, widget_data);
|
||||
}
|
||||
|
||||
struct widget_ops button_ops = {
|
||||
const struct widget_ops button_ops = {
|
||||
display_button,
|
||||
NULL,
|
||||
mouse_button,
|
||||
|
@ -47,7 +47,7 @@ void add_dlg_button_do(struct dialog *dlg, unsigned char *text, int flags, widge
|
||||
add_dlg_button_do(dlg, text, flags, handler, data, NULL, NULL)
|
||||
#endif
|
||||
|
||||
extern struct widget_ops button_ops;
|
||||
extern const struct widget_ops button_ops;
|
||||
void dlg_format_buttons(struct terminal *, struct widget_data *, int, int, int *, int, int *, enum format_align, int);
|
||||
|
||||
#endif
|
||||
|
@ -164,7 +164,7 @@ select_checkbox(struct dialog_data *dlg_data, struct widget_data *widget_data)
|
||||
return EVENT_PROCESSED;
|
||||
}
|
||||
|
||||
struct widget_ops checkbox_ops = {
|
||||
const struct widget_ops checkbox_ops = {
|
||||
display_checkbox,
|
||||
init_checkbox,
|
||||
mouse_checkbox,
|
||||
|
@ -27,7 +27,7 @@ void add_dlg_radio_do(struct dialog *dlg, unsigned char *text, int groupid, int
|
||||
#define add_dlg_checkbox(dlg, text, data) \
|
||||
add_dlg_radio_do(dlg, text, 0, 0, data)
|
||||
|
||||
extern struct widget_ops checkbox_ops;
|
||||
extern const struct widget_ops checkbox_ops;
|
||||
|
||||
void
|
||||
dlg_format_checkbox(struct terminal *term,
|
||||
|
@ -140,7 +140,7 @@ select_dlg_item(struct dialog_data *dlg_data, struct widget_data *widget_data)
|
||||
widget_data->widget->ops->select(dlg_data, widget_data);
|
||||
}
|
||||
|
||||
static struct widget_ops *widget_type_to_ops[] = {
|
||||
static const struct widget_ops *const widget_type_to_ops[] = {
|
||||
&checkbox_ops,
|
||||
&field_ops,
|
||||
&field_pass_ops,
|
||||
|
@ -744,7 +744,7 @@ clear_field(struct dialog_data *dlg_data, struct widget_data *widget_data)
|
||||
return EVENT_PROCESSED;
|
||||
}
|
||||
|
||||
struct widget_ops field_ops = {
|
||||
const struct widget_ops field_ops = {
|
||||
display_field,
|
||||
init_field,
|
||||
mouse_field,
|
||||
@ -753,7 +753,7 @@ struct widget_ops field_ops = {
|
||||
clear_field,
|
||||
};
|
||||
|
||||
struct widget_ops field_pass_ops = {
|
||||
const struct widget_ops field_pass_ops = {
|
||||
display_field_pass,
|
||||
init_field,
|
||||
mouse_field,
|
||||
|
@ -56,8 +56,8 @@ add_dlg_field_do(struct dialog *dlg, enum widget_type type, unsigned char *label
|
||||
add_dlg_field_do(dlg, WIDGET_FIELD_PASS, label, min, max, handler, len, field, NULL, INPFIELD_FLOAT)
|
||||
|
||||
|
||||
extern struct widget_ops field_ops;
|
||||
extern struct widget_ops field_pass_ops;
|
||||
extern const struct widget_ops field_ops;
|
||||
extern const struct widget_ops field_pass_ops;
|
||||
|
||||
widget_handler_status_T check_number(struct dialog_data *, struct widget_data *);
|
||||
widget_handler_status_T check_nonempty(struct dialog_data *, struct widget_data *);
|
||||
|
@ -735,7 +735,7 @@ kbd_listbox(struct dialog_data *dlg_data, struct widget_data *widget_data)
|
||||
return EVENT_NOT_PROCESSED;
|
||||
}
|
||||
|
||||
struct widget_ops listbox_ops = {
|
||||
const struct widget_ops listbox_ops = {
|
||||
display_listbox,
|
||||
init_listbox,
|
||||
mouse_listbox,
|
||||
|
@ -131,7 +131,7 @@ struct listbox_item {
|
||||
void *udata;
|
||||
};
|
||||
|
||||
extern struct widget_ops listbox_ops;
|
||||
extern const struct widget_ops listbox_ops;
|
||||
|
||||
void dlg_format_listbox(struct terminal *, struct widget_data *, int, int *, int, int, int *, enum format_align, int format_only);
|
||||
|
||||
|
@ -542,7 +542,7 @@ mouse_text(struct dialog_data *dlg_data, struct widget_data *widget_data)
|
||||
}
|
||||
|
||||
|
||||
struct widget_ops text_ops = {
|
||||
const struct widget_ops text_ops = {
|
||||
display_text,
|
||||
NULL,
|
||||
mouse_text,
|
||||
|
@ -44,7 +44,7 @@ struct widget_data_info_text {
|
||||
void add_dlg_text(struct dialog *dlg, unsigned char *text,
|
||||
enum format_align align, int bottom_pad);
|
||||
|
||||
extern struct widget_ops text_ops;
|
||||
extern const struct widget_ops text_ops;
|
||||
void dlg_format_text_do(struct terminal *term,
|
||||
unsigned char *text, int x, int *y, int w, int *rw,
|
||||
struct color_pair *scolor, enum format_align align, int format_only);
|
||||
|
Loading…
Reference in New Issue
Block a user