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

[mime] cast

This commit is contained in:
Witold Filipczyk 2022-01-25 18:25:58 +01:00
parent a579526325
commit 3ca726ac98
4 changed files with 14 additions and 14 deletions

View File

@ -189,7 +189,7 @@ add_mailcap_entry(struct mailcap_entry *entry, char *type, int typelen)
return;
}
} else if (item->value) {
mitem = item->value;
mitem = (struct mailcap_hash_item *)item->value;
} else {
done_mailcap_entry(entry);
return;
@ -430,12 +430,12 @@ done_mailcap(struct module *module)
if (!mailcap_map) return;
foreach_hash_item (item, *mailcap_map, i) {
struct mailcap_hash_item *mitem = item->value;
struct mailcap_hash_item *mitem = (struct mailcap_hash_item *)item->value;
if (!mitem) continue;
while (!list_empty(mitem->entries)) {
struct mailcap_entry *entry = mitem->entries.next;
struct mailcap_entry *entry = (struct mailcap_entry *)mitem->entries.next;
del_from_list(entry);
done_mailcap_entry(entry);
@ -604,7 +604,7 @@ get_mailcap_entry(char *type)
item = get_hash_item(mailcap_map, type, strlen(type));
/* Check list of entries */
entry = (item && item->value) ? check_entries(item->value) : NULL;
entry = ((item && item->value) ? check_entries((struct mailcap_hash_item *)item->value) : NULL);
if (!entry || get_mailcap_prioritize()) {
/* The type lookup has either failed or we need to check
@ -625,7 +625,7 @@ get_mailcap_entry(char *type)
mem_free(wildtype);
if (item && item->value)
wildcard = check_entries(item->value);
wildcard = check_entries((struct mailcap_hash_item *)item->value);
}
/* Use @wildcard if its priority is better or @entry is NULL */

View File

@ -198,7 +198,7 @@ done_mimetypes(struct module *module)
foreach_hash_item (item, *mimetypes_map, i) {
if (item->value) {
struct mimetypes_entry *entry = item->value;
struct mimetypes_entry *entry = (struct mimetypes_entry *)item->value;
done_mimetypes_entry(entry);
}
@ -254,7 +254,7 @@ get_content_type_mimetypes(char *extension)
/* Check list of entries */
if (item && item->value) {
struct mimetypes_entry *entry = item->value;
struct mimetypes_entry *entry = (struct mimetypes_entry *)item->value;
return stracpy(entry->content_type);
}

View File

@ -52,7 +52,7 @@ menu_del_ext(struct terminal *term, void *fcp, void *xxx2)
{
/* [gettext_accelerator_context(menu_del_ext)] */
struct option *opt = NULL;
char *extension = fcp;
char *extension = (char *)fcp;
if (!extension) return;
@ -81,7 +81,7 @@ struct extension {
static void
add_mime_extension(void *data)
{
struct extension *ext = data;
struct extension *ext = (struct extension *)data;
struct string name;
if (!ext || !init_string(&name)) return;
@ -112,12 +112,12 @@ menu_add_ext(struct terminal *term, void *fcp, void *xxx2)
new_ = (struct extension *) get_dialog_offset(dlg, MIME_WIDGETS_COUNT);
if (fcp) {
struct option *opt = get_real_opt("mime.extension", fcp);
struct option *opt = get_real_opt("mime.extension", (char *)fcp);
if (opt) {
safe_strncpy(new_->ext, fcp, MAX_STR_LEN);
safe_strncpy(new_->ext, (const char *)fcp, MAX_STR_LEN);
safe_strncpy(new_->ct, opt->value.string, MAX_STR_LEN);
safe_strncpy(new_->ext_orig, fcp, MAX_STR_LEN);
safe_strncpy(new_->ext_orig, (const char *)fcp, MAX_STR_LEN);
}
mem_free(fcp);
@ -146,7 +146,7 @@ static struct menu_item mi_no_ext[] = {
void
menu_list_ext(struct terminal *term, void *fn_, void *xxx)
{
menu_func_T fn = fn_;
menu_func_T fn = (menu_func_T)fn_;
LIST_OF(struct option) *opt_tree = get_opt_tree("mime.extension", NULL);
struct option *opt;
struct menu_item *mi = NULL;

View File

@ -241,7 +241,7 @@ get_fragment_content_type(struct cache_entry *cached)
if (list_empty(cached->frag))
return NULL;
fragment = cached->frag.next;
fragment = (struct fragment *)cached->frag.next;
if (fragment->offset)
return NULL;