From 6a1a295cecf922415acd13119021910fcc89b2f8 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Fri, 21 Mar 2014 11:14:22 +0100 Subject: [PATCH] More CLANG compiler warning fixes --- include/AudioPortAudio.h | 1 - include/AutomatableModel.h | 18 ++++++------ include/ControllerRackView.h | 3 -- include/DummyInstrument.h | 4 +-- include/RemotePlugin.h | 2 -- include/TempoSyncKnobModel.h | 4 +-- include/shared_object.h | 38 ++++++++++++++------------ include/track.h | 2 -- src/gui/widgets/ControllerRackView.cpp | 5 ++-- 9 files changed, 36 insertions(+), 41 deletions(-) diff --git a/include/AudioPortAudio.h b/include/AudioPortAudio.h index 93e86f13d..04b0d3590 100644 --- a/include/AudioPortAudio.h +++ b/include/AudioPortAudio.h @@ -88,7 +88,6 @@ public: private: comboBox * m_backend; comboBox * m_device; - LcdSpinBox * m_channels; AudioPortAudioSetupUtil m_setupUtil; } ; diff --git a/include/AutomatableModel.h b/include/AutomatableModel.h index 7e9c9e891..f390d2531 100644 --- a/include/AutomatableModel.h +++ b/include/AutomatableModel.h @@ -195,11 +195,11 @@ public: /*! \brief Saves settings (value, automation links and controller connections) of AutomatableModel into specified DOM element using as attribute/node name */ - void saveSettings( QDomDocument& doc, QDomElement& element, const QString& name ); + virtual void saveSettings( QDomDocument& doc, QDomElement& element, const QString& name ); /*! \brief Loads settings (value, automation links and controller connections) of AutomatableModel from specified DOM element using as attribute/node name */ - void loadSettings( const QDomElement& element, const QString& name ); + virtual void loadSettings( const QDomElement& element, const QString& name ); virtual QString nodeName() const { @@ -236,6 +236,13 @@ public slots: protected: + virtual void redoStep( JournalEntry& je ); + virtual void undoStep( JournalEntry& je ); + + float fittedValue( float value ) const; + + +private: virtual void saveSettings( QDomDocument& doc, QDomElement& element ) { saveSettings( doc, element, "value" ); @@ -246,13 +253,6 @@ protected: loadSettings( element, "value" ); } - virtual void redoStep( JournalEntry& je ); - virtual void undoStep( JournalEntry& je ); - - float fittedValue( float value ) const; - - -private: void linkModel( AutomatableModel* model ); void unlinkModel( AutomatableModel* model ); diff --git a/include/ControllerRackView.h b/include/ControllerRackView.h index f7a3282be..60c8f0735 100644 --- a/include/ControllerRackView.h +++ b/include/ControllerRackView.h @@ -65,11 +65,8 @@ private slots: private: QVector m_controllerViews; - QVBoxLayout * m_mainLayout; QScrollArea * m_scrollArea; QPushButton * m_addButton; - - int m_lastY; } ; diff --git a/include/DummyInstrument.h b/include/DummyInstrument.h index 091fedc0e..ee9e5d31a 100644 --- a/include/DummyInstrument.h +++ b/include/DummyInstrument.h @@ -2,7 +2,7 @@ * DummyInstrument.h - instrument used as fallback if an instrument couldn't * be loaded * - * Copyright (c) 2005-2009 Tobias Doerffel + * Copyright (c) 2005-2014 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -42,7 +42,7 @@ public: { } - virtual void playNote( NotePlayHandle *, bool, sampleFrame * ) + virtual void playNote( NotePlayHandle *, sampleFrame * ) { } diff --git a/include/RemotePlugin.h b/include/RemotePlugin.h index 0da674289..edf09efbe 100644 --- a/include/RemotePlugin.h +++ b/include/RemotePlugin.h @@ -474,7 +474,6 @@ private: #else int m_shmID; #endif - size_t m_shmSize; shmData * m_data; #ifdef USE_QT_SEMAPHORES QSystemSemaphore m_dataSem; @@ -780,7 +779,6 @@ private: void resizeSharedProcessingMemory(); - bool m_initialized; bool m_failed; QProcess m_process; diff --git a/include/TempoSyncKnobModel.h b/include/TempoSyncKnobModel.h index 0bb9c261f..4c0461e24 100644 --- a/include/TempoSyncKnobModel.h +++ b/include/TempoSyncKnobModel.h @@ -53,8 +53,8 @@ public: const QString & _display_name = QString() ); virtual ~TempoSyncKnobModel(); - virtual void saveSettings( QDomDocument & _doc, QDomElement & _this, const QString& name = "value" ); - virtual void loadSettings( const QDomElement & _this, const QString& name = "value" ); + void saveSettings( QDomDocument & _doc, QDomElement & _this, const QString& name ); + void loadSettings( const QDomElement & _this, const QString& name ); TempoSyncMode syncMode() const { diff --git a/include/shared_object.h b/include/shared_object.h index a02e933f4..a0d461539 100644 --- a/include/shared_object.h +++ b/include/shared_object.h @@ -2,8 +2,8 @@ * shared_object.h - class sharedObject for use among other objects * * Copyright (c) 2006-2007 Javier Serrano Polo - * Copyright (c) 2008 Tobias Doerffel - * + * Copyright (c) 2008-2014 Tobias Doerffel + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -23,10 +23,8 @@ * */ - -#ifndef _SHARED_OBJECT_H -#define _SHARED_OBJECT_H - +#ifndef SHARED_OBJECT_H +#define SHARED_OBJECT_H #include @@ -45,27 +43,33 @@ public: } template - static T * ref( T * _object ) + static T* ref( T* object ) { - _object->m_lock.lock(); + object->m_lock.lock(); // TODO: Use QShared - ++_object->m_referenceCount; - _object->m_lock.unlock(); - return( _object ); + ++object->m_referenceCount; + object->m_lock.unlock(); + return object; } template - static void unref( T * _object ) + static void unref( T* object ) { - _object->m_lock.lock(); - bool delete_object = --_object->m_referenceCount <= 0; - _object->m_lock.unlock(); - if ( delete_object ) + object->m_lock.lock(); + bool deleteObject = --object->m_referenceCount <= 0; + object->m_lock.unlock(); + + if ( deleteObject ) { - delete _object; + delete object; } } + // keep clang happy which complaines about unused member variable + void dummy() + { + m_referenceCount = 0; + } private: int m_referenceCount; diff --git a/include/track.h b/include/track.h index 273c77710..b5a4b3e67 100644 --- a/include/track.h +++ b/include/track.h @@ -307,8 +307,6 @@ private: typedef QVector tcoViewVector; tcoViewVector m_tcoViews; - int m_pixelsPerTact; - QPixmap m_background; } ; diff --git a/src/gui/widgets/ControllerRackView.cpp b/src/gui/widgets/ControllerRackView.cpp index 85116f7ac..97ce687fe 100644 --- a/src/gui/widgets/ControllerRackView.cpp +++ b/src/gui/widgets/ControllerRackView.cpp @@ -2,7 +2,7 @@ * ControllerRackView.cpp - view for song's controllers * * Copyright (c) 2008-2009 Paul Giblock - * Copyright (c) 2010-2011 Tobias Doerffel + * Copyright (c) 2010-2014 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -42,8 +42,7 @@ ControllerRackView::ControllerRackView( ) : - QWidget(), - m_lastY( 0 ) + QWidget() { setMinimumWidth( 250 ); setMaximumWidth( 250 );