Browse Source

Minor cleanup of debugging output.

tags/non-sequencer-v1.9.4
Jonathan Moore Liles 16 years ago
parent
commit
58c2dad706
4 changed files with 9 additions and 35 deletions
  1. +4
    -4
      Makefile
  2. +2
    -3
      debug.h
  3. +1
    -28
      grid.C
  4. +2
    -0
      lash.C

+ 4
- 4
Makefile View File

@@ -10,16 +10,16 @@ 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)\" \
-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`
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)
LIBS+=-llash
@@ -53,7 +53,7 @@ SRCS= \

OBJS=$(SRCS:.C=.o)

.PHONEY: all clean install
.PHONEY: all clean install

all: non makedepend



+ 2
- 3
debug.h 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

+ 1
- 28
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
- 0
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;


Loading…
Cancel
Save