diff options
Diffstat (limited to 'macosx/plugins/DFSound/macsrc')
| -rw-r--r-- | macosx/plugins/DFSound/macsrc/ARCBridge.h | 36 | ||||
| -rwxr-xr-x | macosx/plugins/DFSound/macsrc/NamedSlider.h | 4 | ||||
| -rwxr-xr-x | macosx/plugins/DFSound/macsrc/NamedSlider.m | 2 | ||||
| -rwxr-xr-x | macosx/plugins/DFSound/macsrc/PluginController.m | 7 |
4 files changed, 44 insertions, 5 deletions
diff --git a/macosx/plugins/DFSound/macsrc/ARCBridge.h b/macosx/plugins/DFSound/macsrc/ARCBridge.h new file mode 100644 index 00000000..ea274b84 --- /dev/null +++ b/macosx/plugins/DFSound/macsrc/ARCBridge.h @@ -0,0 +1,36 @@ +// +// ARCBridge.h +// PPMacho +// +// Created by C.W. Betts on 12/23/12. +// +// + +#ifndef PPMacho_ARCBridge_h +#define PPMacho_ARCBridge_h + +#if __has_feature(objc_arc) + +#define SUPERDEALLOC +#define RELEASEOBJ(obj) +#define RETAINOBJ(obj) obj +#define RETAINOBJNORETURN(obj) +#define AUTORELEASEOBJ(obj) obj +#define AUTORELEASEOBJNORETURN(obj) +#define BRIDGE(toType, obj) (__bridge toType)(obj) +#define __arcweak __weak + +#else + +#define SUPERDEALLOC [super dealloc] +#define RELEASEOBJ(obj) [obj release] +#define RETAINOBJ(obj) [obj retain] +#define RETAINOBJNORETURN(obj) [obj retain] +#define AUTORELEASEOBJ(obj) [obj autorelease] +#define AUTORELEASEOBJNORETURN(obj) [obj autorelease] +#define BRIDGE(toType, obj) (toType)obj +#define __arcweak + +#endif + +#endif diff --git a/macosx/plugins/DFSound/macsrc/NamedSlider.h b/macosx/plugins/DFSound/macsrc/NamedSlider.h index 790db09a..1dcfe3a3 100755 --- a/macosx/plugins/DFSound/macsrc/NamedSlider.h +++ b/macosx/plugins/DFSound/macsrc/NamedSlider.h @@ -5,8 +5,8 @@ @interface NamedSlider : NSSlider { NSArray *strings; - Class pluginClass; + __unsafe_unretained Class pluginClass; } @property (retain) NSArray *strings; -@property Class pluginClass; +@property (unsafe_unretained) Class pluginClass; @end diff --git a/macosx/plugins/DFSound/macsrc/NamedSlider.m b/macosx/plugins/DFSound/macsrc/NamedSlider.m index 750d0376..55322742 100755 --- a/macosx/plugins/DFSound/macsrc/NamedSlider.m +++ b/macosx/plugins/DFSound/macsrc/NamedSlider.m @@ -3,12 +3,14 @@ @implementation NamedSlider @synthesize pluginClass; +#if !__has_feature(objc_arc) - (void)dealloc { self.strings = nil; [super dealloc]; } +#endif @synthesize strings; diff --git a/macosx/plugins/DFSound/macsrc/PluginController.m b/macosx/plugins/DFSound/macsrc/PluginController.m index 655f479e..da05222b 100755 --- a/macosx/plugins/DFSound/macsrc/PluginController.m +++ b/macosx/plugins/DFSound/macsrc/PluginController.m @@ -2,6 +2,7 @@ #include "stdafx.h" #include "externals.h" #include "maccfg.h" +#include "ARCBridge.h" #ifdef ENABLE_NLS #include <libintl.h> @@ -54,9 +55,9 @@ void DoAbout() NSString *path = [bundle pathForResource:@"Credits" ofType:@"rtf"]; NSAttributedString *credits; if (path) { - credits = [[[NSAttributedString alloc] initWithPath: path documentAttributes:NULL] autorelease]; + credits = AUTORELEASEOBJ([[NSAttributedString alloc] initWithPath: path documentAttributes:NULL]); } else { - credits = [[[NSAttributedString alloc] initWithString:@""] autorelease]; + credits = AUTORELEASEOBJ([[NSAttributedString alloc] initWithString:@""]); } // Get Application Icon @@ -168,7 +169,7 @@ void ReadConfig(void) ReadConfig(); /* load from preferences */ - [keyValues release]; + RELEASEOBJ(keyValues); keyValues = [[defaults dictionaryForKey:PrefsKey] mutableCopy]; [hiCompBox setIntValue:[[keyValues objectForKey:@"High Compatibility Mode"] boolValue]]; |
