From 2393d64a5ad7151cced97dd531af5ceb24f4399e Mon Sep 17 00:00:00 2001 From: Vojtech Bubnik Date: Tue, 9 Feb 2021 19:51:56 +0100 Subject: [PATCH] Fixed some OSX Objective C warnings. --- src/slic3r/GUI/InstanceCheckMac.mm | 6 +++--- src/slic3r/GUI/RemovableDriveManagerMM.mm | 10 +++++----- src/slic3r/Utils/RetinaHelperImpl.mm | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/slic3r/GUI/InstanceCheckMac.mm b/src/slic3r/GUI/InstanceCheckMac.mm index 9969b1a7b2..1d6f244e85 100644 --- a/src/slic3r/GUI/InstanceCheckMac.mm +++ b/src/slic3r/GUI/InstanceCheckMac.mm @@ -57,7 +57,7 @@ void OtherInstanceMessageHandler::register_for_messages(const std::string &versi m_impl_osx = [[OtherInstanceMessageHandlerMac alloc] init]; if(m_impl_osx) { NSString *nsver = [NSString stringWithCString:version_hash.c_str() encoding:[NSString defaultCStringEncoding]]; - [m_impl_osx add_observer:nsver]; + [(id)m_impl_osx add_observer:nsver]; } } @@ -65,7 +65,7 @@ void OtherInstanceMessageHandler::unregister_for_messages() { //NSLog(@"unreegistering other instance messages"); if (m_impl_osx) { - [m_impl_osx release]; + [(id)m_impl_osx release]; m_impl_osx = nullptr; } else { NSLog(@"warning: unregister instance InstanceCheck notifications not required"); @@ -75,7 +75,7 @@ void OtherInstanceMessageHandler::unregister_for_messages() void OtherInstanceMessageHandler::bring_instance_forward() { if (m_impl_osx) { - [m_impl_osx bring_forward]; + [(id)m_impl_osx bring_forward]; } } }//namespace GUI diff --git a/src/slic3r/GUI/RemovableDriveManagerMM.mm b/src/slic3r/GUI/RemovableDriveManagerMM.mm index 0b8646af17..0dbe38909c 100644 --- a/src/slic3r/GUI/RemovableDriveManagerMM.mm +++ b/src/slic3r/GUI/RemovableDriveManagerMM.mm @@ -69,7 +69,7 @@ static void unmount_callback(DADiskRef disk, DADissenterRef dissenter, void *con } if (err == 0) { CFTypeRef mediaEjectableKey = CFDictionaryGetValue(descDict,kDADiskDescriptionMediaEjectableKey); - BOOL ejectable = [mediaEjectableKey boolValue]; + BOOL ejectable = [(id)mediaEjectableKey boolValue]; CFTypeRef deviceProtocolName = CFDictionaryGetValue(descDict,kDADiskDescriptionDeviceProtocolKey); CFTypeRef deviceModelKey = CFDictionaryGetValue(descDict, kDADiskDescriptionDeviceModelKey); @@ -124,13 +124,13 @@ void RemovableDriveManager::register_window_osx() assert(m_impl_osx == nullptr); m_impl_osx = [[RemovableDriveManagerMM alloc] init]; if (m_impl_osx) - [m_impl_osx add_unmount_observer]; + [(id)m_impl_osx add_unmount_observer]; } void RemovableDriveManager::unregister_window_osx() { if (m_impl_osx) { - [m_impl_osx release]; + [(id)m_impl_osx release]; m_impl_osx = nullptr; } } @@ -144,7 +144,7 @@ void RemovableDriveManager::list_devices(std::vector &out) const { assert(m_impl_osx != nullptr); if (m_impl_osx) { - NSArray* devices = [m_impl_osx list_dev]; + NSArray* devices = [(id)m_impl_osx list_dev]; for (NSString* volumePath in devices) search_for_drives_internal::inspect_file(std::string([volumePath UTF8String]), "/Volumes", out); } @@ -156,7 +156,7 @@ void RemovableDriveManager::eject_device(const std::string &path) assert(m_impl_osx != nullptr); if (m_impl_osx) { NSString * pth = [NSString stringWithCString:path.c_str() encoding:[NSString defaultCStringEncoding]]; - [m_impl_osx eject_drive:pth]; + [(id)m_impl_osx eject_drive:pth]; } } diff --git a/src/slic3r/Utils/RetinaHelperImpl.mm b/src/slic3r/Utils/RetinaHelperImpl.mm index e33124f962..509029a10e 100644 --- a/src/slic3r/Utils/RetinaHelperImpl.mm +++ b/src/slic3r/Utils/RetinaHelperImpl.mm @@ -19,7 +19,7 @@ RetinaHelper::RetinaHelper(wxWindow *window) RetinaHelper::~RetinaHelper() { - [m_self release]; + [(id)m_self release]; } void RetinaHelper::set_use_retina(bool aValue)