A bit more clang-format

This commit is contained in:
Jasmine Iwanek
2022-11-19 08:49:04 -05:00
parent b04dd8cc8b
commit 3fe4f75108
223 changed files with 8047 additions and 7456 deletions

View File

@@ -8,36 +8,39 @@
#import <Foundation/Foundation.h>
void getDefaultROMPath(char* Path)
void
getDefaultROMPath(char *Path)
{
NSFileManager* sharedFM = [NSFileManager defaultManager];
NSArray* possibleURLs = [sharedFM URLsForDirectory:NSApplicationSupportDirectory
inDomains:NSUserDomainMask];
NSURL* appSupportDir = nil;
NSURL* appDirectory = nil;
NSFileManager *sharedFM = [NSFileManager defaultManager];
NSArray *possibleURLs = [sharedFM URLsForDirectory:NSApplicationSupportDirectory
inDomains:NSUserDomainMask];
NSURL *appSupportDir = nil;
NSURL *appDirectory = nil;
if ([possibleURLs count] >= 1) {
// Use the first directory (if multiple are returned)
appSupportDir = [possibleURLs objectAtIndex:0];
}
if ([possibleURLs count] >= 1) {
// Use the first directory (if multiple are returned)
appSupportDir = [possibleURLs objectAtIndex:0];
}
// If a valid app support directory exists, add the
// app's bundle ID to it to specify the final directory.
if (appSupportDir) {
NSString* appBundleID = [[NSBundle mainBundle] bundleIdentifier];
appDirectory = [appSupportDir URLByAppendingPathComponent:appBundleID];
appDirectory=[appDirectory URLByAppendingPathComponent:@"roms"];
}
// If a valid app support directory exists, add the
// app's bundle ID to it to specify the final directory.
if (appSupportDir) {
NSString *appBundleID = [[NSBundle mainBundle] bundleIdentifier];
appDirectory = [appSupportDir URLByAppendingPathComponent:appBundleID];
appDirectory = [appDirectory URLByAppendingPathComponent:@"roms"];
}
// create ~/Library/Application Support/... stuff
NSError* theError = nil;
if (![sharedFM createDirectoryAtURL:appDirectory withIntermediateDirectories:YES
attributes:nil error:&theError])
{
// Handle the error.
NSLog(@"Error creating user library rom path");
} else NSLog(@"Create user rom path sucessfull");
NSError *theError = nil;
if (![sharedFM createDirectoryAtURL:appDirectory
withIntermediateDirectories:YES
attributes:nil
error:&theError]) {
// Handle the error.
NSLog(@"Error creating user library rom path");
} else
NSLog(@"Create user rom path sucessfull");
strcpy(Path,[appDirectory fileSystemRepresentation]);
// return appDirectory;
strcpy(Path, [appDirectory fileSystemRepresentation]);
// return appDirectory;
}