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

Chat protocol ID was assumed to be 8bit or less, this may not be so since

the ID is taken from generic unique ID-pool which grows fast.. Now the we'll
divide the 32bit number to 16bit chat protocol ID and 16bit object ID. They
might not fit either, so I think I'll need to rewrite this part of code some
day :)


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2091 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-11-19 18:46:40 +00:00 committed by cras
parent 381c823e1a
commit 99a6a85b85

View File

@ -80,7 +80,7 @@ SV *irssi_bless_iobject(int type, int chat_type, void *object)
HV *stash, *hv;
rec = g_hash_table_lookup(iobject_stashes,
GINT_TO_POINTER(type | (chat_type << 24)));
GINT_TO_POINTER(type | (chat_type << 16)));
if (rec == NULL) {
/* unknown iobject */
return newSViv(GPOINTER_TO_INT(object));
@ -144,7 +144,7 @@ void irssi_add_object(int type, int chat_type, const char *stash,
PERL_OBJECT_REC *rec;
void *hash;
hash = GINT_TO_POINTER(type | (chat_type << 24));
hash = GINT_TO_POINTER(type | (chat_type << 16));
rec = g_hash_table_lookup(iobject_stashes, hash);
if (rec == NULL) {
rec = g_new(PERL_OBJECT_REC, 1);
@ -550,7 +550,7 @@ static void free_iobject_hash(void *key, PERL_OBJECT_REC *rec)
static int free_iobject_proto(void *key, void *value, void *chat_type)
{
if ((GPOINTER_TO_INT(key) >> 24) == GPOINTER_TO_INT(chat_type)) {
if ((GPOINTER_TO_INT(key) >> 16) == GPOINTER_TO_INT(chat_type)) {
free_iobject_hash(key, value);
return TRUE;
}