changeset 1770:2396655d43f1

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.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Thu, 12 Jul 2012 20:29:12 +0000
parents d81bebc5c8cc
children bed4320cb0ce
files mac/dw.m
diffstat 1 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- 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 */