From 1c9262dce4af416c21bdfc869357bc575d718839 Mon Sep 17 00:00:00 2001 From: apavlenko Date: Mon, 21 Nov 2016 12:31:48 +0300 Subject: [PATCH] hiding silly warnings --- 3rdparty/openvx/include/ivx.hpp | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/3rdparty/openvx/include/ivx.hpp b/3rdparty/openvx/include/ivx.hpp index cd36e07..2d3275d 100644 --- a/3rdparty/openvx/include/ivx.hpp +++ b/3rdparty/openvx/include/ivx.hpp @@ -81,6 +81,21 @@ Details: TBD #include "opencv2/core.hpp" #endif +// disabling false alarm warnings +#if defined(_MSC_VER) + #pragma warning(push) + //#pragma warning( disable : 4??? ) +#elif defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wunused-local-typedef" + #pragma clang diagnostic ignored "-Wmissing-prototypes" +#elif defined(__GNUC__) + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wunused-local-typedefs" + #pragma GCC diagnostic ignored "-Wunused-value" + #pragma GCC diagnostic ignored "-Wmissing-declarations" +#endif // compiler macro + namespace ivx { @@ -273,12 +288,12 @@ template <> struct RefTypeTraits /// Casting to vx_reference with compile-time check // takes 'vx_reference' itself and RefWrapper via 'operator vx_reference()' -vx_reference castToReference(vx_reference ref) +inline vx_reference castToReference(vx_reference ref) { return ref; } // takes vx_reference extensions that have RefTypeTraits specializations template -vx_reference castToReference(const T& ref, typename RefTypeTraits::vxType dummy = 0) +inline vx_reference castToReference(const T& ref, typename RefTypeTraits::vxType dummy = 0) { (void)dummy; return (vx_reference)ref; } #else @@ -302,7 +317,7 @@ struct is_ref::vxTypeEnum, void())> : std::true_typ /// Casting to vx_reference with compile-time check template -vx_reference castToReference(const T& obj) +inline vx_reference castToReference(const T& obj) { static_assert(is_ref::value, "unsupported conversion"); return (vx_reference) obj; @@ -1162,12 +1177,12 @@ static const vx_enum /// vxCopyImagePatch() wrapper (or vxAccessImagePatch() + vxCommitImagePatch() for OpenVX 1.0) void copy( vx_uint32 planeIdx, vx_rectangle_t rect, const vx_imagepatch_addressing_t& addr, void* data, - vx_enum usage, vx_enum memType = VX_MEMORY_TYPE_HOST ) + vx_enum usage, vx_enum memoryType = VX_MEMORY_TYPE_HOST ) { #ifdef VX_VERSION_1_1 - IVX_CHECK_STATUS(vxCopyImagePatch(ref, &rect, planeIdx, &addr, (void*)data, usage, memType)); + IVX_CHECK_STATUS(vxCopyImagePatch(ref, &rect, planeIdx, &addr, (void*)data, usage, memoryType)); #else - (void)memType; + (void)memoryType; vx_imagepatch_addressing_t* a = const_cast(&addr); IVX_CHECK_STATUS(vxAccessImagePatch(ref, &rect, planeIdx, a, &data, usage)); IVX_CHECK_STATUS(vxCommitImagePatch(ref, &rect, planeIdx, a, data)); @@ -1653,4 +1668,13 @@ Node gaussian3x3(vx_graph graph, vx_image inImg, vx_image outImg) } // namespace ivx +// restore warnings +#if defined(_MSC_VER) + #pragma warning(pop) +#elif defined(__clang__) + #pragma clang diagnostic pop +#elif defined(__GNUC__) + #pragma GCC diagnostic pop +#endif // compiler macro + #endif //IVX_HPP -- 2.7.4