# HG changeset patch # User Chris Cannam # Date 1526378629 -3600 # Node ID cee1be4fb8c1d0c03e5e3ff2b89c1804eba30026 # Parent 91bb68146dfced88f3988ea8a959a4f35116862e Fix some compiler warnings diff -r 91bb68146dfc -r cee1be4fb8c1 base/StorageAdviser.cpp --- 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 diff -r 91bb68146dfc -r cee1be4fb8c1 data/fileio/CodedAudioFileReader.cpp --- 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; } diff -r 91bb68146dfc -r cee1be4fb8c1 data/fileio/FileSource.cpp --- 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 diff -r 91bb68146dfc -r cee1be4fb8c1 data/fileio/MIDIFileReader.cpp --- 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(); diff -r 91bb68146dfc -r cee1be4fb8c1 data/midi/MIDIInput.cpp --- 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; diff -r 91bb68146dfc -r cee1be4fb8c1 data/model/WritableWaveFileModel.cpp --- 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; } diff -r 91bb68146dfc -r cee1be4fb8c1 plugin/PiperVampPluginFactory.cpp --- 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"); diff -r 91bb68146dfc -r cee1be4fb8c1 plugin/plugins/SamplePlayer.cpp --- 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;