From 949b0bc5002cd94dcbf37ef23f6c32d41d62c704 Mon Sep 17 00:00:00 2001 From: "SND\\MaddTheSane_cp" Date: Sat, 13 Oct 2012 20:39:01 +0000 Subject: Fixing naming convention on a Cocoa function. Fixing string format in a Cocoa string. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@80390 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- macosx/English.lproj/Localizable.strings | 2 +- macosx/PcsxrPlugin.h | 2 +- macosx/PcsxrPlugin.m | 22 +++++++++++----------- macosx/PluginList.h | 1 - macosx/PluginList.m | 18 +++++++++--------- 5 files changed, 22 insertions(+), 23 deletions(-) diff --git a/macosx/English.lproj/Localizable.strings b/macosx/English.lproj/Localizable.strings index 20d26d35..518ab7f1 100644 --- a/macosx/English.lproj/Localizable.strings +++ b/macosx/English.lproj/Localizable.strings @@ -7,7 +7,7 @@ */ "Plugin Initialization Failed!" = "Plugin Initialization Failed!"; -"Pcsxr failed to initialize the selected %s plugin (error=%i).\nThe plugin might not work with your system." = "Pcsxr failed to initialize the selected %s plugin (error=%i).\nThe plugin might not work with your system."; +"Pcsxr failed to initialize the selected %@ plugin (error=%i).\nThe plugin might not work with your system." = "Pcsxr failed to initialize the selected %@ plugin (error=%i).\nThe plugin might not work with your system."; "Error!" = "Error!"; "Installation Succesfull" = "Installation Succesfull"; "Installation Failed!" = "Installation Failed!"; diff --git a/macosx/PcsxrPlugin.h b/macosx/PcsxrPlugin.h index 63181135..dd5347e6 100644 --- a/macosx/PcsxrPlugin.h +++ b/macosx/PcsxrPlugin.h @@ -35,7 +35,7 @@ - (NSString *)description; - (BOOL)hasAboutAs:(int)type; - (BOOL)hasConfigureAs:(int)type; -- (long)initAs:(int)aType; +- (long)runAs:(int)aType; - (long)shutdownAs:(int)aType; - (void)aboutAs:(int)type; - (void)configureAs:(int)type; diff --git a/macosx/PcsxrPlugin.m b/macosx/PcsxrPlugin.m index b1d5a8e6..7c010ef1 100644 --- a/macosx/PcsxrPlugin.m +++ b/macosx/PcsxrPlugin.m @@ -104,7 +104,7 @@ pluginRef = nil; name = nil; - path = [aPath retain]; + path = [aPath copy]; long tempVers = 0; NSString *goodPath = nil; for (NSString *plugDir in [PcsxrPlugin pluginsPaths]) @@ -134,10 +134,10 @@ } pluginRef = SysLoadLibrary([goodPath fileSystemRepresentation]); - if (pluginRef == nil) { - [self release]; - return nil; - } + if (pluginRef == nil) { + [self release]; + return nil; + } // TODO: add support for plugins with multiple functionalities??? PSE_getLibType = (PSEgetLibType) SysLoadSym(pluginRef, "PSEgetLibType"); @@ -172,8 +172,7 @@ PSE_getLibVersion = (PSEgetLibVersion) SysLoadSym(pluginRef, "PSEgetLibVersion"); if (SysLibError() == nil) { version = PSE_getLibVersion(); - } - else { + } else { version = -1; } @@ -226,7 +225,7 @@ return; } -- (long)initAs:(int)aType +- (long)runAs:(int)aType { char symbol[255]; long (*init)(); @@ -240,17 +239,18 @@ sprintf(symbol, "%sinit", [[PcsxrPlugin prefixForType:aType] cStringUsingEncoding:NSASCIIStringEncoding]); init = initArg = SysLoadSym(pluginRef, symbol); if (SysLibError() == nil) { - if (aType != PSE_LT_PAD) + if (aType != PSE_LT_PAD) { res = init(); - else + } else { res = initArg(1|2); + } } if (0 == res) { active |= aType; } else { NSRunCriticalAlertPanel(NSLocalizedString(@"Plugin Initialization Failed!", nil), - [NSString stringWithFormat:NSLocalizedString(@"Pcsxr failed to initialize the selected %s plugin (error=%i).\nThe plugin might not work with your system.", nil), [PcsxrPlugin prefixForType:aType], res], + [NSString stringWithFormat:NSLocalizedString(@"Pcsxr failed to initialize the selected %@ plugin (error=%i).\nThe plugin might not work with your system.", nil), [PcsxrPlugin prefixForType:aType], res], nil, nil, nil); } diff --git a/macosx/PluginList.h b/macosx/PluginList.h index 51ba5066..8eaa6727 100644 --- a/macosx/PluginList.h +++ b/macosx/PluginList.h @@ -12,7 +12,6 @@ //extern NSMutableArray *plugins; @interface PluginList : NSObject { - @private NSMutableArray *pluginList; diff --git a/macosx/PluginList.m b/macosx/PluginList.m index 7f340f65..72ec6aa0 100644 --- a/macosx/PluginList.m +++ b/macosx/PluginList.m @@ -153,7 +153,7 @@ const static int typeList[5] = {PSE_LT_GPU, PSE_LT_SPU, PSE_LT_CDR, PSE_LT_PAD, NSUInteger i; // verify that the ones that are in list still works - for (i=0; i<[pluginList count]; i++) { + for (i=0; i < [pluginList count]; i++) { if (![[pluginList objectAtIndex:i] verifyOK]) { [pluginList removeObjectAtIndex:i]; i--; } @@ -183,13 +183,13 @@ const static int typeList[5] = {PSE_LT_GPU, PSE_LT_SPU, PSE_LT_CDR, PSE_LT_PAD, // check the we have the needed plugins missingPlugins = NO; - for (i=0; i