1
0
mirror of https://github.com/rkd77/elinks.git synced 2025-01-03 14:57:44 -05:00

[main] cast

This commit is contained in:
Witold Filipczyk 2022-01-25 18:16:12 +01:00
parent 37bdb9467b
commit a579526325
4 changed files with 7 additions and 7 deletions

View File

@ -1077,7 +1077,7 @@ struct entity_cache {
static int static int
hits_cmp(const void *v1, const void *v2) hits_cmp(const void *v1, const void *v2)
{ {
const struct entity_cache *a = v1, *b = v2; const struct entity_cache *a = (const struct entity_cache *)v1, *b = (const struct entity_cache *)v2;
if (a->hits == b->hits) return 0; if (a->hits == b->hits) return 0;
if (a->hits > b->hits) return -1; if (a->hits > b->hits) return -1;
@ -1213,7 +1213,7 @@ skip:
#endif #endif
} else { /* Text entity. */ } else { /* Text entity. */
struct string key = INIT_STRING((char *) str, strlen); struct string key = INIT_STRING((char *) str, strlen);
struct entity *element = bsearch((void *) &key, entities, struct entity *element = (struct entity *)bsearch((void *) &key, entities,
N_ENTITIES, N_ENTITIES,
sizeof(*element), sizeof(*element),
compare_entities); compare_entities);
@ -1585,7 +1585,7 @@ get_cp_index(const char *name)
#endif #endif
} }
codepage = fastfind_search(&ff_charsets_index, name, strlen(name)); codepage = (const struct codepage_desc *)fastfind_search(&ff_charsets_index, name, strlen(name));
if (codepage) { if (codepage) {
assert(codepages <= codepage && codepage < codepages + N_CODEPAGES); assert(codepages <= codepage && codepage < codepages + N_CODEPAGES);
return (codepage - codepages) | syscp; return (codepage - codepages) | syscp;

View File

@ -130,7 +130,7 @@ get_event_id(const char *name)
namelen = strlen(name); namelen = strlen(name);
item = get_hash_item(event_hash, name, namelen); item = get_hash_item(event_hash, name, namelen);
if (item) { if (item) {
struct event *event = item->value; struct event *event = (struct event *)item->value;
assertm(event != NULL, "Hash item with no value"); assertm(event != NULL, "Hash item with no value");
if_assert_failed return EVENT_NONE; if_assert_failed return EVENT_NONE;

View File

@ -167,7 +167,7 @@ void
check_bottom_halves(void) check_bottom_halves(void)
{ {
while (!list_empty(bottom_halves)) { while (!list_empty(bottom_halves)) {
struct bottom_half *bh = bottom_halves.prev; struct bottom_half *bh = (struct bottom_half *)bottom_halves.prev;
select_handler_T fn = bh->fn; select_handler_T fn = bh->fn;
void *data = bh->data; void *data = bh->data;
@ -377,7 +377,7 @@ get_handler(int fd, enum select_handler_type tp)
case SELECT_HANDLER_READ: return threads[fd].read_func; case SELECT_HANDLER_READ: return threads[fd].read_func;
case SELECT_HANDLER_WRITE: return threads[fd].write_func; case SELECT_HANDLER_WRITE: return threads[fd].write_func;
case SELECT_HANDLER_ERROR: return threads[fd].error_func; case SELECT_HANDLER_ERROR: return threads[fd].error_func;
case SELECT_HANDLER_DATA: return threads[fd].data; case SELECT_HANDLER_DATA: return (select_handler_T)threads[fd].data;
} }
INTERNAL("get_handler: bad type %d", tp); INTERNAL("get_handler: bad type %d", tp);

View File

@ -100,7 +100,7 @@ check_timers(timeval_T *last_time)
} }
while (!list_empty(timers)) { while (!list_empty(timers)) {
timer = timers.next; timer = (struct timer *)timers.next;
if (timeval_is_positive(&timer->interval)) if (timeval_is_positive(&timer->interval))
break; break;