Mercurial > dwindows
comparison mac/dw.m @ 2394:e0c63f2cbdbf
Mac: Clean up some code errors reported by LLVM.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Thu, 25 Mar 2021 09:02:09 +0000 |
parents | 9fcc9ee25c4b |
children | 0286ac44d347 |
comparison
equal
deleted
inserted
replaced
2393:6669e152e30b | 2394:e0c63f2cbdbf |
---|---|
6830 id image = handle; | 6830 id image = handle; |
6831 NSBitmapImageRep *bi = nil; | 6831 NSBitmapImageRep *bi = nil; |
6832 bool bCanDraw = YES; | 6832 bool bCanDraw = YES; |
6833 | 6833 |
6834 if(pixmap) | 6834 if(pixmap) |
6835 bi = image = (id)pixmap->image; | 6835 bi = (id)pixmap->image; |
6836 else | 6836 else |
6837 { | 6837 { |
6838 #ifdef BUILDING_FOR_MOJAVE | 6838 #ifdef BUILDING_FOR_MOJAVE |
6839 if([image isMemberOfClass:[DWRender class]]) | 6839 if([image isMemberOfClass:[DWRender class]]) |
6840 { | 6840 { |
6891 id image = handle; | 6891 id image = handle; |
6892 NSBitmapImageRep *bi = nil; | 6892 NSBitmapImageRep *bi = nil; |
6893 bool bCanDraw = YES; | 6893 bool bCanDraw = YES; |
6894 | 6894 |
6895 if(pixmap) | 6895 if(pixmap) |
6896 bi = image = (id)pixmap->image; | 6896 bi = (id)pixmap->image; |
6897 else | 6897 else |
6898 { | 6898 { |
6899 #ifdef BUILDING_FOR_MOJAVE | 6899 #ifdef BUILDING_FOR_MOJAVE |
6900 if([image isMemberOfClass:[DWRender class]]) | 6900 if([image isMemberOfClass:[DWRender class]]) |
6901 { | 6901 { |
6956 DWRender *render; | 6956 DWRender *render; |
6957 bool bCanDraw = YES; | 6957 bool bCanDraw = YES; |
6958 | 6958 |
6959 if(pixmap) | 6959 if(pixmap) |
6960 { | 6960 { |
6961 bi = image = (id)pixmap->image; | 6961 bi = (id)pixmap->image; |
6962 font = pixmap->font; | 6962 font = pixmap->font; |
6963 render = pixmap->handle; | 6963 render = pixmap->handle; |
6964 if(!font && [render isMemberOfClass:[DWRender class]]) | 6964 if(!font && [render isMemberOfClass:[DWRender class]]) |
6965 { | 6965 { |
6966 font = [render font]; | 6966 font = [render font]; |
6967 } | 6967 } |
6968 image = (id)pixmap->image; | |
6969 } | 6968 } |
6970 else if(image && [image isMemberOfClass:[DWRender class]]) | 6969 else if(image && [image isMemberOfClass:[DWRender class]]) |
6971 { | 6970 { |
6972 render = image; | 6971 render = image; |
6973 font = [render font]; | 6972 font = [render font]; |
7094 NSBitmapImageRep *bi = nil; | 7093 NSBitmapImageRep *bi = nil; |
7095 bool bCanDraw = YES; | 7094 bool bCanDraw = YES; |
7096 int z; | 7095 int z; |
7097 | 7096 |
7098 if(pixmap) | 7097 if(pixmap) |
7099 bi = image = (id)pixmap->image; | 7098 bi = (id)pixmap->image; |
7100 else | 7099 else |
7101 { | 7100 { |
7102 #ifdef BUILDING_FOR_MOJAVE | 7101 #ifdef BUILDING_FOR_MOJAVE |
7103 if([image isMemberOfClass:[DWRender class]]) | 7102 if([image isMemberOfClass:[DWRender class]]) |
7104 { | 7103 { |
7170 id image = handle; | 7169 id image = handle; |
7171 NSBitmapImageRep *bi = nil; | 7170 NSBitmapImageRep *bi = nil; |
7172 bool bCanDraw = YES; | 7171 bool bCanDraw = YES; |
7173 | 7172 |
7174 if(pixmap) | 7173 if(pixmap) |
7175 bi = image = (id)pixmap->image; | 7174 bi = (id)pixmap->image; |
7176 else | 7175 else |
7177 { | 7176 { |
7178 #ifdef BUILDING_FOR_MOJAVE | 7177 #ifdef BUILDING_FOR_MOJAVE |
7179 if([image isMemberOfClass:[DWRender class]]) | 7178 if([image isMemberOfClass:[DWRender class]]) |
7180 { | 7179 { |
7241 id image = handle; | 7240 id image = handle; |
7242 NSBitmapImageRep *bi = nil; | 7241 NSBitmapImageRep *bi = nil; |
7243 bool bCanDraw = YES; | 7242 bool bCanDraw = YES; |
7244 | 7243 |
7245 if(pixmap) | 7244 if(pixmap) |
7246 bi = image = (id)pixmap->image; | 7245 bi = (id)pixmap->image; |
7247 else | 7246 else |
7248 { | 7247 { |
7249 #ifdef BUILDING_FOR_MOJAVE | 7248 #ifdef BUILDING_FOR_MOJAVE |
7250 if([image isMemberOfClass:[DWRender class]]) | 7249 if([image isMemberOfClass:[DWRender class]]) |
7251 { | 7250 { |
12547 { | 12546 { |
12548 [center requestAuthorizationWithOptions:UNAuthorizationOptionAlert|UNAuthorizationOptionSound | 12547 [center requestAuthorizationWithOptions:UNAuthorizationOptionAlert|UNAuthorizationOptionSound |
12549 completionHandler:^(BOOL granted, NSError * _Nullable error) { | 12548 completionHandler:^(BOOL granted, NSError * _Nullable error) { |
12550 if (granted) | 12549 if (granted) |
12551 { | 12550 { |
12552 center.delegate = [[DWUserNotificationCenterDelegate alloc] init]; | 12551 center.delegate = [[[DWUserNotificationCenterDelegate alloc] init] autorelease]; |
12553 } | 12552 } |
12554 else | 12553 else |
12555 { | 12554 { |
12556 NSLog(@"WARNING: Unable to get notification permission. %@", error.localizedDescription); | 12555 NSLog(@"WARNING: Unable to get notification permission. %@", error.localizedDescription); |
12557 } | 12556 } |
12892 strcat(commandline, "\"\'"); | 12891 strcat(commandline, "\"\'"); |
12893 | 12892 |
12894 /* Attempt to execute the commmand, DW_ERROR_NONE on success */ | 12893 /* Attempt to execute the commmand, DW_ERROR_NONE on success */ |
12895 if(system(commandline) != -1) | 12894 if(system(commandline) != -1) |
12896 ret = DW_ERROR_NONE; | 12895 ret = DW_ERROR_NONE; |
12896 free(commandline); | |
12897 } | 12897 } |
12898 return ret; | 12898 return ret; |
12899 } | 12899 } |
12900 | 12900 |
12901 /* | 12901 /* |