From 07fe1cd6b87d67158188f2a1f07e7e66656812e5 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Wed, 3 Jul 2019 21:55:30 +0000 Subject: [PATCH] videoio: eliminate build warnings (clang) --- modules/videoio/src/cap_gstreamer.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/videoio/src/cap_gstreamer.cpp b/modules/videoio/src/cap_gstreamer.cpp index af947a8e16..e24758d326 100644 --- a/modules/videoio/src/cap_gstreamer.cpp +++ b/modules/videoio/src/cap_gstreamer.cpp @@ -97,6 +97,11 @@ static void handleMessage(GstElement * pipeline); namespace { +#if defined __clang__ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wunused-function" +#endif + template static inline void GSafePtr_addref(T* ptr) { if (ptr) @@ -125,6 +130,10 @@ template<> inline void GSafePtr_release(GstEncoding template<> inline void GSafePtr_addref(char* pPtr); // declaration only. not defined. should not be used template<> inline void GSafePtr_release(char** pPtr) { if (pPtr) { g_free(*pPtr); *pPtr = NULL; } } +#if defined __clang__ +# pragma clang diagnostic pop +#endif + template class GSafePtr {