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

added a few asserts to make sure we don't mess up if IDs go above 16bit

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2183 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-12-03 17:45:34 +00:00 committed by cras
parent 9f5c181936
commit 544af9942e

View File

@ -79,6 +79,9 @@ SV *irssi_bless_iobject(int type, int chat_type, void *object)
PERL_OBJECT_REC *rec;
HV *stash, *hv;
g_return_val_if_fail((type & ~0xffff) == 0, NULL);
g_return_val_if_fail((chat_type & ~0xffff) == 0, NULL);
rec = g_hash_table_lookup(iobject_stashes,
GINT_TO_POINTER(type | (chat_type << 16)));
if (rec == NULL) {
@ -144,6 +147,9 @@ void irssi_add_object(int type, int chat_type, const char *stash,
PERL_OBJECT_REC *rec;
void *hash;
g_return_if_fail((type & ~0xffff) == 0);
g_return_if_fail((chat_type & ~0xffff) == 0);
hash = GINT_TO_POINTER(type | (chat_type << 16));
rec = g_hash_table_lookup(iobject_stashes, hash);
if (rec == NULL) {