Clean up some compiler warnings

pull/3/head
Jonathan Moore Liles 2012-11-05 23:50:28 -08:00
parent 46d1c9c72a
commit afd354a5b8
22 changed files with 48 additions and 51 deletions

View File

@ -26,7 +26,7 @@
class Fl_Blink_Button : public Fl_Button
{
bool _on;
float _blink_interval;
int _blink_interval;
bool _blinking;
static void
@ -38,7 +38,7 @@ class Fl_Blink_Button : public Fl_Button
void
update_cb ( void )
{
Fl::repeat_timeout( _blink_interval, update_cb, this );
Fl::repeat_timeout( _blink_interval / 1000, update_cb, this );
_on = ! _on;
@ -47,10 +47,13 @@ class Fl_Blink_Button : public Fl_Button
public:
static const float SLOW = 0.5f;
static const float MEDIUM = 0.3f;
static const float FAST = 0.1f;
static const float DEFAULT = 0.5f;
enum
{
SLOW=500,
MEDIUM=300,
FAST=100,
DEFAULT=500
};
Fl_Blink_Button ( int X, int Y, int W, int H, const char *L )
: Fl_Button( X, Y, W, H, L )
@ -85,11 +88,11 @@ public:
void
blink_interval ( float v )
{
_blink_interval = v;
_blink_interval = v * 1000;
if ( value() )
{
Fl::remove_timeout( update_cb, this );
Fl::add_timeout( _blink_interval, update_cb, this );
Fl::add_timeout( _blink_interval / 1000, update_cb, this );
}
}
@ -98,7 +101,7 @@ public:
if ( v )
{
if ( _blinking )
Fl::add_timeout( _blink_interval, update_cb, this );
Fl::add_timeout( _blink_interval / 1000, update_cb, this );
Fl_Button::value( v );
redraw();
}

View File

@ -221,7 +221,7 @@ Chain::set ( Log_Entry &e )
void
Chain::log_children ( void )
Chain::log_children ( void ) const
{
log_create();

View File

@ -122,7 +122,7 @@ public:
Fl_Callback * configure_outputs_callback ( void ) const { return _configure_outputs_callback; }
void log_children ( void );
virtual void log_children ( void ) const;
static unsigned int maximum_name_length ( void );

View File

@ -160,7 +160,7 @@ Mixer_Strip::set ( Log_Entry &e )
}
void
Mixer_Strip::log_children ( void )
Mixer_Strip::log_children ( void ) const
{
log_create();

View File

@ -61,7 +61,7 @@ public:
void chain ( Chain *c );
void log_children ( void );
virtual void log_children ( void ) const;
virtual void color ( Fl_Color c );
virtual Fl_Color color ( void ) const;

View File

@ -380,7 +380,8 @@ Loggable::do_this ( const char *s, bool reverse )
int found = sscanf( s, "%s %X %s ", classname, &id, command );
ASSERT( 3 == found, "Invalid journal entry format \"%s\"", s );
if ( 3 != found )
FATAL( "Invalid journal entry format \"%s\"", s );
const char *create, *destroy;

View File

@ -42,7 +42,7 @@ class Loggable;
typedef Loggable *(create_func)(Log_Entry &, unsigned int id);
#define LOG_REGISTER_CREATE( class ) \
Loggable::register_create( #class, & class ::create );
Loggable::register_create( #class, & class ::create )
#define LOG_NAME_FUNC( class ) \
virtual const char *class_name ( void ) const { return #class ; }
@ -56,7 +56,7 @@ typedef Loggable *(create_func)(Log_Entry &, unsigned int id);
r->set( e ); \
return (Loggable *)r; \
} \
LOG_NAME_FUNC( class );
LOG_NAME_FUNC( class )
#define LOG_NOT_LOGGABLE_FUNC( class ) \

View File

@ -134,7 +134,7 @@ namespace OSC
char *
Signal::get_output_connection_peer_name_and_path ( int n )
{
Signal *t;
Signal *t = NULL;
int j = 0;
for ( std::list<Signal*>::const_iterator i = _outgoing.begin();
@ -150,10 +150,15 @@ namespace OSC
// Signal *s = get_peer_signal_by_id( t->_peer, t->signal_id );
char *r;
asprintf( &r, "%s:%s", t->_peer->name, t->path() );
if ( t )
{
char *r;
asprintf( &r, "%s:%s", t->_peer->name, t->path() );
return r;
return r;
}
else
return NULL;
}

View File

@ -365,7 +365,7 @@ namespace OSC
friend void Signal::rename ( const char *name );
};
};
}
/* helper macros for defining OSC handlers */
/* #define OSC_NAME( name ) osc_ ## name */

View File

@ -101,7 +101,7 @@ warnf ( warning_t level,
#else
#define DMESSAGE( fmt, args... )
#define DWARNING( fmt, args... )
#define ASSERT( pred, fmt, args... )
#define ASSERT( pred, fmt, args... ) (void)(pred)
#endif
/* these are always defined */

View File

@ -515,7 +515,7 @@ Audio_Region::draw ( void )
/* overdraw a little to avoid artifacts when scrolling */
W += 2;
Fl_Color c = selected() ? fl_invert_color( _color ) : _color;
// Fl_Color c = selected() ? fl_invert_color( _color ) : _color;
if ( sequence()->damage() & FL_DAMAGE_USER1 &&
recording() )
@ -740,7 +740,7 @@ Audio_Region::split ( nframes_t where )
int
Audio_Region::handle ( int m )
{
static int ox, oy;
static int ox;
static bool copied = false;
static nframes_t os;
@ -802,7 +802,6 @@ Audio_Region::handle ( int m )
else
{
ox = x() - X;
oy = y() - Y;
/* for panning */
os = _r->offset;
@ -855,8 +854,6 @@ Audio_Region::handle ( int m )
/* panning */
int d = (ox + X) - x();
bool negative = d < 0;
if ( d < 0 )
_r->offset = os + timeline->x_to_ts( 0 - d );
else

View File

@ -119,13 +119,13 @@ protected:
virtual void get ( Log_Entry &e ) const;
virtual void set ( Log_Entry &e );
void draw_label ( const char *label, Fl_Align align )
virtual void draw_label ( const char *label, Fl_Align align, Fl_Color color=(Fl_Color)0, int xo=0, int yo=0 )
{
Sequence_Widget::draw_label( label, align );
}
virtual void draw_label ( void );
int handle ( int m );
void draw_label ( void );
void draw_box ( void );
void draw ( void );
void resize ( void );

View File

@ -305,7 +305,7 @@ Control_Sequence::draw ( void )
bool active = active_r();
const Fl_Color color = active ? this->color() : fl_inactive( this->color() );
const Fl_Color selection_color = active ? this->selection_color() : fl_inactive( this->selection_color() );
// const Fl_Color selection_color = active ? this->selection_color() : fl_inactive( this->selection_color() );
fl_rectf( X, Y, W, H, fl_color_average( FL_WHITE, FL_BACKGROUND_COLOR, 0.3 ) );

View File

@ -96,7 +96,7 @@ command_session_is_loaded ( void *userdata )
static int
command_broadcast ( const char *path, lo_message msg, void *userdata )
{
int argc = lo_message_get_argc( msg );
lo_message_get_argc( msg );
// lo_arg **argv = lo_message_get_argv( msg );
if ( !strcmp( path, "/non/hello" ) )

View File

@ -126,6 +126,7 @@ public:
virtual Sequence * clone ( void )
{
assert( 0 );
return NULL;
}
virtual Sequence * clone_empty ( void )

View File

@ -145,8 +145,6 @@ Sequence_Region::handle ( int m )
{
static enum trim_e trimming;
static bool copied = false;
int X = Fl::event_x();
int Y = Fl::event_y();
@ -207,7 +205,6 @@ Sequence_Region::handle ( int m )
{
Sequence_Widget::handle( m );
copied = false;
if ( trimming != NO )
trimming = NO;
@ -259,7 +256,7 @@ Sequence_Region::draw ( void )
}
void
Sequence_Region::draw_label ( const char *label, Fl_Align align )
Sequence_Region::draw_label ( const char *label, Fl_Align align, Fl_Color color, int xo, int yo )
{
fl_color( FL_WHITE );
fl_font( FL_HELVETICA_ITALIC, 10 );

View File

@ -41,7 +41,8 @@ protected:
virtual int handle ( int m );
virtual void draw_box( void );
virtual void draw ( void );
virtual void draw_label ( const char *label, Fl_Align align );
virtual void draw_label ( void ) { Sequence_Widget::draw_label(); }
virtual void draw_label ( const char *label, Fl_Align align, Fl_Color color=(Fl_Color)0, int xo=0, int yo=0 );
public:

View File

@ -309,6 +309,7 @@ public:
virtual void draw_box ( void );
virtual void draw ( void );
virtual void draw_label ( void );
virtual void draw_label ( const char *label, Fl_Align align, Fl_Color color=(Fl_Color)0, int xo=0, int yo=0 );
bool
operator< ( const Sequence_Widget & rhs ) const
@ -322,7 +323,6 @@ public:
return _r->start <= rhs._r->start;
}
virtual void draw_label ( const char *label, Fl_Align align, Fl_Color color=(Fl_Color)0, int xo=0, int yo=0 );
virtual int handle ( int m );
static bool

View File

@ -155,7 +155,6 @@ protected:
void
draw_background ( int X, int Y,int W, int H )
{
nframes_t sf = 0;
nframes_t ef = timeline->length();
double ty = Y;
@ -311,8 +310,6 @@ Timeline::cb_scroll ( Fl_Widget *w )
_fpp = panzoomer->zoom();
const int tw = tracks->w() - Track::width();
panzoomer->x_value( ts_to_x( under_mouse ) );
redraw();
@ -532,7 +529,7 @@ Timeline::menu_cb ( Fl_Menu_ *m )
{
Loggable::block_start();
Cursor_Region *o = new Cursor_Region( range_start(), range_end() - range_start(), "Punch", NULL );
new Cursor_Region( range_start(), range_end() - range_start(), "Punch", NULL );
reset_range();
Loggable::block_end();
@ -553,7 +550,7 @@ Timeline::menu_cb ( Fl_Menu_ *m )
}
else
{
Cursor_Region *o = new Cursor_Region( range_start(), range_end() - range_start(), "Playback", NULL );
new Cursor_Region( range_start(), range_end() - range_start(), "Playback", NULL );
}
reset_range();
@ -1373,7 +1370,7 @@ Timeline::draw_playhead ( void )
void
Timeline::redraw_playhead ( void )
{
static nframes_t last_playhead = -1;
// static nframes_t last_playhead = -1;
static int last_playhead_x = -1;
/* FIXME: kind of a hackish way to invoke punch / looping stuff from the UI thread... */
@ -1439,7 +1436,7 @@ Timeline::redraw_playhead ( void )
if ( last_playhead_x != playhead_x )
{
redraw_overlay();
last_playhead = transport->frame;
// last_playhead = transport->frame;
last_playhead_x = playhead_x;
if ( follow_playhead )

View File

@ -102,7 +102,7 @@ class Timeline : public Fl_Single_Window, public RWLock
static void draw_clip ( void * v, int X, int Y, int W, int H );
int _old_xposition;
nframes_t _old_xposition;
int _old_yposition;
Rectangle _selection;

View File

@ -865,13 +865,10 @@ Track::draw ( void )
fl_clip_box( x(), y(), w(), h(), X, Y, W, H );
Fl_Color saved_color;
Fl_Color saved_color = color();
if ( ! Track::colored_tracks )
{
saved_color = color();
color( FL_GRAY );
}
if ( _selected )
{

View File

@ -122,8 +122,6 @@ Waveform::draw ( int X, int Y, int W, int H,
fl_begin_line();
unsigned long end = start + W;
j = start;
for ( int x = X; x < X + W; x++, j += skip )