1
0
mirror of https://github.com/irssi/irssi.git synced 2024-11-03 04:27:19 -05:00

Cast pointers to IVs instead of using GPOINTER_TO_INT() which casts them to

ints. Hopefully fixes 64bit architectures.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2978 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2002-10-28 01:49:14 +00:00 committed by cras
parent 39fc0f5ea1
commit c764853132
2 changed files with 5 additions and 5 deletions

View File

@ -106,13 +106,13 @@ SV *irssi_bless_iobject(int type, int chat_type, void *object)
GINT_TO_POINTER(type | (chat_type << 16))); GINT_TO_POINTER(type | (chat_type << 16)));
if (rec == NULL) { if (rec == NULL) {
/* unknown iobject */ /* unknown iobject */
return newSViv(GPOINTER_TO_INT(object)); return newSViv((IV)object);
} }
stash = gv_stashpv(rec->stash, 1); stash = gv_stashpv(rec->stash, 1);
hv = newHV(); hv = newHV();
hv_store(hv, "_irssi", 6, newSViv(GPOINTER_TO_INT(object)), 0); hv_store(hv, "_irssi", 6, newSViv((IV)object), 0);
rec->fill_func(hv, object); rec->fill_func(hv, object);
return sv_bless(newRV_noinc((SV*)hv), stash); return sv_bless(newRV_noinc((SV*)hv), stash);
} }
@ -125,7 +125,7 @@ SV *irssi_bless_plain(const char *stash, void *object)
fill_func = g_hash_table_lookup(plain_stashes, stash); fill_func = g_hash_table_lookup(plain_stashes, stash);
hv = newHV(); hv = newHV();
hv_store(hv, "_irssi", 6, newSViv(GPOINTER_TO_INT(object)), 0); hv_store(hv, "_irssi", 6, newSViv((IV)object), 0);
if (fill_func != NULL) if (fill_func != NULL)
fill_func(hv, object); fill_func(hv, object);
return sv_bless(newRV_noinc((SV*)hv), gv_stashpv((char *)stash, 1)); return sv_bless(newRV_noinc((SV*)hv), gv_stashpv((char *)stash, 1));
@ -298,7 +298,7 @@ void perl_server_fill_hash(HV *hv, SERVER_REC *server)
hv_store(hv, "connection_lost", 15, newSViv(server->connection_lost), 0); hv_store(hv, "connection_lost", 15, newSViv(server->connection_lost), 0);
stash = gv_stashpv("Irssi::Rawlog", 0); stash = gv_stashpv("Irssi::Rawlog", 0);
hv_store(hv, "rawlog", 6, sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(server->rawlog))), stash), 0); hv_store(hv, "rawlog", 6, sv_bless(newRV_noinc(newSViv((IV)server->rawlog)), stash), 0);
hv_store(hv, "version", 7, new_pv(server->version), 0); hv_store(hv, "version", 7, new_pv(server->version), 0);
hv_store(hv, "away_reason", 11, new_pv(server->away_reason), 0); hv_store(hv, "away_reason", 11, new_pv(server->away_reason), 0);

View File

@ -97,7 +97,7 @@ static void perl_call_signal(PERL_SCRIPT_REC *script, SV *func,
if (strcmp(rec->args[n], "string") == 0) if (strcmp(rec->args[n], "string") == 0)
perlarg = new_pv(arg); perlarg = new_pv(arg);
else if (strcmp(rec->args[n], "int") == 0) else if (strcmp(rec->args[n], "int") == 0)
perlarg = newSViv(GPOINTER_TO_INT(arg)); perlarg = newSViv((IV)arg);
else if (strcmp(rec->args[n], "ulongptr") == 0) else if (strcmp(rec->args[n], "ulongptr") == 0)
perlarg = newSViv(*(unsigned long *) arg); perlarg = newSViv(*(unsigned long *) arg);
else if (strcmp(rec->args[n], "intptr") == 0) else if (strcmp(rec->args[n], "intptr") == 0)