Commit: 22912545cce55852d3815b6e5accadcfcedb4ec2
Parent: 130c24d8d85968b220b67bba964672476c0f7fd7
Author: opask
Date: Sun, 5 Aug 2018 19:54:45 -0600
silence some warnings
Diffstat:
8 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/html.c b/html.c
@@ -2145,7 +2145,7 @@ static void menu_labels(struct menu_item *m, unsigned char *base, unsigned char
}
} else {
if ((bs = stracpy(m->hotkey[1] ? (unsigned char *)"" : base))) add_to_strn(&bs, m->text);
- lbls[(int)m->data] = bs;
+ lbls[(int)(long)m->data] = bs;
}
}
}
@@ -2153,7 +2153,7 @@ static void menu_labels(struct menu_item *m, unsigned char *base, unsigned char
static int menu_contains(struct menu_item *m, int f)
{
if (m->func != do_select_submenu)
- return (int)m->data == f;
+ return (int)(long)m->data == f;
for (m = m->data; m->text; m++)
if (menu_contains(m, f))
return 1;
diff --git a/html_gr.c b/html_gr.c
@@ -684,7 +684,7 @@ static void *g_html_special(void *p_, int c, ...)
return convert_table;
case SP_USED:
va_end(l);
- return (void *)!!p->data;
+ return (void *)(long)!!p->data;
case SP_FRAMESET:
fsp = va_arg(l, struct frameset_param *);
va_end(l);
diff --git a/html_r.c b/html_r.c
@@ -968,7 +968,7 @@ static void *html_special(void *p_, int c, ...)
return convert_table;
case SP_USED:
va_end(l);
- return (void *)!!p->data;
+ return (void *)(long)!!p->data;
case SP_FRAMESET:
fsp = va_arg(l, struct frameset_param *);
va_end(l);
diff --git a/menu.c b/menu.c
@@ -447,7 +447,7 @@ static void flush_caches(struct terminal *term, void *d, void *e)
void go_backwards(struct terminal *term, void *id_ptr, void *ses_)
{
struct session *ses = (struct session *)ses_;
- unsigned want_id = (unsigned)id_ptr;
+ unsigned want_id = (int)(long)id_ptr;
struct location *l;
struct list_head *ll;
int n = 0;
@@ -482,7 +482,7 @@ static void add_history_menu_entry(struct terminal *term, struct menu_item **mi,
*mi = new_menu(3);
url = display_url(term, l->url, 1);
add_to_menu(mi, url, cast_uchar "", cast_uchar "", go_backwards,
- (void *)(int)l->location_id, 0, *n);
+ (void *)(long)l->location_id, 0, *n);
(*n)++;
if (*n == MAXINT)
overalloc();
@@ -560,7 +560,7 @@ static void menu_toggle(struct terminal *term, void *ddd, void *ses_)
static void set_display_codepage(struct terminal *term, void *pcp, void *ptr)
{
- int cp = (int)pcp;
+ int cp = (int)(long)pcp;
struct term_spec *t = new_term_spec(term->term);
t->character_set = cp;
cls_redraw_all_terminals();
@@ -568,7 +568,7 @@ static void set_display_codepage(struct terminal *term, void *pcp, void *ptr)
static void set_val(struct terminal *term, void *ip, void *d)
{
- *(int *)d = (int)ip;
+ *(int *)d = (int)(long)ip;
}
static void charset_sel_list(struct terminal *term, int ini, void (*set)(struct terminal *term, void *ip, void *ptr), void *ptr, int utf, int def)
@@ -592,7 +592,7 @@ static void charset_sel_list(struct terminal *term, int ini, void (*set)(struct
n = get_cp_name(i);
r = stracpy(cast_uchar "");
}
- add_to_menu(&mi, n, r, cast_uchar "", set, (void *)i, 0, i + def);
+ add_to_menu(&mi, n, r, cast_uchar "", set, &i, 0, i + def);
}
ini += def;
if (ini < 0)
diff --git a/select.c b/select.c
@@ -618,7 +618,7 @@ void clear_events(int h, int blocking)
static void clear_events_ptr(void *handle)
{
- clear_events((int)handle, 0);
+ clear_events((int)(long)handle, 0);
}
@@ -829,7 +829,7 @@ void select_loop(void (*init)(void))
}
set_nonblock(signal_pipe[0]);
set_nonblock(signal_pipe[1]);
- set_handlers(signal_pipe[0], clear_events_ptr, NULL, (void *)signal_pipe[0]);
+ set_handlers(signal_pipe[0], clear_events_ptr, NULL, signal_pipe);
#endif
init();
CHK_BH;
diff --git a/session.c b/session.c
@@ -2932,7 +2932,7 @@ void win_func(struct window *win, struct links_event *ev, int fw)
break;
case EV_INIT:
ses = win->data = create_session(win);
- if (read_session_info(ses, (char *)ev->b + sizeof(int), *(int *)ev->b)) {
+ if (read_session_info(ses, (char *)(ev->b + sizeof(int)), ev->b)) {
register_bottom_half(destroy_terminal, win->term);
return;
}
diff --git a/terminal.c b/terminal.c
@@ -837,7 +837,7 @@ static void in_term(void *term_)
term->cwd[MAX_CWD_LEN - 1] = 0;
term->environment = *(int *)(iq + sizeof(struct links_event) + MAX_TERM_LEN + MAX_CWD_LEN);
term->default_character_set = *(int *)(iq + sizeof(struct links_event) + MAX_TERM_LEN + MAX_CWD_LEN + sizeof(int));
- ev->b = (int)(iq + sizeof(struct links_event) + MAX_TERM_LEN + MAX_CWD_LEN + 2 * sizeof(int));
+ ev->b = (int)(*iq + sizeof(struct links_event) + MAX_TERM_LEN + MAX_CWD_LEN + 2 * sizeof(int));
r = (int)sizeof(struct links_event) + MAX_TERM_LEN + MAX_CWD_LEN + 3 * (int)sizeof(int) + init_len;
sync_term_specs();
}
@@ -1304,7 +1304,7 @@ void exec_thread(void *path_, int p)
void close_handle(void *p)
{
- int h = (int)p;
+ int h = (int)(long)p;
close_socket(&h);
}
diff --git a/view.c b/view.c
@@ -1963,7 +1963,7 @@ void toggle(struct session *ses, struct f_data_c *f, int a)
void selected_item(struct terminal *term, void *pitem, void *ses_)
{
struct session *ses = (struct session *)ses_;
- int item = (int)pitem;
+ int item = (int)(long)pitem;
struct f_data_c *f = current_frame(ses);
struct link *l;
struct form_state *fs;
@@ -2868,7 +2868,7 @@ void send_event(struct session *ses, struct links_event *ev)
goto x;
}
if ((upcase(ev->x) == 'Q' && !(ev->y & (KBD_CTRL | KBD_ALT))) || ev->x == KBD_CTRL_C) {
- exit_prog(ses->term, (int *)(ev->x == KBD_CTRL_C || ev->x == 'Q'), ses);
+ exit_prog(ses->term, (int *)(long)(ev->x == KBD_CTRL_C || ev->x == 'Q'), ses);
goto x;
}
if (ev->x == KBD_CLOSE) {