From bc996fe17c35d85526e254b34e783555a5662c8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Devernay?= Date: Sat, 29 Jun 2019 19:15:47 -0700 Subject: [PATCH] fix warnings --- Engine/AppManager.cpp | 10 +++++----- Engine/OfxHost.cpp | 12 ++++++------ Engine/Project.cpp | 2 +- Engine/Settings.cpp | 6 +++--- Engine/pch.h | 3 +++ 5 files changed, 18 insertions(+), 15 deletions(-) diff --git a/Engine/AppManager.cpp b/Engine/AppManager.cpp index 826714a11a..1133106499 100644 --- a/Engine/AppManager.cpp +++ b/Engine/AppManager.cpp @@ -1072,7 +1072,7 @@ AppManager::loadInternalAfterInitGui(const CLArgs& cl) _imp->_diskCache = boost::make_shared >("DiskCache", NATRON_CACHE_VERSION, maxDiskCacheNode, 0.); _imp->_viewerCache = boost::make_shared >("ViewerCache", NATRON_CACHE_VERSION, viewerCacheSize, 0.); _imp->setViewerCacheTileSize(); - } catch (std::logic_error) { + } catch (std::logic_error&) { // ignore } @@ -1100,7 +1100,7 @@ AppManager::loadInternalAfterInitGui(const CLArgs& cl) ///Set host properties after restoring settings since it depends on the host name. try { _imp->ofxHost->setProperties(); - } catch (std::logic_error) { + } catch (std::logic_error&) { // ignore } @@ -1108,7 +1108,7 @@ AppManager::loadInternalAfterInitGui(const CLArgs& cl) try { loadAllPlugins(); _imp->loadBuiltinFormats(); - } catch (std::logic_error) { + } catch (std::logic_error&) { // ignore } @@ -1167,13 +1167,13 @@ AppManager::loadInternalAfterInitGui(const CLArgs& cl) if (!wasKilled) { try { mainInstance->getProject()->reset(true/*aboutToQuit*/, true /*blocking*/); - } catch (std::logic_error) { + } catch (std::logic_error&) { // ignore } try { mainInstance->quitNow(); - } catch (std::logic_error) { + } catch (std::logic_error&) { // ignore } } diff --git a/Engine/OfxHost.cpp b/Engine/OfxHost.cpp index 4b0d5ba559..06f1645dac 100644 --- a/Engine/OfxHost.cpp +++ b/Engine/OfxHost.cpp @@ -898,7 +898,7 @@ OfxHost::loadOFXPlugins(IOPluginsMap* readersMap, pluginCache->addFileToPath(natronBundledPluginsPath); } } - } catch (std::logic_error) { + } catch (std::logic_error&) { // ignore } @@ -1539,7 +1539,7 @@ OfxHost::mutexCreate(OfxMutexHandle *mutex, #endif return kOfxStatOK; - } catch (std::bad_alloc) { + } catch (std::bad_alloc&) { qDebug() << "mutexCreate(): memory error."; return kOfxStatErrMemory; @@ -1580,7 +1580,7 @@ OfxHost::mutexDestroy(const OfxMutexHandle mutex) #endif return kOfxStatOK; - } catch (std::bad_alloc) { + } catch (std::bad_alloc&) { qDebug() << "mutexDestroy(): memory error."; return kOfxStatErrMemory; @@ -1610,7 +1610,7 @@ OfxHost::mutexLock(const OfxMutexHandle mutex) reinterpret_cast(mutex)->lock(); return kOfxStatOK; - } catch (std::bad_alloc) { + } catch (std::bad_alloc&) { qDebug() << "mutexLock(): memory error."; return kOfxStatErrMemory; @@ -1639,7 +1639,7 @@ OfxHost::mutexUnLock(const OfxMutexHandle mutex) reinterpret_cast(mutex)->unlock(); return kOfxStatOK; - } catch (std::bad_alloc) { + } catch (std::bad_alloc&) { qDebug() << "mutexUnLock(): memory error."; return kOfxStatErrMemory; @@ -1671,7 +1671,7 @@ OfxHost::mutexTryLock(const OfxMutexHandle mutex) } else { return kOfxStatFailed; } - } catch (std::bad_alloc) { + } catch (std::bad_alloc&) { qDebug() << "mutexTryLock(): memory error."; return kOfxStatErrMemory; diff --git a/Engine/Project.cpp b/Engine/Project.cpp index 77e8f4b1c8..b871dfba6d 100644 --- a/Engine/Project.cpp +++ b/Engine/Project.cpp @@ -2511,7 +2511,7 @@ Project::onOCIOConfigPathChanged(const std::string& path, _imp->envVars->setValue(newEnv); } endChanges(block); - } catch (std::logic_error) { + } catch (std::logic_error&) { // ignore } } diff --git a/Engine/Settings.cpp b/Engine/Settings.cpp index b3d7b82a12..23ac5c5410 100644 --- a/Engine/Settings.cpp +++ b/Engine/Settings.cpp @@ -1962,7 +1962,7 @@ Settings::saveSettings(const std::vector& knobs, } else { assert(false); } - } catch (std::logic_error) { + } catch (std::logic_error&) { // ignore } } // for (int j = 0; j < knobs[i]->getDimension(); ++j) { @@ -2121,7 +2121,7 @@ Settings::restoreSettings(bool useDefault) appPTR->setNThreadsToRender( getNumberOfThreads() ); appPTR->setUseThreadPool( _useThreadPool->getValue() ); appPTR->setPluginsUseInputImageCopyToRender( _pluginUseImageCopyForSource->getValue() ); - } catch (std::logic_error) { + } catch (std::logic_error&) { // ignore } @@ -2706,7 +2706,7 @@ Settings::getOpenFXPluginsSearchPaths(std::list* paths) const assert(paths); try { _extraPluginPaths->getPaths(paths); - } catch (std::logic_error) { + } catch (std::logic_error&) { paths->clear(); } } diff --git a/Engine/pch.h b/Engine/pch.h index 5d080aedbe..d92029c4d8 100644 --- a/Engine/pch.h +++ b/Engine/pch.h @@ -101,6 +101,9 @@ GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_ON #include "Global/Macros.h" GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF +GCC_ONLY_DIAG_OFF(class-memaccess) +#include +GCC_ONLY_DIAG_ON(class-memaccess) #include GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_ON