diff --git a/src/Environment/Apple/AppleUtils.mm b/src/Environment/Apple/AppleUtils.mm index a20948726e..12763cbfa8 100644 --- a/src/Environment/Apple/AppleUtils.mm +++ b/src/Environment/Apple/AppleUtils.mm @@ -65,7 +65,7 @@ bool AppleGetUserDefaultsString( const Char * _key, Char * const _value, size_t return false; } - NSString * value = [defaults objectForKey:[[NSString alloc] initWithUTF8String:_key]]; + NSString * _Nullable value = [defaults objectForKey:@(_key)]; if( value == nil ) { @@ -88,7 +88,7 @@ bool AppleSetUserDefaultsString( const Char * _key, const Char * _value ) return false; } - [defaults setObject:[[NSString alloc] initWithUTF8String:_value] forKey:[[NSString alloc] initWithUTF8String:_key]]; + [defaults setObject:@(_value) forKey:@(_key)]; [defaults synchronize]; @@ -104,7 +104,7 @@ bool AppleRemoveUserDefaultsString( const Char * _key ) return false; } - [defaults removeObjectForKey:[[NSString alloc] initWithUTF8String:_key]]; + [defaults removeObjectForKey:@(_key)]; [defaults synchronize]; diff --git a/src/Kernel/MemoryStreamHelper.cpp b/src/Kernel/MemoryStreamHelper.cpp index 46fd778f5e..b6006aea01 100644 --- a/src/Kernel/MemoryStreamHelper.cpp +++ b/src/Kernel/MemoryStreamHelper.cpp @@ -124,8 +124,8 @@ namespace Mengine MENGINE_ASSERTION_MEMORY_PANIC( memory ); void * memory_buffer = memory->newBuffer( _size ); - MENGINE_UNUSED( memory_buffer ); + MENGINE_ASSERTION_MEMORY_PANIC( memory_buffer ); return memory; @@ -139,8 +139,8 @@ namespace Mengine MENGINE_ASSERTION_MEMORY_PANIC( memory ); void * memory_buffer = memory->newBuffer( _size ); - MENGINE_UNUSED( memory_buffer ); + MENGINE_ASSERTION_MEMORY_PANIC( memory_buffer ); return memory; diff --git a/src/Kernel/Stream.cpp b/src/Kernel/Stream.cpp index f2592efcef..5edc257170 100644 --- a/src/Kernel/Stream.cpp +++ b/src/Kernel/Stream.cpp @@ -111,7 +111,6 @@ namespace Mengine void * compress_memory = compress_buffer->getBuffer(); size_t read_data = _stream->read( compress_memory, compress_size ); - MENGINE_UNUSED( read_data ); MENGINE_ASSERTION_FATAL( read_data == (size_t)compress_size, "invalid read data '%zu' need '%zu'" @@ -571,4 +570,4 @@ namespace Mengine } ////////////////////////////////////////////////////////////////////////// } -} \ No newline at end of file +}} diff --git a/src/Platforms/SDLPlatform/SDLInput.cpp b/src/Platforms/SDLPlatform/SDLInput.cpp index 2823dbb17b..e6fa54f472 100644 --- a/src/Platforms/SDLPlatform/SDLInput.cpp +++ b/src/Platforms/SDLPlatform/SDLInput.cpp @@ -113,7 +113,6 @@ namespace Mengine int x; int y; Uint32 state = SDL_GetMouseState( &x, &y ); - MENGINE_UNUSED( state ); mt::vec2f point; @@ -146,7 +145,6 @@ namespace Mengine int x; int y; Uint32 state = SDL_GetMouseState( &x, &y ); - MENGINE_UNUSED( state ); mt::vec2f point; @@ -244,7 +242,6 @@ namespace Mengine int x; int y; Uint32 state = SDL_GetMouseState( &x, &y ); - MENGINE_UNUSED( state ); this->calcCursorPosition_( _sdlWindow, x, y, _point ); diff --git a/src/Plugins/AppleGameCenterPlugin/AppleGameCenterDelegate.mm b/src/Plugins/AppleGameCenterPlugin/AppleGameCenterDelegate.mm index f93f70dc4c..e41cdcadcd 100644 --- a/src/Plugins/AppleGameCenterPlugin/AppleGameCenterDelegate.mm +++ b/src/Plugins/AppleGameCenterPlugin/AppleGameCenterDelegate.mm @@ -30,13 +30,13 @@ - (BOOL) login:(void(^)(NSError* _Nullable))handler { handler( nil ); }]; - return true; + return YES; } - (BOOL) loadCompletedAchievements:(void(^)(NSError * _Nullable, NSArray * _Nullable))handler { if( m_authenticateSuccess == false ) { - return false; + return NO; } [GKAchievement loadAchievementsWithCompletionHandler:^(NSArray * _Nullable achievements, NSError * _Nullable error) { @@ -67,26 +67,26 @@ - (BOOL) loadCompletedAchievements:(void(^)(NSError * _Nullable, NSArray * _Null handler( nil, cmpAch ); }]; - return true; + return YES; } - (BOOL) resetAchievements:(void(^ _Nonnull)(NSError * __nullable error))handler { if( m_authenticateSuccess == false ) { - return false; + return NO; } [GKAchievement resetAchievementsWithCompletionHandler:^(NSError * _Nullable error) { handler( error ); }]; - return true; + return YES; } - (BOOL) reportScore:(NSString*)identifier score:(int64_t)score response:(void(^)(NSError * _Nullable))handler { if( m_authenticateSuccess == false ) { - return false; + return NO; } GKScore * scoreReporter = [[GKScore alloc] initWithLeaderboardIdentifier:identifier]; @@ -98,13 +98,13 @@ - (BOOL) reportScore:(NSString*)identifier score:(int64_t)score response:(void(^ handler(error); }]; - return true; + return YES; } - (BOOL) reportAchievementIdentifier:(NSString*)identifier percentComplete:(double)percent withBanner:(BOOL)banner response:(void(^)(NSError * _Nullable))handler { if( m_authenticateSuccess == false ) { - return false; + return NO; } GKAchievement * achievement = [[GKAchievement alloc] initWithIdentifier:identifier]; @@ -115,7 +115,7 @@ - (BOOL) reportAchievementIdentifier:(NSString*)identifier percentComplete:(doub handler(error); }]; - return true; + return YES; } @end diff --git a/src/Plugins/AppleMARSDKPlugin/AppleMARSDKService.mm b/src/Plugins/AppleMARSDKPlugin/AppleMARSDKService.mm index 35629a6f04..438c7c1b76 100644 --- a/src/Plugins/AppleMARSDKPlugin/AppleMARSDKService.mm +++ b/src/Plugins/AppleMARSDKPlugin/AppleMARSDKService.mm @@ -201,7 +201,7 @@ UIViewController * rootViewController = Helper::iOSGetRootViewController(); [[MARAd sharedInstance] showRewardVideoAd:rootViewController - itemName:[[NSString alloc] initWithUTF8String:_itemName.c_str()] + itemName:@(_itemName.c_str()) itemNum:_itemNum delegate:m_adRewardedDelegate]; } diff --git a/src/SDLApplication/MengineUIKitDelegate.mm b/src/SDLApplication/MengineUIKitDelegate.mm index 4e904304f0..fa621ec25d 100644 --- a/src/SDLApplication/MengineUIKitDelegate.mm +++ b/src/SDLApplication/MengineUIKitDelegate.mm @@ -18,7 +18,7 @@ - (id)init { continue; } - id delegate = [c alloc]; + id delegate = [[c alloc] init]; [self.m_applicationDelegates addObject:delegate]; } @@ -27,7 +27,6 @@ - (id)init { } - (void)dealloc { - [self.m_applicationDelegates release]; self.m_applicationDelegates = nil; [super dealloc]; diff --git a/src/Systems/OpenGLRenderSystem/OpenGLRenderImageLocked.cpp b/src/Systems/OpenGLRenderSystem/OpenGLRenderImageLocked.cpp index 92a03fd48c..695853d09d 100644 --- a/src/Systems/OpenGLRenderSystem/OpenGLRenderImageLocked.cpp +++ b/src/Systems/OpenGLRenderSystem/OpenGLRenderImageLocked.cpp @@ -30,7 +30,6 @@ namespace Mengine ); void * buffer = memory->newBuffer( _size ); - MENGINE_UNUSED( buffer ); MENGINE_ASSERTION_MEMORY_PANIC( buffer, "invalid new memory (%zu) rect from %u %u to %u %u"