Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit f27e2cc

Browse files
authored
Merge pull request #6160 from runrevmark/foundation-cftype_bridges
[[ Foundation ]] CFTypeRef Bridges
2 parents cb31701 + f467757 commit f27e2cc

37 files changed

+889
-223
lines changed

engine/src/coretextfonts.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ void coretext_get_font_name(void *p_font, MCNameRef& r_name)
462462
t_font_name = CTFontCopyDisplayName((CTFontRef)p_font);
463463

464464
MCAutoStringRef t_font_name_string;
465-
MCStringCreateWithCFString(t_font_name, &t_font_name_string);
465+
MCStringCreateWithCFStringRef(t_font_name, &t_font_name_string);
466466
MCNameCreate(*t_font_name_string, r_name);
467467
}
468468

engine/src/dskmac.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2871,7 +2871,7 @@ struct MCMacDesktop: public MCSystemInterface, public MCMacSystemService
28712871

28722872
// Change the current folder
28732873
MCAutoStringRef t_path;
2874-
if (MCStringCreateWithCFString(t_fs_path, &t_path))
2874+
if (MCStringCreateWithCFStringRef(t_fs_path, &t_path))
28752875
/* UNCHECKED */ SetCurrentFolder(*t_path);
28762876

28772877
CFRelease(t_bundle_url);
@@ -5944,7 +5944,7 @@ bool MCS_get_browsers(MCStringRef &r_browsers)
59445944

59455945
MCAutoStringRef t_browser_string;
59465946
if (t_success)
5947-
t_success = MCStringCreateWithCFString(t_browser_title, &t_browser_string);
5947+
t_success = MCStringCreateWithCFStringRef(t_browser_title, &t_browser_string);
59485948

59495949
if (t_success)
59505950
t_success = MCListAppend(*t_browser_list, *t_browser_string);

engine/src/externalv1.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1993,7 +1993,7 @@ static MCExternalError MCExternalVariableAppend(MCExternalVariableRef var, MCExt
19931993
{
19941994
MCAutoStringRef t_string;
19951995

1996-
if (!MCStringCreateWithCFString(*(CFStringRef*)p_value, &t_string))
1996+
if (!MCStringCreateWithCFStringRef(*(CFStringRef*)p_value, &t_string))
19971997
return kMCExternalErrorNotAString;
19981998

19991999
return var -> AppendString(p_options, *t_string);

engine/src/externalv1.mm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
{
9393
MCAutoStringRef t_string;
9494

95-
if (!MCStringCreateWithCFString((CFStringRef)src, &t_string))
95+
if (!MCStringCreateWithCFStringRef((CFStringRef)src, &t_string))
9696
return kMCExternalErrorNotAString;
9797

9898
var = MCValueRetain(*t_string);
@@ -118,7 +118,7 @@
118118
MCAutoStringRef t_string;
119119
NSString *t_as_string;
120120
t_as_string = [src description];
121-
if (!MCStringCreateWithCFString((CFStringRef)t_as_string, &t_string))
121+
if (!MCStringCreateWithCFStringRef((CFStringRef)t_as_string, &t_string))
122122
return kMCExternalErrorOutOfMemory;
123123

124124
var = MCValueRetain(*t_string);
@@ -337,7 +337,7 @@
337337

338338
if (t_error == kMCExternalErrorNone)
339339
{
340-
if (!MCStringCreateWithCFString((CFStringRef)t_key, &t_key_stringref) ||
340+
if (!MCStringCreateWithCFStringRef((CFStringRef)t_key, &t_key_stringref) ||
341341
!MCNameCreate(*t_key_stringref, &t_key_nameref))
342342
t_error = kMCExternalErrorOutOfMemory;
343343
}

engine/src/mac-av-player.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1404,7 +1404,7 @@ static Boolean AVAssetHasType(AVAsset *p_asset, NSString *p_type)
14041404
{
14051405
NSString *t_mediaType;
14061406
t_mediaType = [t_asset_track mediaType];
1407-
MCStringCreateWithCFString((CFStringRef)t_mediaType, *(MCStringRef*)r_value);
1407+
MCStringCreateWithCFStringRef((CFStringRef)t_mediaType, *(MCStringRef*)r_value);
14081408
}
14091409
break;
14101410
case kMCPlatformPlayerTrackPropertyOffset:

engine/src/mac-clipboard.mm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@
315315

316316
// Convert the UTI to a StringRef
317317
MCStringRef t_return = NULL;
318-
MCStringCreateWithCFString(t_uti, t_return);
318+
MCStringCreateWithCFStringRef(t_uti, t_return);
319319
CFRelease(t_uti);
320320
return t_return;
321321
}
@@ -574,7 +574,7 @@
574574

575575
// Convert the NSString into a StringRef
576576
MCStringRef t_type_string;
577-
if (!MCStringCreateWithCFString((CFStringRef)t_type, t_type_string))
577+
if (!MCStringCreateWithCFStringRef((CFStringRef)t_type, t_type_string))
578578
return NULL;
579579

580580
m_type = t_type_string;
@@ -612,7 +612,7 @@
612612

613613
// Turn this path into a LiveCode string
614614
MCAutoStringRef t_path_string;
615-
if (!MCStringCreateWithCFString((CFStringRef)t_path, &t_path_string))
615+
if (!MCStringCreateWithCFStringRef((CFStringRef)t_path, &t_path_string))
616616
return NULL;
617617

618618
// Because this needs to return data, UTF-8 encode the result

engine/src/mac-dialog.mm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ MCPlatformDialogResult MCPlatformEndFolderDialog(MCStringRef& r_selected_folder)
213213
{
214214
NSString *t_alias;
215215
resolve_alias([s_dialog_nesting -> panel filename], t_alias);
216-
/* UNCHECKED */ MCStringCreateWithCFString((CFStringRef)t_alias, r_selected_folder);
216+
/* UNCHECKED */ MCStringCreateWithCFStringRef((CFStringRef)t_alias, r_selected_folder);
217217
[t_alias release];
218218
}
219219
else
@@ -509,7 +509,7 @@ - (BOOL)panel:(id)sender shouldShowFilename:(NSString *)filename
509509
if (!t_should_show && m_filter->extension_count > 0)
510510
{
511511
MCAutoStringRef t_filename;
512-
if (MCStringCreateWithCFString((CFStringRef)t_filename_resolved, &t_filename) && *t_filename != nil)
512+
if (MCStringCreateWithCFStringRef((CFStringRef)t_filename_resolved, &t_filename) && *t_filename != nil)
513513
{
514514
uindex_t t_dot;
515515
// AL-2014-04-01: [[ Bug 12081 ]] Find last occurrence of '.' rather than first, for file extension detection.
@@ -649,7 +649,7 @@ MCPlatformDialogResult MCPlatformEndFileDialog(MCPlatformFileDialogKind p_kind,
649649

650650
if (p_kind == kMCPlatformFileDialogKindSave)
651651
{
652-
/* UNCHECKED */ MCStringCreateWithCFString((CFStringRef)[s_dialog_nesting -> panel filename], r_paths);
652+
/* UNCHECKED */ MCStringCreateWithCFStringRef((CFStringRef)[s_dialog_nesting -> panel filename], r_paths);
653653
if (t_accessory != nil && [t_accessory currentType] != nil)
654654
r_type = MCValueRetain([t_accessory currentType]);
655655
else
@@ -666,7 +666,7 @@ MCPlatformDialogResult MCPlatformEndFileDialog(MCPlatformFileDialogKind p_kind,
666666
resolve_alias([[(NSOpenPanel *)s_dialog_nesting -> panel filenames] objectAtIndex: i], t_alias);
667667

668668
MCAutoStringRef t_conv_filename;
669-
if (MCStringCreateWithCFString((CFStringRef)t_alias, &t_conv_filename))
669+
if (MCStringCreateWithCFStringRef((CFStringRef)t_alias, &t_conv_filename))
670670
/* UNCHECKED */ MCStringAppendFormat(r_paths, "%s%@", i > 0 ? "\n" : "", *t_conv_filename);
671671

672672
[t_alias release];

engine/src/mac-menu.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -913,10 +913,10 @@ void MCPlatformGetMenuItemProperty(MCPlatformMenuRef p_menu, uindex_t p_index, M
913913
switch(p_property)
914914
{
915915
case kMCPlatformMenuItemPropertyTitle:
916-
/* UNCHECKED */ MCStringCreateWithCFString((CFStringRef)[t_item title], *(MCStringRef*)r_value);
916+
/* UNCHECKED */ MCStringCreateWithCFStringRef((CFStringRef)[t_item title], *(MCStringRef*)r_value);
917917
break;
918918
case kMCPlatformMenuItemPropertyTag:
919-
/* UNCHECKED */ MCStringCreateWithCFString((CFStringRef)[t_item representedObject], *(MCStringRef*)r_value);
919+
/* UNCHECKED */ MCStringCreateWithCFStringRef((CFStringRef)[t_item representedObject], *(MCStringRef*)r_value);
920920
break;
921921
case kMCPlatformMenuItemPropertySubmenu:
922922
{

engine/src/mbliphone.mm

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ virtual uint64_t GetFileSize(void)
378378

379379
bool MCIPhoneSystem::GetVersion(MCStringRef& r_string)
380380
{
381-
return MCStringCreateWithCFString((CFStringRef)[[UIDevice currentDevice] systemVersion], r_string);
381+
return MCStringCreateWithCFStringRef((CFStringRef)[[UIDevice currentDevice] systemVersion], r_string);
382382
}
383383

384384
bool MCIPhoneSystem::GetMachine(MCStringRef& r_string)
@@ -388,7 +388,7 @@ virtual uint64_t GetFileSize(void)
388388
t_machine = [t_machine stringByAppendingString:@" Simulator"];
389389
#endif
390390

391-
return MCStringCreateWithCFString((CFStringRef)t_machine, r_string);
391+
return MCStringCreateWithCFStringRef((CFStringRef)t_machine, r_string);
392392
}
393393

394394
MCNameRef MCIPhoneSystem::GetProcessor(void)
@@ -679,7 +679,7 @@ virtual uint64_t GetFileSize(void)
679679
if (MCNameIsEqualToCaseless(p_type, MCN_temporary))
680680
{
681681
MCAutoStringRef t_temp;
682-
MCStringCreateWithCFString((CFStringRef)NSTemporaryDirectory() , &t_temp);
682+
MCStringCreateWithCFStringRef((CFStringRef)NSTemporaryDirectory() , &t_temp);
683683

684684
// MW-2012-09-18: [[ Bug 10279 ]] Remove trailing slash, if any.
685685
// MW-2012-10-04: [[ Bug 10435 ]] Actually use a NUL character, rather than a '0'!
@@ -692,17 +692,17 @@ virtual uint64_t GetFileSize(void)
692692
{
693693
NSArray *t_paths;
694694
t_paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
695-
MCStringCreateWithCFString((CFStringRef)[t_paths objectAtIndex: 0] , &t_path);
695+
MCStringCreateWithCFStringRef((CFStringRef)[t_paths objectAtIndex: 0] , &t_path);
696696
}
697697
else if (MCNameIsEqualToCaseless(p_type, MCN_home))
698698
{
699-
MCStringCreateWithCFString((CFStringRef)NSHomeDirectory() , &t_path);
699+
MCStringCreateWithCFStringRef((CFStringRef)NSHomeDirectory() , &t_path);
700700
}
701701
else if (MCStringIsEqualToCString(MCNameGetString(p_type), "cache", kMCCompareCaseless))
702702
{
703703
NSArray *t_paths;
704704
t_paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
705-
MCStringCreateWithCFString((CFStringRef)[t_paths objectAtIndex: 0] , &t_path);
705+
MCStringCreateWithCFStringRef((CFStringRef)[t_paths objectAtIndex: 0] , &t_path);
706706
}
707707
// SN-2015-04-16: [[ Bug 14295 ]] The resources folder on Mobile is the same
708708
// as the engine folder.
@@ -720,7 +720,7 @@ virtual uint64_t GetFileSize(void)
720720
{
721721
NSArray *t_paths;
722722
t_paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES);
723-
MCStringCreateWithCFString((CFStringRef)[t_paths objectAtIndex: 0] , &t_path);
723+
MCStringCreateWithCFStringRef((CFStringRef)[t_paths objectAtIndex: 0] , &t_path);
724724

725725
}
726726

engine/src/mbliphoneapp.mm

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ static void dispatch_notification_events(void)
9090
MCAutoStringRef t_text;
9191
// PM-2015-10-27: [[ Bug 16279 ]] Prevent crash when the payload is empty
9292
if (t_event -> text != nil)
93-
/* UNCHECKED */ MCStringCreateWithCFString((CFStringRef)t_event -> text, &t_text);
93+
/* UNCHECKED */ MCStringCreateWithCFStringRef((CFStringRef)t_event -> text, &t_text);
9494
else
9595
t_text = MCValueRetain(kMCEmptyString);
9696

@@ -388,7 +388,7 @@ - (BOOL)application:(UIApplication *)p_application didFinishLaunchingWithOptions
388388
if (t_launch_url)
389389
{
390390
MCAutoStringRef t_url_text;
391-
/* UNCHECKED */ MCStringCreateWithCFString((CFStringRef)[t_launch_url absoluteString], &t_url_text);
391+
/* UNCHECKED */ MCStringCreateWithCFStringRef((CFStringRef)[t_launch_url absoluteString], &t_url_text);
392392
MCValueAssign(m_launch_url, *t_url_text);
393393

394394
// HSC-2012-03-13 [[ Bug 10076 ]] Prevent Push Notification crashing when applicationDidBecomeActive is called multiple times
@@ -529,7 +529,7 @@ - (void)application:(UIApplication*)p_application didRegisterForRemoteNotificati
529529
if (t_registration_text != nil)
530530
{
531531
MCAutoStringRef t_device_token;
532-
/* UNCHECKED */ MCStringCreateWithCFString((CFStringRef)t_registration_text, &t_device_token);
532+
/* UNCHECKED */ MCStringCreateWithCFStringRef((CFStringRef)t_registration_text, &t_device_token);
533533
MCValueAssign(m_device_token, *t_device_token);
534534

535535
// MW-2014-09-22: [[ Bug 13446 ]] Queue the event.
@@ -579,7 +579,7 @@ - (BOOL)application:(UIApplication *)p_application openURL:(NSURL*)p_url sourceA
579579
if (p_url != nil)
580580
{
581581
MCAutoStringRef t_url_text;
582-
/* UNCHECKED */ MCStringCreateWithCFString((CFStringRef)[p_url absoluteString], &t_url_text);
582+
/* UNCHECKED */ MCStringCreateWithCFStringRef((CFStringRef)[p_url absoluteString], &t_url_text);
583583
MCValueAssign(m_launch_url, *t_url_text);
584584
if (m_did_become_active)
585585
MCNotificationPostUrlWakeUp(m_launch_url);
@@ -662,7 +662,7 @@ - (void)startPreparing
662662
if (m_pending_local_notification != nil)
663663
{
664664
MCAutoStringRef t_mc_reminder_text;
665-
/* UNCHECKED */ MCStringCreateWithCFString((CFStringRef)m_pending_local_notification, &t_mc_reminder_text);
665+
/* UNCHECKED */ MCStringCreateWithCFStringRef((CFStringRef)m_pending_local_notification, &t_mc_reminder_text);
666666
MCNotificationPostLocalNotificationEvent(*t_mc_reminder_text);
667667

668668
// HSC-2012-03-13 [[ Bug 10076 ]] Prevent Push Notification crashing when applicationDidBecomeActive is called multiple times
@@ -672,7 +672,7 @@ - (void)startPreparing
672672
if (m_pending_push_notification != nil)
673673
{
674674
MCAutoStringRef t_mc_reminder_text;
675-
/* UNCHECKED */ MCStringCreateWithCFString((CFStringRef)m_pending_push_notification, &t_mc_reminder_text);
675+
/* UNCHECKED */ MCStringCreateWithCFStringRef((CFStringRef)m_pending_push_notification, &t_mc_reminder_text);
676676
MCNotificationPostPushNotificationEvent(*t_mc_reminder_text);
677677

678678
// HSC-2012-03-13 [[ Bug 10076 ]] Prevent Push Notification crashing when applicationDidBecomeActive is called multiple times

0 commit comments

Comments
 (0)