# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1342124952 0 # Node ID 2396655d43f1cf11b958f263cfdc134eafe13b02 # Parent d81bebc5c8cc4ffd03e85530765575a751b58bec Fix some warnings with Mac 10.8 and Xcode 4.5. The Carbon Gestalt() function is now deprecated, switched to NSProcessInfo. Fix some format mismatches... NSPointerArray pointerArrayWithWeakObjects is also deprecated but I am not sure what to replace it with yet. diff -r d81bebc5c8cc -r 2396655d43f1 mac/dw.m --- a/mac/dw.m Fri Jul 06 10:51:28 2012 +0000 +++ b/mac/dw.m Thu Jul 12 20:29:12 2012 +0000 @@ -126,7 +126,7 @@ #endif pthread_key_t _dw_fg_color_key; pthread_key_t _dw_bg_color_key; -SInt32 DWOSMajor, DWOSMinor, DWOSBuild; +int DWOSMajor, DWOSMinor, DWOSBuild; static char _dw_bundle_path[PATH_MAX+1] = { 0 }; /* Create a default colors for a thread */ @@ -4204,7 +4204,7 @@ { NSBundle *bundle = [NSBundle mainBundle]; NSString *respath = [bundle resourcePath]; - NSString *filepath = [respath stringByAppendingFormat:@"/%u.png", resid]; + NSString *filepath = [respath stringByAppendingFormat:@"/%lu.png", resid]; NSImage *image = [[NSImage alloc] initWithContentsOfFile:filepath]; DWButton *button = _button_new("", resid); if(image) @@ -6885,7 +6885,7 @@ { NSBundle *bundle = [NSBundle mainBundle]; NSString *respath = [bundle resourcePath]; - NSString *filepath = [respath stringByAppendingFormat:@"/%u.png", resid]; + NSString *filepath = [respath stringByAppendingFormat:@"/%lu.png", resid]; NSImage *image = [[NSImage alloc] initWithContentsOfFile:filepath]; return image; } @@ -7307,7 +7307,7 @@ NSBundle *bundle = [NSBundle mainBundle]; NSString *respath = [bundle resourcePath]; - NSString *filepath = [respath stringByAppendingFormat:@"/%u.png", resid]; + NSString *filepath = [respath stringByAppendingFormat:@"/%lu.png", resid]; NSImage *temp = [[NSImage alloc] initWithContentsOfFile:filepath]; if(temp) @@ -10503,9 +10503,9 @@ getcwd(_dw_bundle_path, PATH_MAX); /* Get the operating system version */ - Gestalt(gestaltSystemVersionMajor, &DWOSMajor); - Gestalt(gestaltSystemVersionMinor, &DWOSMinor); - Gestalt(gestaltSystemVersionBugFix, &DWOSBuild); + NSString *version = [[NSProcessInfo processInfo] operatingSystemVersionString]; + const char *versionstr = [version UTF8String]; + sscanf(versionstr, "Version %d.%d.%d", &DWOSMajor, &DWOSMinor, &DWOSBuild); /* Create the application object */ DWApp = [NSApplication sharedApplication]; /* Create object for handling timers */