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__); \ } 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();