From a8d490d4cc6b037e2c13356480dad5751d1977ec Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Thu, 24 Jan 2008 11:21:22 +0000 Subject: [PATCH] eliminated warnings when compiling with GCC 4.3 git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/branches/lmms-mv@671 0778d3d1-df1d-0410-868b-ea421aaaa00d --- ChangeLog | 45 ++++++++++++++++++- README | 5 +-- configure.in | 4 +- include/automatable_model.h | 15 ++++--- include/journalling_object.h | 2 +- include/types.h | 18 +++++--- plugins/bass_booster/bass_booster.cpp | 1 + plugins/bass_booster/bassbooster_controls.cpp | 1 + plugins/stk/mallets/mallets.cpp | 2 +- src/audio/audio_alsa.cpp | 3 +- src/audio/audio_file_device.cpp | 4 +- src/audio/audio_jack.cpp | 3 +- src/audio/audio_oss.cpp | 3 +- src/audio/audio_port.cpp | 1 + src/core/automation_editor.cpp | 1 + src/core/effect.cpp | 1 + src/core/effect_chain.cpp | 1 + src/core/effect_control_dialog.cpp | 1 + src/core/effect_select_dialog.cpp | 3 +- src/core/main.cpp | 3 +- src/core/meter_dialog.cpp | 1 + src/core/mixer.cpp | 3 +- src/core/preset_preview_play_handle.cpp | 2 +- src/core/setup_dialog.cpp | 3 +- src/core/timeline.cpp | 3 +- src/lib/drumsynth.cpp | 3 +- src/lib/mmp.cpp | 1 + src/lib/project_journal.cpp | 3 +- src/midi/midi_alsa_seq.cpp | 3 +- src/tracks/instrument_track.cpp | 4 +- src/widgets/group_box.cpp | 1 + 31 files changed, 107 insertions(+), 37 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7a8ebd363..6718a8dd6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,47 @@ +2008-01-24 Tobias Doerffel + + * include/types.h: + replaced own buggy valueRanges-calculations by numeric_limits-class + + * plugins/lb302/lb302.cpp: + fixed broken plugin-entry-point + + * configure.in: + * plugins/bass_booster/bass_booster.cpp: + * plugins/bass_booster/bassbooster_controls.cpp: + * plugins/stk/mallets/mallets.cpp: + * include/automatable_model.h: + * include/journalling_object.h: + * src/audio/audio_file_device.cpp: + * src/audio/audio_alsa.cpp: + * src/audio/audio_oss.cpp: + * src/audio/audio_port.cpp: + * src/audio/audio_jack.cpp: + * src/midi/midi_alsa_seq.cpp: + * src/lib/project_journal.cpp: + * src/lib/mmp.cpp: + * src/lib/drumsynth.cpp: + * src/widgets/group_box.cpp: + * src/tracks/instrument_track.cpp: + * src/core/effect_chain.cpp: + * src/core/preset_preview_play_handle.cpp: + * src/core/effect_control_dialog.cpp: + * src/core/setup_dialog.cpp: + * src/core/main.cpp: + * src/core/mixer.cpp: + * src/core/effect.cpp: + * src/core/timeline.cpp: + * src/core/effect_select_dialog.cpp: + * src/core/automation_editor.cpp: + * src/core/meter_dialog.cpp: + various fixes for GCC 4.3 + + * README: + cleanups / fixes + + * include/automatable_model.h: + cleanups / coding-style fixes + 2008-01-24 Paul Giblock * include/automatable_model.h: @@ -14,7 +58,6 @@ split lb302 for M/V. However, lmms_plugin_main() receives null data, which means the instrumentTrack cannot be set.. - 2008-01-18 Tobias Doerffel * src/core/effect_chain.cpp: diff --git a/README b/README index 792f2d990..04c1bbdd0 100644 --- a/README +++ b/README @@ -20,7 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc., -What is LMMS?? +What is LMMS? -------------- LMMS aims to be a free alternative to popular (but commercial and closed- @@ -47,8 +47,7 @@ least 500 MHz, but for really enjoying LMMS less than 1 GHz makes no sense... Required libraries: -- multithreaded version of Qt 3.0 (at least 3.2 recommended) or higher with - devel-files +- Qt >= 4.3.0 with devel-files Optional, but strongly recommended: - JACK with devel-files diff --git a/configure.in b/configure.in index a34398793..ec73a9e28 100644 --- a/configure.in +++ b/configure.in @@ -574,9 +574,9 @@ lmmsdatadir="$datadir/$PACKAGE" AC_SUBST(lmmsdatadir) -EXTRA_WARNINGS="-Wextra -Wno-unused-parameter -Wunsafe-loop-optimizations -Winline -Wdisabled-optimization" +EXTRA_WARNINGS="-Wextra -Wno-unused-parameter -Wunsafe-loop-optimizations -Wdisabled-optimization" if test "x$CXX" == "xg++" ; then - CXXFLAGS="$CXXFLAGS -ansi -Wall $EXTRA_WARNINGS -fno-exceptions" + CXXFLAGS="-ansi -Wall $EXTRA_WARNINGS $CXXFLAGS -fno-exceptions" fi LDFLAGS="$LDFLAGS -L/usr/local/lib" diff --git a/include/automatable_model.h b/include/automatable_model.h index 3cf537cb0..c77551f0f 100644 --- a/include/automatable_model.h +++ b/include/automatable_model.h @@ -279,8 +279,6 @@ public: } ; -//#include "automatable_model_templates.h" - #define generateModelPrimitive(type,type2) \ typedef automatableModel type##Model; \ @@ -292,16 +290,21 @@ public: generateModelPrimitive(float,float); generateModelPrimitive(int,int); -class boolModel : public automatableModel { +class boolModel : public automatableModel +{ public: boolModel( const bool _val = FALSE, ::model * _parent = NULL, bool _default_constructed = FALSE ) : - automatableModel( _val, FALSE, TRUE, defaultRelStep(), _parent, _default_constructed ) - {} -}; + autoModel( _val, FALSE, TRUE, defaultRelStep(), _parent, + _default_constructed ) + { + } + +} ; typedef automatableModelView boolModelView; + #endif diff --git a/include/journalling_object.h b/include/journalling_object.h index 7c8d91842..a0316548e 100644 --- a/include/journalling_object.h +++ b/include/journalling_object.h @@ -105,7 +105,7 @@ public: journallingObject( void ); virtual ~journallingObject(); - inline const jo_id_t id( void ) const + inline jo_id_t id( void ) const { return( m_id ); } diff --git a/include/types.h b/include/types.h index e689adacc..09b020e75 100644 --- a/include/types.h +++ b/include/types.h @@ -1,7 +1,7 @@ /* * types.h - typedefs for common types that are used in the whole app * - * Copyright (c) 2004-2006 Tobias Doerffel + * Copyright (c) 2004-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -26,6 +26,8 @@ #ifndef _TYPES_H #define _TYPES_H +#include + typedef unsigned char Uint8; typedef signed char Sint8; typedef unsigned short Uint16; @@ -60,13 +62,15 @@ typedef Uint32 jo_id_t; // (unique) ID of a journalling object template struct valueRanges { - enum + static inline T min( void ) { - max = static_cast( static_cast( ~0 ) > 0 ? - ~0 : ( ( ( T ) 1 << ( sizeof( T ) * 8 - 1 ) ) - 1 ) ), - min = static_cast( static_cast( ~0 ) > 0 ? - 0 : ( -max - 1 ) ) - } ; + return( std::numeric_limits::min() ); + } + + static inline T max( void ) + { + return( std::numeric_limits::max() ); + } } ; diff --git a/plugins/bass_booster/bass_booster.cpp b/plugins/bass_booster/bass_booster.cpp index 6a9865801..9617d9511 100644 --- a/plugins/bass_booster/bass_booster.cpp +++ b/plugins/bass_booster/bass_booster.cpp @@ -24,6 +24,7 @@ #include "bass_booster.h" +#include "automatable_model_templates.h" #undef SINGLE_SOURCE_COMPILE diff --git a/plugins/bass_booster/bassbooster_controls.cpp b/plugins/bass_booster/bassbooster_controls.cpp index bb96ecd68..52247c67e 100644 --- a/plugins/bass_booster/bassbooster_controls.cpp +++ b/plugins/bass_booster/bassbooster_controls.cpp @@ -25,6 +25,7 @@ #include "bassbooster_controls.h" #include "bass_booster.h" +#include "automatable_model_templates.h" diff --git a/plugins/stk/mallets/mallets.cpp b/plugins/stk/mallets/mallets.cpp index a58665b6a..ca729599c 100644 --- a/plugins/stk/mallets/mallets.cpp +++ b/plugins/stk/mallets/mallets.cpp @@ -73,7 +73,7 @@ malletsInstrument::malletsInstrument( instrumentTrack * _instrument_track ): m_pressureModel(64.0f, 0.0f, 128.0f, 0.1f, this), m_motionModel(64.0f, 0.0f, 128.0f, 0.1f, this), m_velocityModel(64.0f, 0.0f, 128.0f, 0.1f, this), - m_strikeModel( FALSE, FALSE, TRUE, boolModel::defaultRelStep(), this ), + m_strikeModel( FALSE, this ), m_presetsModel(this), m_spreadModel(0, 0, 255, 1, this) { diff --git a/src/audio/audio_alsa.cpp b/src/audio/audio_alsa.cpp index 4574ae090..25d34ed54 100644 --- a/src/audio/audio_alsa.cpp +++ b/src/audio/audio_alsa.cpp @@ -3,7 +3,7 @@ /* * audio_alsa.cpp - device-class which implements ALSA-PCM-output * - * Copyright (c) 2004-2007 Tobias Doerffel + * Copyright (c) 2004-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -36,6 +36,7 @@ #ifdef ALSA_SUPPORT #include "endian_handling.h" +#include "automatable_model_templates.h" #include "config_mgr.h" #include "lcd_spinbox.h" #include "gui_templates.h" diff --git a/src/audio/audio_file_device.cpp b/src/audio/audio_file_device.cpp index 906d39913..f28e68fc9 100644 --- a/src/audio/audio_file_device.cpp +++ b/src/audio/audio_file_device.cpp @@ -4,7 +4,7 @@ * audio_file_device.cpp - base-class for audio-device-classes which write * their output into a file * - * Copyright (c) 2004-2007 Tobias Doerffel + * Copyright (c) 2004-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -28,9 +28,9 @@ #include - #include "audio_file_device.h" #include "export_project_dialog.h" +#include "automatable_model_templates.h" audioFileDevice::audioFileDevice( const sample_rate_t _sample_rate, diff --git a/src/audio/audio_jack.cpp b/src/audio/audio_jack.cpp index 5f0b1de4c..90eada53b 100644 --- a/src/audio/audio_jack.cpp +++ b/src/audio/audio_jack.cpp @@ -3,7 +3,7 @@ /* * audio_jack.cpp - support for JACK-transport * - * Copyright (c) 2005-2007 Tobias Doerffel + * Copyright (c) 2005-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -40,6 +40,7 @@ #include "debug.h" #include "templates.h" +#include "automatable_model_templates.h" #include "gui_templates.h" #include "config_mgr.h" #include "lcd_spinbox.h" diff --git a/src/audio/audio_oss.cpp b/src/audio/audio_oss.cpp index 5ce44c706..02ae2ecb4 100644 --- a/src/audio/audio_oss.cpp +++ b/src/audio/audio_oss.cpp @@ -3,7 +3,7 @@ /* * audio_oss.cpp - device-class that implements OSS-PCM-output * - * Copyright (c) 2004-2007 Tobias Doerffel + * Copyright (c) 2004-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -35,6 +35,7 @@ #include #include "endian_handling.h" +#include "automatable_model_templates.h" #include "lcd_spinbox.h" #include "gui_templates.h" #include "templates.h" diff --git a/src/audio/audio_port.cpp b/src/audio/audio_port.cpp index d4cc53c84..7b9bafd1a 100644 --- a/src/audio/audio_port.cpp +++ b/src/audio/audio_port.cpp @@ -31,6 +31,7 @@ #include "audio_port.h" #include "audio_device.h" #include "engine.h" +#include "automatable_model_templates.h" audioPort::audioPort( const QString & _name, track * _track ) : diff --git a/src/core/automation_editor.cpp b/src/core/automation_editor.cpp index 719c6ad85..e18170ed6 100644 --- a/src/core/automation_editor.cpp +++ b/src/core/automation_editor.cpp @@ -49,6 +49,7 @@ #include "song_editor.h" +#include "automatable_model_templates.h" #include "main_window.h" #include "embed.h" #include "engine.h" diff --git a/src/core/effect.cpp b/src/core/effect.cpp index 90063c52d..12d67cb3d 100644 --- a/src/core/effect.cpp +++ b/src/core/effect.cpp @@ -31,6 +31,7 @@ #include "dummy_effect.h" #include "effect_chain.h" #include "effect_view.h" +#include "automatable_model_templates.h" effect::effect( const plugin::descriptor * _desc, diff --git a/src/core/effect_chain.cpp b/src/core/effect_chain.cpp index 31d2c27b4..5928e05b4 100644 --- a/src/core/effect_chain.cpp +++ b/src/core/effect_chain.cpp @@ -28,6 +28,7 @@ #include "effect_chain.h" #include "engine.h" +#include "automatable_model_templates.h" diff --git a/src/core/effect_control_dialog.cpp b/src/core/effect_control_dialog.cpp index 980eb631f..4d471b3ab 100644 --- a/src/core/effect_control_dialog.cpp +++ b/src/core/effect_control_dialog.cpp @@ -32,6 +32,7 @@ #include "effect_control_dialog.h" #include "effect_controls.h" #include "effect.h" +#include "automatable_model_templates.h" effectControlDialog::effectControlDialog( effectControls * _controls ) : diff --git a/src/core/effect_select_dialog.cpp b/src/core/effect_select_dialog.cpp index 5d716d2b0..c82510c9c 100644 --- a/src/core/effect_select_dialog.cpp +++ b/src/core/effect_select_dialog.cpp @@ -3,7 +3,7 @@ /* * effect_select_dialog.cpp - dialog to choose effect plugin * - * Copyright (c) 2006-2007 Tobias Doerffel + * Copyright (c) 2006-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -33,6 +33,7 @@ #include "effect_select_dialog.h" #include "gui_templates.h" +#include "automatable_model_templates.h" #include "embed.h" diff --git a/src/core/main.cpp b/src/core/main.cpp index 18b7e28d1..c9211f392 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -3,7 +3,7 @@ /* * main.cpp - just main.cpp which is starting up app... * - * Copyright (c) 2004-2007 Tobias Doerffel + * Copyright (c) 2004-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -43,6 +43,7 @@ #include "export_project_dialog.h" #include "song_editor.h" #include "gui_templates.h" +#include "automatable_model_templates.h" #warning TODO: move somewhere else static inline QString baseName( const QString & _file ) diff --git a/src/core/meter_dialog.cpp b/src/core/meter_dialog.cpp index 3a0af7c0a..1c85be4d2 100644 --- a/src/core/meter_dialog.cpp +++ b/src/core/meter_dialog.cpp @@ -31,6 +31,7 @@ #include "meter_dialog.h" #include "embed.h" #include "gui_templates.h" +#include "automatable_model_templates.h" meterDialog::meterDialog( QWidget * _parent, track * _track ): diff --git a/src/core/mixer.cpp b/src/core/mixer.cpp index 29121750a..1a636ac30 100644 --- a/src/core/mixer.cpp +++ b/src/core/mixer.cpp @@ -3,7 +3,7 @@ /* * mixer.cpp - audio-device-independent mixer for LMMS * - * Copyright (c) 2004-2007 Tobias Doerffel + * Copyright (c) 2004-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -39,6 +39,7 @@ #include "sample_play_handle.h" #include "piano_roll.h" #include "micro_timer.h" +#include "automatable_model_templates.h" #include "audio_device.h" #include "midi_client.h" diff --git a/src/core/preset_preview_play_handle.cpp b/src/core/preset_preview_play_handle.cpp index 0c07224cd..1d2091a4f 100644 --- a/src/core/preset_preview_play_handle.cpp +++ b/src/core/preset_preview_play_handle.cpp @@ -144,7 +144,7 @@ presetPreviewPlayHandle::presetPreviewPlayHandle( // create note-play-handle for it m_previewNote = new notePlayHandle( s_previewTC->previewInstrumentTrack(), 0, - valueRanges::max / 2, + valueRanges::max() / 2, note( 0, 0, static_cast( A ), static_cast( DEFAULT_OCTAVE - 1 ), 100 ) ); diff --git a/src/core/setup_dialog.cpp b/src/core/setup_dialog.cpp index 271070c4b..1c26df701 100644 --- a/src/core/setup_dialog.cpp +++ b/src/core/setup_dialog.cpp @@ -3,7 +3,7 @@ /* * setup_dialog.cpp - dialog for setting up LMMS * - * Copyright (c) 2005-2007 Tobias Doerffel + * Copyright (c) 2005-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -49,6 +49,7 @@ #include "tooltip.h" #include "led_checkbox.h" #include "lcd_spinbox.h" +#include "automatable_model_templates.h" // platform-specific audio-interface-classes diff --git a/src/core/timeline.cpp b/src/core/timeline.cpp index 3c76e105f..abf735e97 100644 --- a/src/core/timeline.cpp +++ b/src/core/timeline.cpp @@ -3,7 +3,7 @@ /* * timeline.cpp - class timeLine, representing a time-line with position marker * - * Copyright (c) 2004-2007 Tobias Doerffel + * Copyright (c) 2004-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -40,6 +40,7 @@ #include "nstate_button.h" #include "main_window.h" #include "text_float.h" +#include "automatable_model_templates.h" diff --git a/src/lib/drumsynth.cpp b/src/lib/drumsynth.cpp index 509cd9d0f..8d64976c2 100644 --- a/src/lib/drumsynth.cpp +++ b/src/lib/drumsynth.cpp @@ -27,7 +27,8 @@ #include "drumsynth.h" #include -#include +#include +#include #include //sin(), exp(), etc. #include //sscanf(), sprintf() diff --git a/src/lib/mmp.cpp b/src/lib/mmp.cpp index 395bd8400..48fbead8c 100644 --- a/src/lib/mmp.cpp +++ b/src/lib/mmp.cpp @@ -36,6 +36,7 @@ #include "config_mgr.h" #include "project_version.h" #include "song_editor.h" +#include "automatable_model_templates.h" multimediaProject::typeDescStruct diff --git a/src/lib/project_journal.cpp b/src/lib/project_journal.cpp index f641a1634..b78ae7f09 100644 --- a/src/lib/project_journal.cpp +++ b/src/lib/project_journal.cpp @@ -3,7 +3,7 @@ /* * project_journal.cpp - implementation of project-journal * - * Copyright (c) 2006-2007 Tobias Doerffel + * Copyright (c) 2006-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -31,6 +31,7 @@ #include "engine.h" #include "journalling_object.h" #include "song_editor.h" +#include "automatable_model_templates.h" projectJournal::projectJournal( void ) : diff --git a/src/midi/midi_alsa_seq.cpp b/src/midi/midi_alsa_seq.cpp index 5dfabd59e..827d8fda9 100644 --- a/src/midi/midi_alsa_seq.cpp +++ b/src/midi/midi_alsa_seq.cpp @@ -3,7 +3,7 @@ /* * midi_alsa_seq.cpp - ALSA-sequencer-client * - * Copyright (c) 2005-2007 Tobias Doerffel + * Copyright (c) 2005-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -36,6 +36,7 @@ #include "song_editor.h" #include "midi_port.h" #include "note.h" +#include "automatable_model_templates.h" #ifdef ALSA_SUPPORT diff --git a/src/tracks/instrument_track.cpp b/src/tracks/instrument_track.cpp index d2bb1c1f6..4e2e4ab08 100644 --- a/src/tracks/instrument_track.cpp +++ b/src/tracks/instrument_track.cpp @@ -500,7 +500,7 @@ void instrumentTrack::processInEvent( const midiEvent & _me, notePlayHandle( this, _time.frames( engine::framesPerTact64th() ), - valueRanges::max / 2, + valueRanges::max() / 2, n ); if( engine::getMixer()->addPlayHandle( nph ) ) @@ -734,7 +734,7 @@ void instrumentTrack::setName( const QString & _new_name ) for( int i = 0; i < numOfTCOs(); ++i ) { pattern * p = dynamic_cast( getTCO( i ) ); - if( p != NULL && p->name() == m_name || p->name() == "" ) + if( ( p != NULL && p->name() == m_name ) || p->name() == "" ) { p->setName( _new_name ); } diff --git a/src/widgets/group_box.cpp b/src/widgets/group_box.cpp index 76c825490..0c84236b9 100644 --- a/src/widgets/group_box.cpp +++ b/src/widgets/group_box.cpp @@ -42,6 +42,7 @@ #include "embed.h" #include "gui_templates.h" +#include "automatable_model_templates.h" QPixmap * groupBox::s_ledBg = NULL;