changeset 1465:cee1be4fb8c1

Fix some compiler warnings
author Chris Cannam
date Tue, 15 May 2018 11:03:49 +0100
parents 91bb68146dfc
children f68911282993
files base/StorageAdviser.cpp data/fileio/CodedAudioFileReader.cpp data/fileio/FileSource.cpp data/fileio/MIDIFileReader.cpp data/midi/MIDIInput.cpp data/model/WritableWaveFileModel.cpp plugin/PiperVampPluginFactory.cpp plugin/plugins/SamplePlayer.cpp
diffstat 8 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/base/StorageAdviser.cpp	Fri May 11 14:11:04 2018 +0100
+++ b/base/StorageAdviser.cpp	Tue May 15 11:03:49 2018 +0100
@@ -83,7 +83,7 @@
     QString path;
     try {
         path = TempDirectory::getInstance()->getPath();
-    } catch (std::exception e) {
+    } catch (const std::exception &e) {
         SVDEBUG << "StorageAdviser::recommend: ERROR: Failed to get temporary directory path: " << e.what() << endl;
         int r = UseMemory | ConserveSpace;
         SVDEBUG << "StorageAdviser: returning fallback " << r
--- a/data/fileio/CodedAudioFileReader.cpp	Fri May 11 14:11:04 2018 +0100
+++ b/data/fileio/CodedAudioFileReader.cpp	Tue May 15 11:03:49 2018 +0100
@@ -228,7 +228,7 @@
                 m_cacheMode = CacheInMemory;
             }
 
-        } catch (DirectoryCreationFailed f) {
+        } catch (const DirectoryCreationFailed &f) {
             SVDEBUG << "CodedAudioFileReader::initialiseDecodeCache: failed to create temporary directory! Falling back to in-memory cache" << endl;
             m_cacheMode = CacheInMemory;
         }
--- a/data/fileio/FileSource.cpp	Fri May 11 14:11:04 2018 +0100
+++ b/data/fileio/FileSource.cpp	Tue May 15 11:03:49 2018 +0100
@@ -884,7 +884,7 @@
     QDir dir;
     try {
         dir = TempDirectory::getInstance()->getSubDirectoryPath("download");
-    } catch (DirectoryCreationFailed f) {
+    } catch (const DirectoryCreationFailed &f) {
 #ifdef DEBUG_FILE_SOURCE
         cerr << "FileSource::createCacheFile: ERROR: Failed to create temporary directory: " << f.what() << endl;
 #endif
--- a/data/fileio/MIDIFileReader.cpp	Fri May 11 14:11:04 2018 +0100
+++ b/data/fileio/MIDIFileReader.cpp	Tue May 15 11:03:49 2018 +0100
@@ -351,7 +351,7 @@
         m_numberOfTracks = i;
         retval = true;
 
-    } catch (MIDIException e) {
+    } catch (const MIDIException &e) {
 
         SVDEBUG << "MIDIFileReader::open() - caught exception - " << e.what() << endl;
         m_error = e.what();
--- a/data/midi/MIDIInput.cpp	Fri May 11 14:11:04 2018 +0100
+++ b/data/midi/MIDIInput.cpp	Tue May 15 11:03:49 2018 +0100
@@ -64,7 +64,7 @@
             }
         }
         
-    } catch (RtMidiError e) {
+    } catch (const RtMidiError &e) {
         SVCERR << "ERROR: RtMidi error: " << e.getMessage() << endl;
         delete m_rtmidi;
         m_rtmidi = 0;
--- a/data/model/WritableWaveFileModel.cpp	Fri May 11 14:11:04 2018 +0100
+++ b/data/model/WritableWaveFileModel.cpp	Tue May 15 11:03:49 2018 +0100
@@ -53,7 +53,7 @@
             QDir dir(TempDirectory::getInstance()->getPath());
             path = dir.filePath(QString("written_%1.wav")
                                 .arg((intptr_t)this));
-        } catch (DirectoryCreationFailed f) {
+        } catch (const DirectoryCreationFailed &f) {
             SVCERR << "WritableWaveFileModel: Failed to create temporary directory" << endl;
             return;
         }
--- a/plugin/PiperVampPluginFactory.cpp	Fri May 11 14:11:04 2018 +0100
+++ b/plugin/PiperVampPluginFactory.cpp	Tue May 15 11:03:49 2018 +0100
@@ -251,7 +251,7 @@
 
     try {
         resp = client.list(req);
-    } catch (piper_vamp::client::ServerCrashed) {
+    } catch (const piper_vamp::client::ServerCrashed &) {
         SVDEBUG << "PiperVampPluginFactory: Piper server crashed" << endl;
         errorMessage = QObject::tr
             ("External plugin host exited unexpectedly while listing plugins");
--- a/plugin/plugins/SamplePlayer.cpp	Fri May 11 14:11:04 2018 +0100
+++ b/plugin/plugins/SamplePlayer.cpp	Tue May 15 11:03:49 2018 +0100
@@ -271,7 +271,7 @@
     static DSSI_Program_Descriptor descriptor;
     static char name[60];
 
-    strncpy(name, player->m_samples[program].first.toLocal8Bit().data(), 60);
+    strncpy(name, player->m_samples[program].first.toLocal8Bit().data(), 59);
     name[59] = '\0';
 
     descriptor.Bank = 0;