diff --git a/src/adc/message.c b/src/adc/message.c index 2d91c07..f2b2e64 100644 --- a/src/adc/message.c +++ b/src/adc/message.c @@ -127,7 +127,7 @@ static int adc_msg_cache_append(struct adc_message* msg, const char* string, siz memcpy(&msg->cache[msg->length], string, len); adc_msg_set_length(msg, msg->length + len); - assert(msg->capacity > msg->length); + uhub_assert(msg->capacity > msg->length); msg->cache[msg->length] = 0; return 1; } diff --git a/src/core/commands.c b/src/core/commands.c index b764186..fb3256c 100644 --- a/src/core/commands.c +++ b/src/core/commands.c @@ -60,7 +60,7 @@ struct command_base* command_initialize(struct hub_info* hub) void command_shutdown(struct command_base* cbase) { commands_builtin_remove(cbase); - assert(list_size(cbase->handlers) == 0); + uhub_assert(list_size(cbase->handlers) == 0); list_destroy(cbase->handlers); hub_free(cbase); } diff --git a/src/core/eventqueue.c b/src/core/eventqueue.c index 9359b97..5215f9c 100644 --- a/src/core/eventqueue.c +++ b/src/core/eventqueue.c @@ -88,7 +88,7 @@ int event_queue_process(struct event_queue* queue) } list_clear(queue->q1, event_queue_cleanup_callback); - assert(list_size(queue->q1) == 0); + uhub_assert(list_size(queue->q1) == 0); /* unlock queue */ queue->locked = 0; diff --git a/src/core/hub.c b/src/core/hub.c index e817bf2..11f2f14 100644 --- a/src/core/hub.c +++ b/src/core/hub.c @@ -524,7 +524,7 @@ static void hub_event_dispatcher(void* callback_data, struct event_data* message int status; struct hub_info* hub = (struct hub_info*) callback_data; struct hub_user* user = (struct hub_user*) message->ptr; - assert(hub != NULL); + uhub_assert(hub != NULL); switch (message->id) { diff --git a/src/core/hubio.c b/src/core/hubio.c index e0a0dbe..1fc4644 100644 --- a/src/core/hubio.c +++ b/src/core/hubio.c @@ -52,7 +52,7 @@ void hub_recvq_destroy(struct hub_recvq* q) size_t hub_recvq_get(struct hub_recvq* q, void* buf, size_t bufsize) { - assert(bufsize >= q->size); + uhub_assert(bufsize >= q->size); if (q->size) { size_t n = q->size; @@ -126,7 +126,7 @@ void hub_sendq_add(struct hub_sendq* q, struct adc_message* msg_) #ifdef DEBUG_SENDQ debug_msg("hub_sendq_add", msg); #endif - assert(msg->cache && *msg->cache); + uhub_assert(msg->cache && *msg->cache); list_append(q->queue, msg); q->size += msg->length; } @@ -147,7 +147,7 @@ int hub_sendq_send(struct hub_sendq* q, struct hub_user* user) int ret; struct adc_message* msg = list_get_first(q->queue); if (!msg) return 0; - assert(msg->cache && *msg->cache); + uhub_assert(msg->cache && *msg->cache); ret = net_con_send(user->connection, msg->cache + q->offset, msg->length - q->offset); if (ret > 0) diff --git a/src/core/pluginloader.c b/src/core/pluginloader.c index 107400a..4c117ba 100644 --- a/src/core/pluginloader.c +++ b/src/core/pluginloader.c @@ -26,7 +26,7 @@ struct plugin_callback_data; struct plugin_hub_internals* get_internals(struct plugin_handle* handle) { struct plugin_hub_internals* internals; - assert(handle && handle->handle && handle->handle->internals); + uhub_assert(handle && handle->handle && handle->handle->internals); internals = (struct plugin_hub_internals*) handle->handle->internals; return internals; } diff --git a/src/core/route.c b/src/core/route.c index 6901025..8fd94eb 100644 --- a/src/core/route.c +++ b/src/core/route.c @@ -106,7 +106,7 @@ int route_to_user(struct hub_info* hub, struct hub_user* user, struct adc_messag if (!user->connection) return 0; - assert(msg->cache && *msg->cache); + uhub_assert(msg->cache && *msg->cache); if (hub_sendq_is_empty(user->send_queue) && !user_flag_get(user, flag_pipeline)) { diff --git a/src/core/usermanager.c b/src/core/usermanager.c index ea77279..452eff4 100644 --- a/src/core/usermanager.c +++ b/src/core/usermanager.c @@ -162,7 +162,7 @@ int uman_remove(struct hub_info* hub, struct hub_user* user) } else { - assert(!"negative count!"); + uhub_assert(!"negative count!"); } hub->users->shared_size -= user->limits.shared_size; diff --git a/src/plugins/mod_chat_history.c b/src/plugins/mod_chat_history.c index 7cfe72e..43ab016 100644 --- a/src/plugins/mod_chat_history.c +++ b/src/plugins/mod_chat_history.c @@ -160,7 +160,7 @@ static struct chat_history_data* parse_config(const char* line, struct plugin_ha struct cfg_tokens* tokens = cfg_tokenize(line); char* token = cfg_token_get_first(tokens); - assert(data != NULL); + uhub_assert(data != NULL); data->history_max = 200; data->history_default = 25; diff --git a/src/util/cbuffer.c b/src/util/cbuffer.c index 5b73cfe..a0ac239 100644 --- a/src/util/cbuffer.c +++ b/src/util/cbuffer.c @@ -112,4 +112,4 @@ const char* cbuf_get(struct cbuffer* buf) size_t cbuf_size(struct cbuffer* buf) { return buf->size; -} \ No newline at end of file +} diff --git a/src/util/list.c b/src/util/list.c index 9e9dd23..4f5253e 100644 --- a/src/util/list.c +++ b/src/util/list.c @@ -84,7 +84,7 @@ void list_append(struct linked_list* list, void* data_ptr) void list_remove(struct linked_list* list, void* data_ptr) { struct node* node = list->first; - assert(data_ptr); + uhub_assert(data_ptr); list->iterator = NULL;