Skip to content

Commit 19d82fc

Browse files
committed
[[ Cleanup ]] Remove MCNameIsEqualToCString
This patch removes MCNameIsEqualToCString and replaces it MCStringIsEqualToCString(MCNameGetString(...), ...).
1 parent bfad444 commit 19d82fc

7 files changed

Lines changed: 9 additions & 16 deletions

File tree

engine/src/bitmapeffect.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ static Exec_stat MCBitmapEffectLookupProperty(MCBitmapEffectType p_type, MCNameR
9292
for(uint4 i = 0; i < ELEMENTS(s_bitmap_effect_properties); i++)
9393
{
9494
// Check to see if we've found a match.
95-
if (MCNameIsEqualToCString(p_token, s_bitmap_effect_properties[i] . token, kMCCompareCaseless))
95+
if (MCStringIsEqualToCString(MCNameGetString(p_token), s_bitmap_effect_properties[i] . token, kMCCompareCaseless))
9696
{
9797
// Check to see if its applicable to this type.
9898
if ((s_bitmap_effect_properties[i] . mask & (1 << p_type)) != 0)

engine/src/foundation-legacy.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,11 +1105,6 @@ char MCNameGetCharAtIndex(MCNameRef p_name, uindex_t p_at)
11051105
return MCStringGetNativeCharAtIndex(MCNameGetString(p_name), p_at);
11061106
}
11071107

1108-
bool MCNameIsEqualToCString(MCNameRef p_left, const char *p_cstring, MCCompareOptions p_options)
1109-
{
1110-
return MCStringIsEqualToCString(MCNameGetString(p_left), p_cstring, p_options);
1111-
}
1112-
11131108
////////////////////////////////////////////////////////////////////////////////
11141109

11151110
struct get_array_extent_context_t

engine/src/foundation-legacy.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,6 @@ bool MCNameGetAsIndex(MCNameRef name, index_t& r_index);
8282

8383
char MCNameGetCharAtIndex(MCNameRef name, uindex_t at);
8484

85-
bool MCNameIsEqualToCString(MCNameRef left, const char *cstring, MCCompareOptions options);
86-
8785
////////////////////////////////////////////////////////////////////////////////
8886

8987
enum IO_stat

engine/src/gradient.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ static Exec_stat MCGradientFillLookupProperty(MCNameRef p_token, MCGradientFillP
6363
uint4 tablesize = ELEMENTS(gradientprops);
6464
while (tablesize--)
6565
{
66-
if (MCNameIsEqualToCString(p_token, gradientprops[tablesize].token, kMCCompareCaseless))
66+
if (MCStringIsEqualToCString(MCNameGetString(p_token), gradientprops[tablesize].token, kMCCompareCaseless))
6767
{
6868
r_prop = gradientprops[tablesize].value;
6969
return ES_NORMAL;

engine/src/mblhandlers.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4605,7 +4605,7 @@ bool MCIsPlatformMessage(MCNameRef handler_name)
46054605

46064606
for(uint32_t i = 0; s_platform_messages[i] . message != nil; i++)
46074607
{
4608-
if (MCNameIsEqualToCString(handler_name, s_platform_messages[i].message, kMCCompareCaseless))
4608+
if (MCStringIsEqualToCString(MCNameGetString(handler_name), s_platform_messages[i].message, kMCCompareCaseless))
46094609
found = true;
46104610
}
46114611

@@ -4662,7 +4662,7 @@ bool MCDoHandlePlatformMessage(bool p_waitable, MCPlatformMessageHandler p_handl
46624662
bool MCHandlePlatformMessage(MCNameRef p_message, MCParameter *p_parameters, Exec_stat& r_result)
46634663
{
46644664
for(uint32_t i = 0; s_platform_messages[i] . message != nil; i++)
4665-
if (MCNameIsEqualToCString(p_message, s_platform_messages[i] . message, kMCCompareCaseless))
4665+
if (MCStringIsEqualToCString(MCNameGetString(p_message), s_platform_messages[i] . message, kMCCompareCaseless))
46664666
{
46674667
return MCDoHandlePlatformMessage(s_platform_messages[i] . waitable, s_platform_messages[i] . handler, s_platform_messages[i] . context, p_parameters, r_result);
46684668
}

engine/src/mbliphone.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ virtual uint64_t GetFileSize(void)
698698
{
699699
MCStringCreateWithCFString((CFStringRef)NSHomeDirectory() , &t_path);
700700
}
701-
else if (MCNameIsEqualToCString(p_type, "cache", kMCCompareCaseless))
701+
else if (MCStringIsEqualToCString(MCNameGetString(p_type), "cache", kMCCompareCaseless))
702702
{
703703
NSArray *t_paths;
704704
t_paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
@@ -716,7 +716,7 @@ virtual uint64_t GetFileSize(void)
716716
/* UNCHECKED */ MCStringCopySubstring(MCcmd, MCRangeMake(0, t_index), &t_path);
717717

718718
}
719-
else if (MCNameIsEqualToCString(p_type, "library", kMCCompareCaseless))
719+
else if (MCStringIsEqualToCString(MCNameGetString(p_type), "library", kMCCompareCaseless))
720720
{
721721
NSArray *t_paths;
722722
t_paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES);

engine/src/mcio.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ void IO_cleanprocesses()
114114
MCPlayerHandle t_player = MCplayers;
115115
while (t_player.IsValid())
116116
{
117-
if (MCNameIsEqualToCString(MCprocesses[i].name,
118-
t_player->getcommand(),
119-
kMCCompareExact))
117+
if (MCStringIsEqualToCString(MCNameGetString(MCprocesses[i].name),
118+
t_player->getcommand(),
119+
kMCCompareExact))
120120
{
121121
t_player->playstop(); // removes from linked list
122122
break;

0 commit comments

Comments
 (0)