From 47dbf6c53792346f44186326dc9692174acc8986 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Sun, 18 May 2008 22:01:09 -0500 Subject: [PATCH] Clear up a load of compiler warnings. --- Mixer/Mixer.C | 4 +-- Timeline/Annotation_Sequence.H | 6 ++--- Timeline/Disk_Stream.C | 2 +- Timeline/Engine.C | 2 +- Timeline/Loggable.H | 2 +- Timeline/Peaks.C | 49 +++++----------------------------- Timeline/Peaks.H | 2 +- Timeline/Playback_DS.C | 2 +- Timeline/Sequence.C | 2 +- Timeline/Sequence.H | 2 +- Timeline/Sequence_Widget.C | 2 +- Timeline/Tempo_Point.C | 2 +- Timeline/Tempo_Sequence.H | 4 +-- Timeline/Time_Point.C | 2 +- Timeline/Time_Sequence.H | 4 +-- Timeline/Timeline.C | 35 ++++++++++++------------ Timeline/Track.C | 2 +- 17 files changed, 45 insertions(+), 79 deletions(-) diff --git a/Mixer/Mixer.C b/Mixer/Mixer.C index 9a10543..608305a 100644 --- a/Mixer/Mixer.C +++ b/Mixer/Mixer.C @@ -36,7 +36,7 @@ Fl_Single_Window *main_window; #include int -main ( int argc, char **arv ) +main ( int argc, char **argv ) { Fl::get_system_colors(); Fl::scheme( "plastic" ); @@ -61,7 +61,7 @@ main ( int argc, char **arv ) o->end(); } o->end(); - o->show(); + o->show( argc, argv ); while ( 1 ) { diff --git a/Timeline/Annotation_Sequence.H b/Timeline/Annotation_Sequence.H index 4ff7219..c404ac2 100644 --- a/Timeline/Annotation_Sequence.H +++ b/Timeline/Annotation_Sequence.H @@ -77,9 +77,9 @@ public: log_create(); } - Annotation_Sequence ( int X, int Y, int W, int H ) : Sequence ( 0 ) - { - } +/* Annotation_Sequence ( int X, int Y, int W, int H ) : Sequence ( 0 ) */ +/* { */ +/* } */ ~Annotation_Sequence ( ) { diff --git a/Timeline/Disk_Stream.C b/Timeline/Disk_Stream.C index e694947..57b389b 100644 --- a/Timeline/Disk_Stream.C +++ b/Timeline/Disk_Stream.C @@ -165,7 +165,7 @@ void Disk_Stream::run ( void ) { if ( pthread_create( &_thread, NULL, &Disk_Stream::disk_thread, this ) != 0 ) - /* error */; + FATAL( "Could not create IO thread!" ); } /* to be called when the JACK buffer size changes. */ diff --git a/Timeline/Engine.C b/Timeline/Engine.C index 70d7e21..84131fc 100644 --- a/Timeline/Engine.C +++ b/Timeline/Engine.C @@ -150,7 +150,7 @@ Engine::sync ( jack_transport_state_t state, jack_position_t *pos ) /* THREAD: RT */ void -Engine::timebase ( jack_transport_state_t state, jack_nframes_t nframes, jack_position_t *pos, int new_pos ) +Engine::timebase ( jack_transport_state_t, jack_nframes_t, jack_position_t *pos, int ) { position_info pi = timeline->solve_tempomap( pos->frame ); diff --git a/Timeline/Loggable.H b/Timeline/Loggable.H index e760f13..9e6b7af 100644 --- a/Timeline/Loggable.H +++ b/Timeline/Loggable.H @@ -234,7 +234,7 @@ protected: void log_destroy ( void ) const; /* leaf subclasses *must* call log_create() at the end of their copy contructors */ - Loggable ( const Loggable &rhs ) + Loggable ( const Loggable & ) { init( true ); /* FIXME: get a real id here!!! */ diff --git a/Timeline/Peaks.C b/Timeline/Peaks.C index 30b5b20..eaba682 100644 --- a/Timeline/Peaks.C +++ b/Timeline/Peaks.C @@ -84,29 +84,6 @@ touch ( int fd ) fchmod( fd, st.st_mode ); } - -static int -nearest_power_of_two ( int v ) -{ - int p = 1; - while ( 1 << p < v ) - ++p; - - return 1 << p; -} - -static nframes_t -nearest_cached_chunksize ( nframes_t chunksize ) -{ - nframes_t r = nearest_power_of_two( chunksize ); - - for ( int i = Peaks::cache_levels; i--; r >>= Peaks::cache_step ) - if ( chunksize >= r ) - return r; - - return 0; -} - Peaks::Peaks ( Audio_File *c ) @@ -128,7 +105,7 @@ Peaks::fill_buffer ( float fpp, nframes_t s, nframes_t e ) const { _fpp = fpp; - return read_peaks( s, e, (e - s) / fpp, fpp ); + return read_peaks( s, (e - s) / fpp, fpp ); } struct peakfile_block_header @@ -297,6 +274,8 @@ public: scan( chunksize ); assert( _chunksize ); + + return true; } void @@ -337,7 +316,8 @@ public: nframes_t len = 0; - nframes_t i; + int i; + for ( i = 0; i < npeaks; ++i ) { /* read in a buffer */ @@ -389,9 +369,6 @@ Peaks::ready ( nframes_t s, int npeaks, nframes_t chunksize ) const int Peaks::read_peakfile_peaks ( Peak *peaks, nframes_t s, int npeaks, nframes_t chunksize ) const { - - nframes_t ncc = nearest_cached_chunksize( chunksize ); - /* never try to build peaks while recording */ if ( ! transport->recording ) { @@ -408,19 +385,7 @@ Peaks::read_peakfile_peaks ( Peak *peaks, nframes_t s, int npeaks, nframes_t chu if ( ! _peakfile.open( _clip->name(), _clip->channels(), chunksize ) ) return 0; -/* else if ( ! _peakfile.contains( s, npeaks ) ) */ -/* { */ -/* /\* the best peakfile for this chunksize doesn't have the */ -/* * peaks we need. Perhaps it's still being constructed, */ -/* * try the next best, then give up. *\/ */ -/* if ( ! _peakfile.open( _clip->name(), chunksize >> 1, _clip->channels() ) ) */ -/* return 0; */ -/* } */ - return _peakfile.read_peaks( peaks, s, npeaks, chunksize ); - - // _peakfile.close(); - } @@ -479,7 +444,7 @@ Peaks::read_source_peaks ( Peak *peaks, nframes_t s, int npeaks, nframes_t chunk } int -Peaks::read_peaks ( nframes_t s, nframes_t e, int npeaks, nframes_t chunksize ) const +Peaks::read_peaks ( nframes_t s, int npeaks, nframes_t chunksize ) const { // printf( "reading peaks %d @ %d\n", npeaks, chunksize ); @@ -494,7 +459,7 @@ Peaks::read_peaks ( nframes_t s, nframes_t e, int npeaks, nframes_t chunksize ) _peakbuf.buf->chunksize = chunksize; /* FIXME: use actual minimum chunksize from peakfile! */ - if ( chunksize < cache_minimum ) + if ( chunksize < (nframes_t)cache_minimum ) _peakbuf.len = read_source_peaks( _peakbuf.buf->data, s, npeaks, chunksize ); else _peakbuf.len = read_peakfile_peaks( _peakbuf.buf->data, s, npeaks, chunksize ); diff --git a/Timeline/Peaks.H b/Timeline/Peaks.H index 7d0c70b..1f9533a 100644 --- a/Timeline/Peaks.H +++ b/Timeline/Peaks.H @@ -101,7 +101,7 @@ class Peaks mutable float _fpp; - int read_peaks ( nframes_t s, nframes_t e, int npeaks, nframes_t chunksize ) const; + int read_peaks ( nframes_t s, int npeaks, nframes_t chunksize ) const; int read_source_peaks ( Peak *peaks, nframes_t s, int npeaks, nframes_t chunksize ) const; int read_source_peaks ( Peak *peaks, int npeaks, nframes_t chunksize ) const; int read_peakfile_peaks ( Peak *peaks, nframes_t s, int npeaks, nframes_t chunksize ) const; diff --git a/Timeline/Playback_DS.C b/Timeline/Playback_DS.C index b9c4115..6f22a56 100644 --- a/Timeline/Playback_DS.C +++ b/Timeline/Playback_DS.C @@ -82,7 +82,7 @@ Playback_DS::read_block ( sample_t *buf, nframes_t nframes ) if ( sequence()->play( buf, _frame, nframes, channels() ) ) _frame += nframes; else - /* error */; + WARNING( "Programming error?" ); timeline->unlock(); } diff --git a/Timeline/Sequence.C b/Timeline/Sequence.C index ced8ac7..845d538 100644 --- a/Timeline/Sequence.C +++ b/Timeline/Sequence.C @@ -223,7 +223,7 @@ void Sequence::snap ( Sequence_Widget *r ) { const int snap_pixels = 10; - const int snap_frames = timeline->x_to_ts( snap_pixels ); + const nframes_t snap_frames = timeline->x_to_ts( snap_pixels ); /* snap to other widgets */ if ( Timeline::snap_magnetic ) diff --git a/Timeline/Sequence.H b/Timeline/Sequence.H index e5ef9ef..45b7439 100644 --- a/Timeline/Sequence.H +++ b/Timeline/Sequence.H @@ -118,6 +118,6 @@ public: virtual int handle ( int m ); virtual void draw ( void ); - virtual nframes_t process ( nframes_t nframes ) { return 0; } + virtual nframes_t process ( nframes_t ) { return 0; } }; diff --git a/Timeline/Sequence_Widget.C b/Timeline/Sequence_Widget.C index 4575fe7..128729c 100644 --- a/Timeline/Sequence_Widget.C +++ b/Timeline/Sequence_Widget.C @@ -106,7 +106,7 @@ Sequence_Widget::start ( nframes_t where ) d = 0 - d; - if ( m <= d ) + if ( m <= (nframes_t)d ) d = m; for ( list ::iterator i = _selection.begin(); i != _selection.end(); ++i ) diff --git a/Timeline/Tempo_Point.C b/Timeline/Tempo_Point.C index b8df1b8..0508b54 100644 --- a/Timeline/Tempo_Point.C +++ b/Timeline/Tempo_Point.C @@ -156,7 +156,7 @@ public: } static void - enter_cb ( Fl_Widget *w, void *v ) + enter_cb ( Fl_Widget *, void *v ) { ((Tempo_Point_Editor*)v)->enter_cb(); } diff --git a/Timeline/Tempo_Sequence.H b/Timeline/Tempo_Sequence.H index 38a12a0..9a32c1a 100644 --- a/Timeline/Tempo_Sequence.H +++ b/Timeline/Tempo_Sequence.H @@ -28,8 +28,8 @@ class Tempo_Sequence : public Sequence protected: /* not used */ - void get ( Log_Entry &e ) const { } - void set ( Log_Entry &e ) { } + void get ( Log_Entry & ) const { } + void set ( Log_Entry & ) { } public: diff --git a/Timeline/Time_Point.C b/Timeline/Time_Point.C index ceddea3..fb23623 100644 --- a/Timeline/Time_Point.C +++ b/Timeline/Time_Point.C @@ -185,7 +185,7 @@ public: } static void - enter_cb ( Fl_Widget *w, void *v ) + enter_cb ( Fl_Widget *, void *v ) { ((Time_Point_Editor*)v)->enter_cb(); } diff --git a/Timeline/Time_Sequence.H b/Timeline/Time_Sequence.H index 3b0a5e0..b5f3f54 100644 --- a/Timeline/Time_Sequence.H +++ b/Timeline/Time_Sequence.H @@ -31,8 +31,8 @@ class Time_Sequence : public Sequence protected: /* not used */ - void get ( Log_Entry &e ) const { } - void set ( Log_Entry &e ) { } + void get ( Log_Entry & ) const { } + void set ( Log_Entry & ) { } public: diff --git a/Timeline/Timeline.C b/Timeline/Timeline.C index 6ee19fb..c19cec5 100644 --- a/Timeline/Timeline.C +++ b/Timeline/Timeline.C @@ -233,21 +233,22 @@ Timeline::Timeline ( int X, int Y, int W, int H, const char* L ) : Fl_Overlay_Wi } -float -Timeline::beats_per_minute ( nframes_t when ) const -{ -/* return tempo_track->beats_per_minute( when ); */ +/* float */ +/* Timeline::beats_per_minute ( nframes_t when ) const */ +/* { */ -} +/* /\* return tempo_track->beats_per_minute( when ); *\/ */ -int -Timeline::beats_per_bar ( nframes_t when ) const -{ - time_sig t = time_track->time( when ); +/* } */ - return t.beats_per_bar; -} +/* int */ +/* Timeline::beats_per_bar ( nframes_t when ) const */ +/* { */ +/* time_sig t = time_track->time( when ); */ + +/* return t.beats_per_bar; */ +/* } */ void Timeline::beats_per_minute ( nframes_t when, float bpm ) @@ -502,12 +503,12 @@ Timeline::draw_measure_lines ( int X, int Y, int W, int H, Fl_Color color ) } -/** just like draw mesure lines except that it also draws the BBT values. */ -void -Timeline::draw_measure_BBT ( int X, int Y, int W, int H, Fl_Color color ) -{ -// render_tempomap( X, Y, W, H, color, true ); -} +/* /\** just like draw mesure lines except that it also draws the BBT values. *\/ */ +/* void */ +/* Timeline::draw_measure_BBT ( int X, int Y, int W, int H, Fl_Color color ) */ +/* { */ +/* // render_tempomap( X, Y, W, H, color, true ); */ +/* } */ void Timeline::xposition ( int X ) diff --git a/Timeline/Track.C b/Timeline/Track.C index 1622fee..a6237bd 100644 --- a/Timeline/Track.C +++ b/Timeline/Track.C @@ -41,7 +41,7 @@ int Track::_soloing = 0; const char *Track::capture_format = "Wav 24"; void -Track::cb_input_field ( Fl_Widget *w, void *v ) +Track::cb_input_field ( Fl_Widget *, void *v ) { ((Track*)v)->cb_input_field(); }