1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

Make instances of struct listbox_ops const.

This commit is contained in:
Kalle Olavi Niemitalo 2007-02-04 15:17:49 +02:00 committed by Kalle Olavi Niemitalo
parent a5e321cb2b
commit d7e4b57146
12 changed files with 17 additions and 17 deletions

View File

@ -592,7 +592,7 @@ static const struct listbox_ops_messages default_listbox_ops_messages = {
static void
print_delete_error(struct listbox_item *item, struct terminal *term,
struct listbox_ops *ops, enum delete_error err)
const struct listbox_ops *ops, enum delete_error err)
{
struct string msg;
unsigned char *errmsg;
@ -647,7 +647,7 @@ static void
do_delete_item(struct listbox_item *item, struct listbox_context *info,
int last)
{
struct listbox_ops *ops = info->box->ops;
const struct listbox_ops *ops = info->box->ops;
assert(item);
@ -720,7 +720,7 @@ query_delete_selected_item(void *context_)
struct listbox_context *context, *oldcontext = context_;
struct terminal *term = oldcontext->term;
struct listbox_data *box = oldcontext->box;
struct listbox_ops *ops = box->ops;
const struct listbox_ops *ops = box->ops;
struct listbox_item *item = box->sel;
unsigned char *text;
enum delete_error delete;
@ -779,7 +779,7 @@ push_hierbox_delete_button(struct dialog_data *dlg_data,
/* [gettext_accelerator_context(push_hierbox_delete_button)] */
struct terminal *term = dlg_data->win->term;
struct listbox_data *box = get_dlg_listbox_data(dlg_data);
struct listbox_ops *ops = box->ops;
const struct listbox_ops *ops = box->ops;
struct listbox_item *item = box->sel;
struct listbox_context *context;
@ -842,7 +842,7 @@ push_hierbox_clear_button(struct dialog_data *dlg_data,
{
/* [gettext_accelerator_context(push_hierbox_clear_button)] */
struct listbox_data *box = get_dlg_listbox_data(dlg_data);
struct listbox_ops *ops = box->ops;
const struct listbox_ops *ops = box->ops;
struct terminal *term = dlg_data->win->term;
struct listbox_context *context;

View File

@ -24,7 +24,7 @@ struct hierbox_browser {
struct list_head boxes;
struct list_head dialogs;
struct listbox_item root;
struct listbox_ops *ops;
const struct listbox_ops *ops;
/* For saving state */
unsigned int do_not_save_state:1;

View File

@ -452,7 +452,7 @@ display_listbox_item(struct listbox_item *item, void *data_, int *offset)
} else {
unsigned char *text;
struct listbox_ops *ops = data->box->ops;
const struct listbox_ops *ops = data->box->ops;
int len_bytes;
assert(ops && ops->get_info);

View File

@ -100,7 +100,7 @@ struct listbox_ops {
struct listbox_data {
LIST_HEAD(struct listbox_data);
struct listbox_ops *ops; /* Backend-provided operations */
const struct listbox_ops *ops; /* Backend-provided operations */
struct listbox_item *sel; /* Item currently selected */
struct listbox_item *top; /* Item which is on the top line of the box */

View File

@ -139,7 +139,7 @@ static struct listbox_ops_messages bookmarks_messages = {
N_("Do you really want to remove all bookmarks?"),
};
static struct listbox_ops bookmarks_listbox_ops = {
static const struct listbox_ops bookmarks_listbox_ops = {
lock_bookmark,
unlock_bookmark,
is_bookmark_used,

2
src/cache/dialogs.c vendored
View File

@ -209,7 +209,7 @@ static struct listbox_ops_messages cache_messages = {
NULL,
};
static struct listbox_ops cache_entry_listbox_ops = {
static const struct listbox_ops cache_entry_listbox_ops = {
lock_cache_entry,
unlock_cache_entry,
is_cache_entry_used,

View File

@ -242,7 +242,7 @@ delete_option_item(struct listbox_item *item, int last)
mark_option_as_deleted(option);
}
static struct listbox_ops options_listbox_ops = {
static const struct listbox_ops options_listbox_ops = {
lock_option,
unlock_option,
is_option_used,
@ -727,7 +727,7 @@ delete_keybinding_item(struct listbox_item *item, int last)
free_keybinding(keybinding);
}
static struct listbox_ops keybinding_listbox_ops = {
static const struct listbox_ops keybinding_listbox_ops = {
lock_keybinding,
unlock_keybinding,
is_keybinding_used,

View File

@ -219,7 +219,7 @@ static struct listbox_ops_messages cookies_messages = {
N_("Do you really want to remove all cookies?"),
};
static struct listbox_ops cookies_listbox_ops = {
static const struct listbox_ops cookies_listbox_ops = {
lock_cookie,
unlock_cookie,
is_cookie_used,

View File

@ -445,7 +445,7 @@ static struct listbox_ops_messages download_messages = {
N_("Do you really want to interrupt all downloads?"),
};
static struct listbox_ops downloads_listbox_ops = {
static const struct listbox_ops downloads_listbox_ops = {
lock_file_download,
unlock_file_download,
is_file_download_used,

View File

@ -142,7 +142,7 @@ static struct listbox_ops_messages formhist_messages = {
N_("Do you really want to remove all forms?"),
};
static struct listbox_ops formhist_listbox_ops = {
static const struct listbox_ops formhist_listbox_ops = {
lock_formhist_data,
unlock_formhist_data,
is_formhist_data_used,

View File

@ -127,7 +127,7 @@ static struct listbox_ops_messages globhist_messages = {
N_("Do you really want to remove all history entries?"),
};
static struct listbox_ops gh_listbox_ops = {
static const struct listbox_ops gh_listbox_ops = {
lock_globhist_item,
unlock_globhist_item,
is_globhist_item_used,

View File

@ -241,7 +241,7 @@ static struct listbox_ops_messages http_auth_messages = {
N_("Do you really want to remove all auth entries?"),
};
static struct listbox_ops auth_listbox_ops = {
static const struct listbox_ops auth_listbox_ops = {
lock_auth_entry,
unlock_auth_entry,
is_auth_entry_used,