use intptr_t where needed. pvalchev@ actually noticed this and provided

diffs but unfortunately they got lost in a hd crash.
pvalchev@ ok.
This commit is contained in:
fgsch 2002-09-16 04:11:23 +00:00
parent f7e071b2f2
commit 0d6cd66bb3
11 changed files with 279 additions and 10 deletions

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-cookies_c,v 1.1 2002/09/16 04:11:23 fgsch Exp $
--- cookies.c.orig Sun Sep 15 08:51:52 2002
+++ cookies.c Sun Sep 15 08:52:03 2002
@@ -177,7 +177,7 @@ void delete_cookie(struct cookie *c)
struct cookie *find_cookie_id(void *idp)
{
- int id = (int)idp;
+ int id = (intptr_t)idp;
struct cookie *c;
foreach(c, cookies) if (c->id == id) return c;
return NULL;

View File

@ -1,11 +1,29 @@
$OpenBSD: patch-html_c,v 1.1 2002/08/05 23:32:24 fgsch Exp $
--- html.c.orig Mon Aug 5 19:25:52 2002
+++ html.c Mon Aug 5 19:26:12 2002
@@ -772,6 +772,7 @@ void html_a(unsigned char *a)
format.target = stracpy(format.target_base);
$OpenBSD: patch-html_c,v 1.2 2002/09/16 04:11:23 fgsch Exp $
--- html.c.orig Sun Sep 15 10:07:09 2002
+++ html.c Sun Sep 15 10:12:38 2002
@@ -1637,7 +1637,7 @@ void new_menu_item(unsigned char *name,
item->rtext = data == -1 ? ">" : "";
item->hotkey = fullname ? "\000\001" : "\000\000"; /* dirty */
item->func = data == -1 ? MENU_FUNC do_select_submenu : MENU_FUNC selected_item;
- item->data = data == -1 ? nmenu : (void *)data;
+ item->data = data == -1 ? nmenu : (void *)(intptr_t)data;
item->in_m = data == -1 ? 1 : 0;
item->free_i = 0;
item++;
@@ -1697,14 +1697,14 @@ void menu_labels(struct menu_item *m, un
}
} else {
if ((bs = stracpy(m->hotkey[1] ? (unsigned char *)"" : base))) add_to_strn(&bs, m->text);
- lbls[(int)m->data] = bs;
+ lbls[(intptr_t)m->data] = bs;
}
/*format.attr ^= AT_BOLD;*/
+ format.attr |= AT_UNDERLINE;
memcpy(&format.fg, &format.clink, sizeof(struct rgb));
} else if (!ev) kill_html_stack_item(&html_top);
if ((al = get_attr_val(a, "name"))) {
}
}
int menu_contains(struct menu_item *m, int f)
{
- if (m->func != MENU_FUNC do_select_submenu) return (int)m->data == f;
+ if (m->func != MENU_FUNC do_select_submenu) return (intptr_t)m->data == f;
for (m = m->data; m->text; m++) if (menu_contains(m, f)) return 1;
return 0;
}

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-html_gr_c,v 1.1 2002/09/16 04:11:23 fgsch Exp $
--- html_gr.c.orig Sun Sep 15 10:29:25 2002
+++ html_gr.c Sun Sep 15 10:30:11 2002
@@ -606,7 +606,7 @@ void *g_html_special(struct g_part *p, i
return convert_table;
case SP_USED:
va_end(l);
- return (void *)!!p->data;
+ return (void *)(intptr_t)!!p->data;
case SP_FRAMESET:
fsp = va_arg(l, struct frameset_param *);
va_end(l);

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-html_r_c,v 1.1 2002/09/16 04:11:23 fgsch Exp $
--- html_r.c.orig Sun Sep 15 10:29:21 2002
+++ html_r.c Sun Sep 15 10:29:53 2002
@@ -904,7 +904,7 @@ void *html_special(struct part *p, int c
case SP_TABLE:
return convert_table;
case SP_USED:
- return (void *)!!p->data;
+ return (void *)(intptr_t)!!p->data;
case SP_FRAMESET:
fsp = va_arg(l, struct frameset_param *);
va_end(l);

View File

@ -0,0 +1,41 @@
$OpenBSD: patch-ipret_c,v 1.1 2002/09/16 04:11:23 fgsch Exp $
--- ipret.c.orig Sun Sep 15 10:26:23 2002
+++ ipret.c Sun Sep 15 10:27:56 2002
@@ -3218,22 +3218,22 @@ void for3(js_context*context)
*/
debug("For3 vracim identifier\n");
if(!context->current->arg[6])
-nebo_skrtnem_sirkou: while(!context->current->arg[6] && ((int)context->current->arg[5])<HASHNUM)
+nebo_skrtnem_sirkou: while(!context->current->arg[6] && ((intptr_t)context->current->arg[5])<HASHNUM)
{
- context->current->arg[6]=((plns*)((lns*)context->current->arg[3])->value)->ns[(int)context->current->arg[5]];
+ context->current->arg[6]=((plns*)((lns*)context->current->arg[3])->value)->ns[(intptr_t)context->current->arg[5]];
/* co tim chtel basnik rict ?? */
/* Basnik: context->ptr->arg[3] je typu lns*, jeho value je plns* a my
koukneme do namespacu pod timto plns (to znamena pointer na localnamespace)
a to konkretne do context->current->arg[5]-te pozice. */
/*(int)context->current->arg[5]=(int)context->current->arg[5]+1;*/
- context->current->arg[5]=(void *)((int)context->current->arg[5]+1);
+ context->current->arg[5]=(void *)((intptr_t)context->current->arg[5]+1);
}
else { context->current->arg[6]=((lns*)context->current->arg[6])->next;
- while(!context->current->arg[6] && ((int)context->current->arg[5])<HASHNUM)
- { context->current->arg[6]=((plns*)((lns*)context->current->arg[3])->value)->ns[(int)context->current->arg[5]];
+ while(!context->current->arg[6] && ((intptr_t)context->current->arg[5])<HASHNUM)
+ { context->current->arg[6]=((plns*)((lns*)context->current->arg[3])->value)->ns[(intptr_t)context->current->arg[5]];
/* co tim chtel basnik rict ?? */
/*(int)context->current->arg[5]=(int)context->current->arg[5]+1;*/
- context->current->arg[5]=(void *)((int)context->current->arg[5]+1);
+ context->current->arg[5]=(void *)((intptr_t)context->current->arg[5]+1);
}
}
if(!context->current->arg[6])
@@ -3258,7 +3258,7 @@ nebo_skrtnem_sirkou: while(!context->cu
{ context->current->arg[6]=((lns*)context->current->arg[6])->next;
goto nebo_skrtnem_sirkou;
}
- pna=context->namespace[((int)context->current->arg[5])-1];
+ pna=context->namespace[((intptr_t)context->current->arg[5])-1];
while(pna && (pna->klic!=((lns*)context->current->arg[6])->identifier/HASHNUM))pna=pna->next;
if(!pna){ my_internal("Kalim mimo misu!\n",context);
retval=js_mem_alloc(sizeof(abuf));

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-jsint_c,v 1.1 2002/09/16 04:11:23 fgsch Exp $
--- jsint.c.orig Sat Jun 29 16:27:04 2002
+++ jsint.c Sun Sep 15 10:15:29 2002
@@ -2744,7 +2744,7 @@ static void __js_upcall_goto_history_ok_
if (a<jsid->n&&(fd->js)&&jsid->js_id==fd->js->ctx->js_id){js_downcall_vezmi_null(fd->js->ctx);return;} /* call downcall */
- go_backwards(fd->ses->term,(void*)(jsid->n),fd->ses);
+ go_backwards(fd->ses->term,(void*)(intptr_t)(jsid->n),fd->ses);
}

View File

@ -0,0 +1,16 @@
$OpenBSD: patch-kbd_c,v 1.1 2002/09/16 04:11:23 fgsch Exp $
--- kbd.c.orig Sun Sep 15 09:46:19 2002
+++ kbd.c Sun Sep 15 09:46:37 2002
@@ -384,10 +384,10 @@ void in_sock(struct itrm *itrm)
}
mem_free(param);
if (fg == 1) {
- set_handlers(blockh, (void (*)(void *))unblock_itrm_x, NULL, (void (*)(void *))unblock_itrm_x, (void *)blockh);
+ set_handlers(blockh, (void (*)(void *))unblock_itrm_x, NULL, (void (*)(void *))unblock_itrm_x, (void *)(intptr_t)blockh);
/*block_itrm(itrm->ctl_in);*/
} else {
- set_handlers(blockh, close_handle, NULL, close_handle, (void *)blockh);
+ set_handlers(blockh, close_handle, NULL, close_handle, (void *)(intptr_t)blockh);
}
}
to_je_ale_hnus:

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-links_h,v 1.1 2002/09/16 04:11:23 fgsch Exp $
--- links.h.orig Sun Sep 15 09:22:27 2002
+++ links.h Sun Sep 15 09:22:44 2002
@@ -136,6 +136,8 @@ x #endif*/
#define longlong long
#endif
+#include <inttypes.h>
+
#include <termios.h>
#include "os_depx.h"

View File

@ -0,0 +1,84 @@
$OpenBSD: patch-menu_c,v 1.1 2002/09/16 04:11:23 fgsch Exp $
--- menu.c.orig Sun Sep 15 10:16:34 2002
+++ menu.c Sun Sep 15 10:19:02 2002
@@ -324,7 +324,7 @@ void flush_caches(struct terminal *term,
/* jde v historii o psteps polozek dozadu */
void go_backwards(struct terminal *term, void *psteps, struct session *ses)
{
- int steps = (int) psteps;
+ int steps = (intptr_t) psteps;
/*if (ses->tq_goto_position)
--steps;
@@ -358,7 +358,7 @@ void history_menu(struct terminal *term,
foreach(l, ses->history) {
if (n/* || ses->tq_goto_position*/) {
if (!mi && !(mi = new_menu(3))) return;
- add_to_menu(&mi, stracpy(l->url), "", "", MENU_FUNC go_backwards, (void *) n, 0);
+ add_to_menu(&mi, stracpy(l->url), "", "", MENU_FUNC go_backwards, (void *)(intptr_t) n, 0);
}
n++;
}
@@ -400,7 +400,7 @@ void menu_toggle(struct terminal *term,
void display_codepage(struct terminal *term, void *pcp, struct session *ses)
{
- int cp = (int)pcp;
+ int cp = (intptr_t)pcp;
struct term_spec *t = new_term_spec(term->term);
if (t) t->charset = cp;
cls_redraw_all_terminals();
@@ -408,7 +408,7 @@ void display_codepage(struct terminal *t
void assumed_codepage(struct terminal *term, void *pcp, struct session *ses)
{
- int cp = (int)pcp;
+ int cp = (intptr_t)pcp;
ses->ds.assume_cp = cp;
redraw_terminal_cls(term);
}
@@ -421,7 +421,7 @@ void charset_list(struct terminal *term,
if (!(mi = new_menu(1))) return;
for (i = 0; (n = get_cp_name(i)); i++) {
if (is_cp_special(i)) continue;
- add_to_menu(&mi, get_cp_name(i), "", "", MENU_FUNC display_codepage, (void *)i, 0);
+ add_to_menu(&mi, get_cp_name(i), "", "", MENU_FUNC display_codepage, (void *)(intptr_t)i, 0);
}
sel = ses->term->spec->charset;
if (sel < 0) sel = 0;
@@ -430,7 +430,7 @@ void charset_list(struct terminal *term,
void set_val(struct terminal *term, void *ip, int *d)
{
- *d = (int)ip;
+ *d = (intptr_t)ip;
}
void charset_sel_list(struct terminal *term, struct session *ses, int *ptr)
@@ -440,7 +440,7 @@ void charset_sel_list(struct terminal *t
struct menu_item *mi;
if (!(mi = new_menu(1))) return;
for (i = 0; (n = get_cp_name(i)); i++) {
- add_to_menu(&mi, get_cp_name(i), "", "", MENU_FUNC set_val, (void *)i, 0);
+ add_to_menu(&mi, get_cp_name(i), "", "", MENU_FUNC set_val, (void *)(intptr_t)i, 0);
}
sel = *ptr;
if (sel < 0) sel = 0;
@@ -1729,7 +1729,7 @@ void miscelaneous_options(struct termina
void menu_set_language(struct terminal *term, void *pcp, struct session *ses)
{
- set_language((int)pcp);
+ set_language((intptr_t)pcp);
cls_redraw_all_terminals();
}
@@ -1741,7 +1741,7 @@ void menu_language_list(struct terminal
if (!(mi = new_menu(1))) return;
for (i = 0; i < n_languages(); i++) {
n = language_name(i);
- add_to_menu(&mi, n, "", "", MENU_FUNC menu_set_language, (void *)i, 0);
+ add_to_menu(&mi, n, "", "", MENU_FUNC menu_set_language, (void *)(intptr_t)i, 0);
}
sel = current_language;
do_menu_selected(term, mi, ses, sel);

View File

@ -0,0 +1,29 @@
$OpenBSD: patch-terminal_c,v 1.1 2002/09/16 04:11:23 fgsch Exp $
--- terminal.c.orig Sun Sep 15 09:39:28 2002
+++ terminal.c Sun Sep 15 09:42:14 2002
@@ -1053,14 +1053,14 @@ void exec_thread(unsigned char *path, in
void close_handle(void *p)
{
- int h = (int)p;
+ int h = (intptr_t)p;
close(h);
set_handlers(h, NULL, NULL, NULL, NULL);
}
void unblock_terminal(struct terminal *term)
{
- close_handle((void *)term->blocked);
+ close_handle((void *)(intptr_t)term->blocked);
term->blocked = -1;
if (!F) {
set_handlers(term->fdin, (void (*)(void *))in_term, NULL, (void (*)(void *))destroy_terminal, term);
@@ -1121,7 +1121,7 @@ void exec_on_terminal(struct terminal *t
if (!F) set_handlers(term->fdin, NULL, NULL, (void (*)(void *))destroy_terminal, term);
/*block_itrm(term->fdin);*/
} else {
- set_handlers(blockh, close_handle, NULL, close_handle, (void *)blockh);
+ set_handlers(blockh, close_handle, NULL, close_handle, (void *)(intptr_t)blockh);
}
}
} else {

View File

@ -0,0 +1,21 @@
$OpenBSD: patch-view_c,v 1.1 2002/09/16 04:11:23 fgsch Exp $
--- view.c.orig Sun Sep 15 09:38:18 2002
+++ view.c Sun Sep 15 09:45:13 2002
@@ -1652,7 +1652,7 @@ void back(struct session *ses, struct f_
void selected_item(struct terminal *term, void *pitem, struct session *ses)
{
- int item = (int)pitem;
+ int item = (intptr_t)pitem;
int old_item=item;
struct f_data_c *f = current_frame(ses);
struct link *l;
@@ -2493,7 +2493,7 @@ void send_event(struct session *ses, str
goto x;
}
if ((upcase(ev->x) == 'Q' && !ev->y) || ev->x == KBD_CTRL_C) {
- exit_prog(ses->term, (void *)(ev->x == KBD_CTRL_C), ses);
+ exit_prog(ses->term, (void *)(intptr_t)(ev->x == KBD_CTRL_C), ses);
goto x;
}
if (ev->x == KBD_CLOSE){