From b4bdec4436190d7ccb6252be388b5ee70c5c36f5 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Wed, 30 Aug 2000 22:29:55 +0000 Subject: Object type checking fixes git-svn-id: http://svn.irssi.org/repos/irssi/trunk@638 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/core/chatnets.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/core/chatnets.h') diff --git a/src/core/chatnets.h b/src/core/chatnets.h index 724421cf..7170c478 100644 --- a/src/core/chatnets.h +++ b/src/core/chatnets.h @@ -3,13 +3,12 @@ #include "modules.h" -#define IS_CHATNET(chatnet) \ - ((chatnet) != NULL && \ - module_find_id("CHATNET", (chatnet)->type) != -1) - /* Returns CHATNET_REC if it's chatnet, NULL if it isn't. */ #define CHATNET(chatnet) \ - (IS_CHATNET(chatnet) ? (CHATNET_REC *) (chatnet) : NULL) + MODULE_CHECK_CAST(chatnet, CHATNET_REC, type, "CHATNET") + +#define IS_CHATNET(chatnet) \ + (CHATNET(chatnet) ? TRUE : FALSE) typedef struct { #include "chatnet-rec.h" -- cgit v1.2.3