Minor cleanup of debugging output.

This commit is contained in:
Jonathan Moore Liles 2008-02-12 12:08:17 -06:00
parent fe8fab22df
commit 58c2dad706
4 changed files with 9 additions and 35 deletions

View File

@ -10,9 +10,9 @@ DOCUMENT_PATH=$(PREFIX)/share/doc/non-sequencer/
USE_LASH=1
# Debugging
CFLAGS:=-O0 -ggdb -fno-omit-frame-pointer -Wall
# CFLAGS:=-O0 -ggdb -fno-omit-frame-pointer -Wall
# Production
# CFLAGS:=-O3 -fomit-frame-pointer -DNDEBUG
CFLAGS:=-O3 -fomit-frame-pointer -DNDEBUG
CFLAGS+=-DINSTALL_PREFIX=\"$(PREFIX)\" \
-DSYSTEM_PATH=\"$(SYSTEM_PATH)\" \

View File

@ -100,16 +100,15 @@ warnf ( warning_t level,
#ifndef NDEBUG
#define DEBUG( fmt, args... ) warnf( W_MESSAGE, __MODULE__, __FILE__, __FUNCTION__, __LINE__, fmt, ## args )
#define ASSERTION( fmt, args... ) ( warnf( W_ASSERTION, __MODULE__, __FILE__, __FUNCTION__, __LINE__, fmt, ## args ), abort() )
#define ASSERT( pred, fmt, args... ) ( do { if ( ! (pred) ) warnf( W_ASSERTION, __MODULE__, __FILE__, __FUNCTION__, __LINE__, fmd, ## args ); abort(); } while ( 0 ) )
#else
#define DEBUG( fmt, args... )
#define ASSERTION( fmt, args... )
#define ASSERT( pred, fmt, args... )
#endif
/* this one's always defined */
/* these are always defined */
#define MESSAGE( fmt, args... ) warnf( W_MESSAGE, __MODULE__, __FILE__, __FUNCTION__, __LINE__, fmt, ## args )
#define WARNING( fmt, args... ) warnf( W_WARNING, __MODULE__, __FILE__, __FUNCTION__, __LINE__, fmt, ## args )
#define ASSERTION( fmt, args... ) ( warnf( W_ASSERTION, __MODULE__, __FILE__, __FUNCTION__, __LINE__, fmt, ## args ), abort() )
#endif

29
grid.C
View File

@ -25,9 +25,6 @@
#include "smf.H"
#define RD ( _locked ? ASSERTION( "invalid read" ) : _rd )
#define WR ( ! locked ? ASSERTION( "invalid write" ) : _wr )
Grid::Grid ( void )
{
_name = NULL;
@ -98,26 +95,6 @@ Grid::Grid ( const Grid &rhs )
viewport = rhs.viewport;
}
#if 0
const data *
Grid::rd ( void )
{
if ( _locked )
ASSERTION( "invalid read" );
return _rd;
}
data *
Grid::wr ( void )
{
if ( ! _locked )
ASSERTION( "invalid write" );
return _rw;
}
#endif
void
Grid::lock ( void )
{
@ -136,9 +113,6 @@ Grid::unlock ( void )
{
data *d = _history.front();
if ( d == _rw || d == _rd )
ASSERTION( "something bad has happend." );
delete d;
_history.pop_front();
@ -662,8 +636,7 @@ Grid::draw ( Canvas *c, int bx, int by, int bw, int bh )
tick_t ts = e->timestamp();
if ( ! e->link() )
ASSERTION( "wtf. note is not linked!" );
ASSERT( e->link(), "found a non-linked note" );
tick_t tse = e->link()->timestamp();

2
lash.C
View File

@ -40,6 +40,8 @@ Lash::Lash ( )
bool
Lash::init ( int *argc, char ***argv )
{
MESSAGE( "Initializing LASH" );
if ( ! ( _client = lash_init( lash_extract_args( argc, argv ), APP_NAME,
LASH_Config_File, LASH_PROTOCOL( 2, 0 ) ) ) )
return false;