From 511523ba36c737160dcf600b0951fbcfce722d63 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Thu, 11 Jan 2018 22:46:47 +0100 Subject: [PATCH 1/2] Silence unused exception warning --- support-lib/objc/DJIError.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support-lib/objc/DJIError.h b/support-lib/objc/DJIError.h index eeaa90ed8..bb2213a8d 100644 --- a/support-lib/objc/DJIError.h +++ b/support-lib/objc/DJIError.h @@ -30,6 +30,6 @@ namespace djinni { ::djinni::throwUnimplemented(__PRETTY_FUNCTION__, msg); #define DJINNI_TRANSLATE_EXCEPTIONS() \ - catch (const std::exception & e) { \ + catch (__unused const std::exception & e) { \ ::djinni::throwNSExceptionFromCurrent(__PRETTY_FUNCTION__); \ } From 23b35ebaa8595d4b3690f1ef6c6a1cc05084bea0 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Thu, 11 Jan 2018 22:47:06 +0100 Subject: [PATCH 2/2] Silence warning for NSNumber/NSValue bool comparison --- support-lib/objc/DJIMarshal+Private.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/support-lib/objc/DJIMarshal+Private.h b/support-lib/objc/DJIMarshal+Private.h index f0ff9d9a5..b5432917f 100644 --- a/support-lib/objc/DJIMarshal+Private.h +++ b/support-lib/objc/DJIMarshal+Private.h @@ -29,7 +29,7 @@ struct Bool { struct Boxed { using ObjcType = NSNumber*; - static CppType toCpp(ObjcType x) noexcept { assert(x); return Bool::toCpp([x boolValue]); } + static CppType toCpp(ObjcType x) noexcept { assert(x != nil); return Bool::toCpp([x boolValue]); } static ObjcType fromCpp(CppType x) noexcept { return [NSNumber numberWithBool:Bool::fromCpp(x)]; } }; }; @@ -44,7 +44,7 @@ struct Primitive { struct Boxed { using ObjcType = NSNumber*; - static CppType toCpp(ObjcType x) noexcept { assert(x); return static_cast(Self::unbox(x)); } + static CppType toCpp(ObjcType x) noexcept { assert(x != nil); return static_cast(Self::unbox(x)); } static ObjcType fromCpp(CppType x) noexcept { return Self::box(x); } }; }; @@ -233,7 +233,7 @@ class Optional { using Boxed = Optional; static CppType toCpp(ObjcType obj) { - if (obj) { + if (obj != nil) { return T::Boxed::toCpp(obj); } else { return CppType();