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,16 +10,16 @@ DOCUMENT_PATH=$(PREFIX)/share/doc/non-sequencer/
USE_LASH=1 USE_LASH=1
# Debugging # Debugging
CFLAGS:=-O0 -ggdb -fno-omit-frame-pointer -Wall # CFLAGS:=-O0 -ggdb -fno-omit-frame-pointer -Wall
# Production # Production
# CFLAGS:=-O3 -fomit-frame-pointer -DNDEBUG CFLAGS:=-O3 -fomit-frame-pointer -DNDEBUG
CFLAGS+=-DINSTALL_PREFIX=\"$(PREFIX)\" \ CFLAGS+=-DINSTALL_PREFIX=\"$(PREFIX)\" \
-DSYSTEM_PATH=\"$(SYSTEM_PATH)\" \ -DSYSTEM_PATH=\"$(SYSTEM_PATH)\" \
-DDOCUMENT_PATH=\"$(DOCUMENT_PATH)\" -DDOCUMENT_PATH=\"$(DOCUMENT_PATH)\"
CXXFLAGS:=$(CFLAGS) -fno-exceptions -fno-rtti `fltk-config --cxxflags` `pkg-config jack --atleast-version 0.105 || echo -DJACK_MIDI_PROTO_API` `pkg-config jack --cflags` `pkg-config --cflags sigc++-2.0` CXXFLAGS:=$(CFLAGS) -fno-exceptions -fno-rtti `fltk-config --cxxflags` `pkg-config jack --atleast-version 0.105 || echo -DJACK_MIDI_PROTO_API` `pkg-config jack --cflags` `pkg-config --cflags sigc++-2.0`
LIBS=`pkg-config --libs jack` `fltk-config --use-images --ldflags` `pkg-config --libs sigc++-2.0` LIBS=`pkg-config --libs jack` `fltk-config --use-images --ldflags` `pkg-config --libs sigc++-2.0`
ifeq ($(USE_LASH),1) ifeq ($(USE_LASH),1)
LIBS+=-llash LIBS+=-llash
@ -53,7 +53,7 @@ SRCS= \
OBJS=$(SRCS:.C=.o) OBJS=$(SRCS:.C=.o)
.PHONEY: all clean install .PHONEY: all clean install
all: non makedepend all: non makedepend

View File

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

29
grid.C
View File

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

2
lash.C
View File

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