From b852079631cdcf0c86cdae4cc3674eda12bfa727 Mon Sep 17 00:00:00 2001 From: vraatikka Date: Mon, 5 Aug 2013 17:47:21 +0300 Subject: [PATCH] Enabled debug assertions for DEBUG=Y builds. Fixed one debug assertion in log manager. --- log_manager/log_manager.cc | 4 ++-- utils/skygw_debug.h | 10 +++------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/log_manager/log_manager.cc b/log_manager/log_manager.cc index b3b484601..078d8b785 100644 --- a/log_manager/log_manager.cc +++ b/log_manager/log_manager.cc @@ -774,7 +774,7 @@ static char* blockbuf_get_writepos( ss_dassert(pos == NULL); ss_dassert(!(bb->bb_isfull || bb->bb_buf_left < str_len)); - ss_dassert(bb_list->mlist_nodecount <= nodecount_max); + ss_dassert(bb_list->mlist_nodecount <= bb_list->mlist_nodecount_max); /** * Registration to blockbuf adds reference for the write operation. @@ -816,7 +816,7 @@ static char* blockbuf_get_writepos( /** Unlock buffer */ simple_mutex_unlock(&bb->bb_mutex); - ss_dassert(bb_list->mlist_mutex->sm_lock_thr != pthread_self()); + ss_dassert(bb_list->mlist_mutex.sm_lock_thr != pthread_self()); return pos; } diff --git a/utils/skygw_debug.h b/utils/skygw_debug.h index 87d30c707..6bb0df780 100644 --- a/utils/skygw_debug.h +++ b/utils/skygw_debug.h @@ -47,15 +47,13 @@ # define ss_prof(exp) #endif /* SS_DEBUG || SS_PROF */ -#if defined(EI_SS_DEBUG) +#if defined(SS_DEBUG) + # define ss_debug(exp) exp # define ss_dfprintf fprintf # define ss_dfflush fflush # define ss_dfwrite fwrite -# undef ss_dassert -# undef ss_info_dassert -#if !defined(ss_dassert) # define ss_dassert(exp) \ { \ if (!(exp)) { \ @@ -67,9 +65,8 @@ assert(exp); \ } \ } -#endif /* !defined(ss_dassert) */ -#if !defined(ss_info_dassert) + # define ss_info_dassert(exp, info) \ { \ if (!(exp)) { \ @@ -81,7 +78,6 @@ assert((exp)); \ } \ } -#endif /* !defined(ss_info_dassert) */ #else /* SS_DEBUG */