From f94bb2cb66bd1c8a55d2d38715aa250c972a9d4b Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Mon, 11 Feb 2008 15:12:42 +0000 Subject: [PATCH] fixed compilation issues with GCC 4.3 git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/branches/lmms/stable-0.3@690 0778d3d1-df1d-0410-868b-ea421aaaa00d --- ChangeLog | 29 +++++++++++++++++++ include/basic_filters.h | 2 +- include/config_mgr.h | 4 +-- include/dummy_effect.h | 12 ++++---- include/dummy_instrument.h | 12 ++++---- include/dummy_plugin.h | 12 ++++---- include/file_browser.h | 4 +-- include/instrument_track.h | 6 +--- include/journalling_object.h | 2 +- include/midi_time.h | 6 ++-- include/track.h | 4 +-- include/types.h | 18 +++++++----- .../audio_file_processor.cpp | 4 +-- plugins/ladspa_base/ladspa_manager.cpp | 4 +-- plugins/ladspa_effect/ladspa_effect.cpp | 1 + plugins/patman/patman.cpp | 2 +- plugins/vestige/vestige.cpp | 6 ++-- plugins/vst_base/lvsl_client.h | 8 ++--- src/audio/audio_file_ogg.cpp | 2 +- src/core/arp_and_chords_tab_widget.cpp | 3 +- src/core/export_project_dialog.cpp | 3 +- src/core/main_window.cpp | 3 +- src/core/preset_preview_play_handle.cpp | 2 +- src/lib/drumsynth.cpp | 2 ++ src/tracks/instrument_track.cpp | 19 ++++++------ src/tracks/pattern.cpp | 6 ++-- 26 files changed, 106 insertions(+), 70 deletions(-) diff --git a/ChangeLog b/ChangeLog index a1d15ec5e..f28fd0afc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,32 @@ +2008-02-11 Tobias Doerffel + + * plugins/audio_file_processor/audio_file_processor.cpp: + * plugins/ladspa_base/ladspa_manager.cpp: + * plugins/ladspa_effect/ladspa_effect.cpp: + * plugins/patman/patman.cpp: + * plugins/vestige/vestige.cpp: + * plugins/vst_base/lvsl_client.h: + * include/track.h: + * include/dummy_plugin.h: + * include/config_mgr.h: + * include/instrument_track.h: + * include/file_browser.h: + * include/dummy_instrument.h: + * include/midi_time.h: + * include/basic_filters.h: + * include/journalling_object.h: + * include/types.h: + * include/dummy_effect.h: + * src/audio/audio_file_ogg.cpp: + * src/core/arp_and_chords_tab_widget.cpp: + * src/core/preset_preview_play_handle.cpp: + * src/core/export_project_dialog.cpp: + * src/core/main_window.cpp: + * src/lib/drumsynth.cpp: + * src/tracks/instrument_track.cpp: + * src/tracks/pattern.cpp: + fixed compilation issues with GCC 4.3 + 2008-01-05 Tobias Doerffel * src/widgets/rack_view.cpp: diff --git a/include/basic_filters.h b/include/basic_filters.h index 1f4856446..c559b642c 100644 --- a/include/basic_filters.h +++ b/include/basic_filters.h @@ -238,7 +238,7 @@ public: } - inline void calcFilterCoeffs( float _freq, float _q + void calcFilterCoeffs( float _freq, float _q /*, const bool _q_is_bandwidth = FALSE*/ ) { // temp coef vars diff --git a/include/config_mgr.h b/include/config_mgr.h index fa57c9123..78450d160 100644 --- a/include/config_mgr.h +++ b/include/config_mgr.h @@ -1,7 +1,7 @@ /* * config_mgr.h - class configManager, a class for managing LMMS-configuration * - * Copyright (c) 2005-2007 Tobias Doerffel + * Copyright (c) 2005-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -73,7 +73,7 @@ class configManager : public QDialog { Q_OBJECT public: - static inline configManager * inst( void ) + static configManager * inst( void ) { if( s_instanceOfMe == NULL ) { diff --git a/include/dummy_effect.h b/include/dummy_effect.h index 435b4ae00..1e625a63b 100644 --- a/include/dummy_effect.h +++ b/include/dummy_effect.h @@ -55,30 +55,30 @@ public: class dummyEffect : public effect { public: - inline dummyEffect( void ) : + dummyEffect( void ) : effect( NULL, NULL ) { } - inline virtual ~dummyEffect() + virtual ~dummyEffect() { } - inline virtual void saveSettings( QDomDocument &, QDomElement & ) + virtual void FASTCALL saveSettings( QDomDocument &, QDomElement & ) { } - inline virtual void loadSettings( const QDomElement & ) + virtual void FASTCALL loadSettings( const QDomElement & ) { } - inline virtual QString nodeName( void ) const + virtual QString nodeName( void ) const { return( "dummyeffect" ); } - inline virtual effectControlDialog * createControlDialog( track * ) + virtual effectControlDialog * createControlDialog( track * ) { return( new dummyEffectControlDialog( this ) ); } diff --git a/include/dummy_instrument.h b/include/dummy_instrument.h index dd9fa4212..d8723e639 100644 --- a/include/dummy_instrument.h +++ b/include/dummy_instrument.h @@ -2,7 +2,7 @@ * dummy_instrument.h - instrument used as fallback if an instrument couldn't * be loaded * - * Copyright (c) 2005-2006 Tobias Doerffel + * Copyright (c) 2005-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -33,25 +33,25 @@ class dummyInstrument : public instrument { public: - inline dummyInstrument( instrumentTrack * _channel_track ) : + dummyInstrument( instrumentTrack * _channel_track ) : instrument( _channel_track, NULL ) { } - inline virtual ~dummyInstrument() + virtual ~dummyInstrument() { } - inline virtual void saveSettings( QDomDocument &, QDomElement & ) + virtual void FASTCALL saveSettings( QDomDocument &, QDomElement & ) { } - inline virtual void loadSettings( const QDomElement & ) + virtual void FASTCALL loadSettings( const QDomElement & ) { } - inline virtual QString nodeName( void ) const + virtual QString nodeName( void ) const { return( "dummyinstrument" ); } diff --git a/include/dummy_plugin.h b/include/dummy_plugin.h index 6dcc413d0..2fde634f1 100644 --- a/include/dummy_plugin.h +++ b/include/dummy_plugin.h @@ -2,7 +2,7 @@ * dummy_plugin.h - empty plugin which is used as fallback if a plugin couldn't * be found * - * Copyright (c) 2005-2007 Tobias Doerffel + * Copyright (c) 2005-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -33,25 +33,25 @@ class dummyPlugin : public plugin { public: - inline dummyPlugin( void ) : + dummyPlugin( void ) : plugin( NULL ) { } - inline virtual ~dummyPlugin() + virtual ~dummyPlugin() { } - inline virtual void saveSettings( QDomDocument &, QDomElement & ) + virtual void FASTCALL saveSettings( QDomDocument &, QDomElement & ) { } - inline virtual void loadSettings( const QDomElement & ) + virtual void FASTCALL loadSettings( const QDomElement & ) { } - inline virtual QString nodeName( void ) const + virtual QString nodeName( void ) const { return( "dummyplugin" ); } diff --git a/include/file_browser.h b/include/file_browser.h index 00339bce8..3aac6ac54 100644 --- a/include/file_browser.h +++ b/include/file_browser.h @@ -1,7 +1,7 @@ /* * file_browser.h - include file for fileBrowser * - * Copyright (c) 2004-2007 Tobias Doerffel + * Copyright (c) 2004-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -223,7 +223,7 @@ public: const QString & _path ); #endif - inline QString fullName( void ) const + QString fullName( void ) const { return( QDir::cleanPath( m_path ) + QDir::separator() + text( 0 ) ); diff --git a/include/instrument_track.h b/include/instrument_track.h index df47fb530..8618abfa1 100644 --- a/include/instrument_track.h +++ b/include/instrument_track.h @@ -106,11 +106,7 @@ public: void FASTCALL deleteNotePluginData( notePlayHandle * _n ); // name-stuff - inline const QString & name( void ) const - { - return( m_name ); - } - void FASTCALL setName( const QString & _new_name ); + virtual void setName( const QString & _new_name ); // volume & surround-position-stuff void FASTCALL setVolume( volume _new_volume ); diff --git a/include/journalling_object.h b/include/journalling_object.h index 0de9ced1f..0e6fe4bfb 100644 --- a/include/journalling_object.h +++ b/include/journalling_object.h @@ -115,7 +115,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/midi_time.h b/include/midi_time.h index 03757a4f9..6292d0398 100644 --- a/include/midi_time.h +++ b/include/midi_time.h @@ -2,7 +2,7 @@ * midi_time.h - declaration of class midiTime which provides data-type for * position- and length-variables * - * Copyright (c) 2004-2006 Tobias Doerffel + * Copyright (c) 2004-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -39,7 +39,7 @@ public: { } - inline midiTime( const Sint32 _abs = 0 ) : + midiTime( const Sint32 _abs = 0 ) : m_tact( _abs / 64 ), m_tact64th( _abs % 64 ) { @@ -50,7 +50,7 @@ public: *this = _t; } - inline midiTime toNearestTact( void ) const + midiTime toNearestTact( void ) const { if( m_tact64th >= 32 ) { diff --git a/include/track.h b/include/track.h index 4ffcdc3ae..ad50f6be2 100644 --- a/include/track.h +++ b/include/track.h @@ -2,7 +2,7 @@ * track.h - declaration of classes concerning tracks -> neccessary for all * track-like objects (beat/bassline, sample-track...) * - * Copyright (c) 2004-2007 Tobias Doerffel + * Copyright (c) 2004-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -498,7 +498,7 @@ public: { return( m_name ); } - inline virtual void setName( const QString & _new_name ) + virtual void setName( const QString & _new_name ) { m_name = _new_name; } 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/audio_file_processor/audio_file_processor.cpp b/plugins/audio_file_processor/audio_file_processor.cpp index 6fd6d6207..695c809cb 100644 --- a/plugins/audio_file_processor/audio_file_processor.cpp +++ b/plugins/audio_file_processor/audio_file_processor.cpp @@ -1,7 +1,7 @@ /* * audio_file_processor.cpp - instrument for using audio-files * - * Copyright (c) 2004-2007 Tobias Doerffel + * Copyright (c) 2004-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -370,7 +370,7 @@ void audioFileProcessor::setAudioFile( const QString & _audio_file, bool _rename { // is current channel-name equal to previous-filename?? if( _rename && - ( getInstrumentTrack()->name() == + ( getInstrumentTrack()->track::name() == QFileInfo( m_sampleBuffer.audioFile() ).fileName() || m_sampleBuffer.audioFile() == "" ) ) { diff --git a/plugins/ladspa_base/ladspa_manager.cpp b/plugins/ladspa_base/ladspa_manager.cpp index 273ac2b6b..badaa1ad1 100644 --- a/plugins/ladspa_base/ladspa_manager.cpp +++ b/plugins/ladspa_base/ladspa_manager.cpp @@ -2,7 +2,7 @@ * ladspa_manager.cpp - a class to manage loading and instantiation * of ladspa plugins * - * Copyright (c) 2005-2007 Danny McRae + * Copyright (c) 2005-2008 Danny McRae * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -42,7 +42,7 @@ #endif - +#include #include #include "config_mgr.h" diff --git a/plugins/ladspa_effect/ladspa_effect.cpp b/plugins/ladspa_effect/ladspa_effect.cpp index 9f16eef2a..b1efd3670 100644 --- a/plugins/ladspa_effect/ladspa_effect.cpp +++ b/plugins/ladspa_effect/ladspa_effect.cpp @@ -36,6 +36,7 @@ #endif +#include #include "ladspa_effect.h" #include "mixer.h" diff --git a/plugins/patman/patman.cpp b/plugins/patman/patman.cpp index 46a58e9ef..e68bef1f9 100644 --- a/plugins/patman/patman.cpp +++ b/plugins/patman/patman.cpp @@ -417,7 +417,7 @@ void patmanSynth::setFile( const QString & _patch_file, bool _rename ) { // is current channel-name equal to previous-filename?? if( _rename && - ( getInstrumentTrack()->name() == + ( getInstrumentTrack()->track::name() == QFileInfo( m_patchFile ).fileName() || m_patchFile == "" ) ) { diff --git a/plugins/vestige/vestige.cpp b/plugins/vestige/vestige.cpp index d81e03578..afd041fbf 100644 --- a/plugins/vestige/vestige.cpp +++ b/plugins/vestige/vestige.cpp @@ -1,7 +1,7 @@ /* * vestige.cpp - instrument-plugin for hosting VST-plugins * - * Copyright (c) 2005-2007 Tobias Doerffel + * Copyright (c) 2005-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -220,8 +220,8 @@ void vestigeInstrument::setParameter( const QString & _param, { m_pluginMutex.lock(); const bool set_ch_name = ( m_plugin != NULL && - getInstrumentTrack()->name() == m_plugin->name() ) || - getInstrumentTrack()->name() == + getInstrumentTrack()->track::name() == m_plugin->name() ) || + getInstrumentTrack()->track::name() == instrumentTrack::tr( "Default" ); m_pluginMutex.unlock(); diff --git a/plugins/vst_base/lvsl_client.h b/plugins/vst_base/lvsl_client.h index d3c0f8f97..c38976e81 100644 --- a/plugins/vst_base/lvsl_client.h +++ b/plugins/vst_base/lvsl_client.h @@ -1,7 +1,7 @@ /* * lvsl_client.h - client for LVSL Server * - * Copyright (c) 2005-2007 Tobias Doerffel + * Copyright (c) 2005-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -116,10 +116,10 @@ public: return( m_failed ); } - virtual void loadSettings( const QDomElement & _this ); - virtual void saveSettings( QDomDocument & _doc, QDomElement & _this ); + virtual void FASTCALL loadSettings( const QDomElement & _this ); + virtual void FASTCALL saveSettings( QDomDocument & _doc, QDomElement & _this ); - inline virtual QString nodeName( void ) const + virtual QString nodeName( void ) const { return( "vstplugin" ); } diff --git a/src/audio/audio_file_ogg.cpp b/src/audio/audio_file_ogg.cpp index a3637211c..ec1b95334 100644 --- a/src/audio/audio_file_ogg.cpp +++ b/src/audio/audio_file_ogg.cpp @@ -80,7 +80,7 @@ inline Sint32 audioFileOgg::writePage( void ) bool audioFileOgg::startEncoding( void ) { vorbis_comment vc; - char * comments = "Cool=This song has been made using Linux " + char * comments = (char *) "Cool=This song has been made using Linux " "MultiMedia Studio"; Sint32 comment_length = strlen( comments ); diff --git a/src/core/arp_and_chords_tab_widget.cpp b/src/core/arp_and_chords_tab_widget.cpp index 1fdb36b50..b202c4a1d 100644 --- a/src/core/arp_and_chords_tab_widget.cpp +++ b/src/core/arp_and_chords_tab_widget.cpp @@ -4,7 +4,7 @@ * arp_and_chords_tab_widget.cpp - widget for use in arp/chord-tab of * instrument-track-window * - * Copyright (c) 2004-2007 Tobias Doerffel + * Copyright (c) 2004-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -41,6 +41,7 @@ #endif +#include #include "arp_and_chords_tab_widget.h" #include "combobox.h" diff --git a/src/core/export_project_dialog.cpp b/src/core/export_project_dialog.cpp index cf3dae63a..5af1258e3 100644 --- a/src/core/export_project_dialog.cpp +++ b/src/core/export_project_dialog.cpp @@ -3,7 +3,7 @@ /* * export_project_dialog.cpp - implementation of dialog for exporting project * - * Copyright (c) 2004-2007 Tobias Doerffel + * Copyright (c) 2004-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -48,6 +48,7 @@ #endif +#include #include "export_project_dialog.h" #include "song_editor.h" diff --git a/src/core/main_window.cpp b/src/core/main_window.cpp index cbd11ad18..c9b6df05c 100644 --- a/src/core/main_window.cpp +++ b/src/core/main_window.cpp @@ -3,7 +3,7 @@ /* * main_window.cpp - implementation of LMMS-main-window * - * Copyright (c) 2004-2007 Tobias Doerffel + * Copyright (c) 2004-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -61,6 +61,7 @@ #include #endif +#include #include "main_window.h" #include "bb_editor.h" diff --git a/src/core/preset_preview_play_handle.cpp b/src/core/preset_preview_play_handle.cpp index 3819ce15c..ea3828b78 100644 --- a/src/core/preset_preview_play_handle.cpp +++ b/src/core/preset_preview_play_handle.cpp @@ -154,7 +154,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/lib/drumsynth.cpp b/src/lib/drumsynth.cpp index e33e2a1bb..4ce3860af 100644 --- a/src/lib/drumsynth.cpp +++ b/src/lib/drumsynth.cpp @@ -10,6 +10,8 @@ #include #include +#include +#include #include //sin(), exp(), etc. #include //sscanf(), sprintf() diff --git a/src/tracks/instrument_track.cpp b/src/tracks/instrument_track.cpp index 1e7319135..3ee0a42c6 100644 --- a/src/tracks/instrument_track.cpp +++ b/src/tracks/instrument_track.cpp @@ -4,7 +4,7 @@ * instrument_track.cpp - implementation of instrument-track-class * (window + data-structures) * - * Copyright (c) 2004-2007 Tobias Doerffel + * Copyright (c) 2004-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -63,6 +63,7 @@ #include "instrument_track.h" #include "arp_and_chords_tab_widget.h" #include "audio_port.h" +#include "automatable_object_templates.h" #include "automation_pattern.h" #include "config_mgr.h" #include "debug.h" @@ -631,7 +632,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 ) ) @@ -873,19 +874,19 @@ void instrumentTrack::setName( const QString & _new_name ) } } - m_name = _new_name; - setWindowTitle( m_name ); + track::setName( _new_name ); + setWindowTitle( _new_name ); if( m_instrumentNameLE->text() != _new_name ) { - m_instrumentNameLE->setText( m_name ); + m_instrumentNameLE->setText( _new_name ); } #ifdef LMMS_DEBUG assert( m_tswInstrumentTrackButton != NULL ); #endif - m_tswInstrumentTrackButton->setText( m_name ); - m_midiPort->setName( m_name ); - m_audioPort->setName( m_name ); + m_tswInstrumentTrackButton->setText( _new_name ); + m_midiPort->setName( _new_name ); + m_audioPort->setName( _new_name ); } @@ -1145,7 +1146,7 @@ trackContentObject * instrumentTrack::createTCO( const midiTime & ) void instrumentTrack::saveTrackSpecificSettings( QDomDocument & _doc, QDomElement & _this ) { - _this.setAttribute( "name", name() ); + _this.setAttribute( "name", track::name() ); m_volumeKnob->saveSettings( _doc, _this, "vol" ); m_surroundArea->saveSettings( _doc, _this, "surpos" ); diff --git a/src/tracks/pattern.cpp b/src/tracks/pattern.cpp index 4d41dd5f0..b87e09a44 100644 --- a/src/tracks/pattern.cpp +++ b/src/tracks/pattern.cpp @@ -3,7 +3,7 @@ /* * pattern.cpp - implementation of class pattern which holds notes * - * Copyright (c) 2004-2007 Tobias Doerffel + * Copyright (c) 2004-2008 Tobias Doerffel * Copyright (c) 2005-2007 Danny McRae * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net @@ -86,7 +86,7 @@ pattern::pattern ( instrumentTrack * _instrument_track ) : m_needsUpdate( TRUE ), m_instrumentTrack( _instrument_track ), m_patternType( BEAT_PATTERN ), - m_name( _instrument_track->name() ), + m_name( _instrument_track->track::name() ), m_steps( DEFAULT_STEPS_PER_TACT ), m_frozenPattern( NULL ), m_freezing( FALSE ), @@ -499,7 +499,7 @@ void pattern::clear( void ) void pattern::resetName( void ) { - m_name = m_instrumentTrack->name(); + m_name = m_instrumentTrack->track::name(); }