Skip to content

Commit 956e17e

Browse files
committed
[[ Cleanup ]] Rename MCNameIsEqualTo(x,y) to MCNameIsEqualToCaseless
This patch renames the libfoundation function MCNameIsEqualTo(x,y) to MCNameIsEqualToCaseless to better reflect its semantics. All instances of MCNameIsEqualTo usage which is caseless have been changed to use that form.
1 parent 93f2348 commit 956e17e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+137
-151
lines changed

engine/src/button.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1643,7 +1643,7 @@ Boolean MCButton::doubleup(uint2 which)
16431643
#ifdef _MAC_DESKTOP
16441644
void MCButton::timer(MCNameRef mptr, MCParameter *params)
16451645
{
1646-
if (MCNameIsEqualTo(mptr, MCM_internal, kMCCompareCaseless))
1646+
if (MCNameIsEqualToCaseless(mptr, MCM_internal))
16471647
{
16481648
if (state & CS_SHOW_DEFAULT)
16491649
{

engine/src/card.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,7 @@ Boolean MCCard::doubleup(uint2 which)
10481048

10491049
void MCCard::timer(MCNameRef mptr, MCParameter *params)
10501050
{
1051-
if (MCNameIsEqualTo(mptr, MCM_idle, kMCCompareCaseless))
1051+
if (MCNameIsEqualToCaseless(mptr, MCM_idle))
10521052
{
10531053
if (opened)
10541054
{

engine/src/control.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ Boolean MCControl::doubleup(uint2 which)
378378

379379
void MCControl::timer(MCNameRef mptr, MCParameter *params)
380380
{
381-
if (MCNameIsEqualTo(mptr, MCM_idle, kMCCompareCaseless))
381+
if (MCNameIsEqualToCaseless(mptr, MCM_idle))
382382
{
383383
if (opened && getstack()->gettool(this) == T_BROWSE)
384384
{

engine/src/dispatch.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ void MCDispatch::processstack(MCStringRef p_openpath, MCStack* &x_stack)
865865
tstk = stacks;
866866
do
867867
{
868-
if (MCNameIsEqualTo(*t_stack_name, tstk->getname(), kMCCompareCaseless))
868+
if (MCNameIsEqualToCaseless(*t_stack_name, tstk->getname()))
869869
{
870870
x_stack = tstk;
871871
break;
@@ -2127,7 +2127,7 @@ void MCDispatch::remove_transient_stack(MCStack *sptr)
21272127

21282128
void MCDispatch::timer(MCNameRef p_message, MCParameter *p_parameters)
21292129
{
2130-
if (MCNameIsEqualTo(p_message, MCM_internal, kMCCompareCaseless))
2130+
if (MCNameIsEqualToCaseless(p_message, MCM_internal))
21312131
{
21322132
MCStackSecurityExecutionTimeout();
21332133
}

engine/src/dsklnx.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -995,17 +995,17 @@ class MCLinuxDesktop: public MCSystemInterface
995995
!MCS_resolvepath(*t_tilde, &t_home))
996996
return false;
997997

998-
if (MCNameIsEqualTo(p_type, MCN_desktop, kMCCompareCaseless))
998+
if (MCNameIsEqualToCaseless(p_type, MCN_desktop))
999999
return MCStringFormat(r_folder, "%@/Desktop", *t_home);
1000-
else if (MCNameIsEqualTo(p_type, MCN_home, kMCCompareCaseless))
1000+
else if (MCNameIsEqualToCaseless(p_type, MCN_home))
10011001
return MCStringCopy(*t_home, r_folder);
1002-
else if (MCNameIsEqualTo(p_type, MCN_temporary, kMCCompareCaseless))
1002+
else if (MCNameIsEqualToCaseless(p_type, MCN_temporary))
10031003
return MCStringCreateWithCString("/tmp", r_folder);
10041004
// SN-2014-08-08: [[ Bug 13026 ]] Fix ported from 6.7
1005-
else if (MCNameIsEqualTo(p_type, MCN_engine, kMCCompareCaseless)
1005+
else if (MCNameIsEqualToCaseless(p_type, MCN_engine)
10061006
// SN-2015-04-20: [[ Bug 14295 ]] If we are here, we are a standalone
10071007
// so the resources folder is the engine folder.
1008-
|| MCNameIsEqualTo(p_type, MCN_resources, kMCCompareCaseless))
1008+
|| MCNameIsEqualToCaseless(p_type, MCN_resources))
10091009
{
10101010
uindex_t t_last_slash;
10111011

engine/src/dskmac.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3505,10 +3505,10 @@ struct MCMacDesktop: public MCSystemInterface, public MCMacSystemService
35053505

35063506

35073507
// SN-2014-08-08: [[ Bug 13026 ]] Fix ported from 6.7
3508-
if (MCNameIsEqualTo(p_type, MCN_engine, kMCCompareCaseless)
3508+
if (MCNameIsEqualToCaseless(p_type, MCN_engine)
35093509
// SN-2015-04-20: [[ Bug 14295 ]] If we are here, we are a standalone
35103510
// so the resources folder is the redirected engine folder
3511-
|| MCNameIsEqualTo(p_type, MCN_resources, kMCCompareCaseless))
3511+
|| MCNameIsEqualToCaseless(p_type, MCN_resources))
35123512
{
35133513
MCAutoStringRef t_engine_folder;
35143514
uindex_t t_last_slash;
@@ -3519,7 +3519,7 @@ struct MCMacDesktop: public MCSystemInterface, public MCMacSystemService
35193519
if (!MCStringCopySubstring(MCcmd, MCRangeMake(0, t_last_slash), &t_engine_folder))
35203520
return False;
35213521

3522-
if (MCNameIsEqualTo(p_type, MCN_resources, kMCCompareCaseless))
3522+
if (MCNameIsEqualToCaseless(p_type, MCN_resources))
35233523
{
35243524
if (!MCS_apply_redirect(*t_engine_folder, false, r_folder))
35253525
return False;

engine/src/dskw32.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ bool MCS_specialfolder_to_csidl(MCNameRef p_folder, MCNumberRef& r_csidl)
479479
{
480480
for (uindex_t i = 0 ; i < ELEMENTS(sysfolderlist) ; i++)
481481
{
482-
if (MCNameIsEqualTo(p_folder, *(sysfolderlist[i].token)))
482+
if (MCNameIsEqualToCaseless(p_folder, *(sysfolderlist[i].token)))
483483
{
484484
return MCNumberCreateWithUnsignedInteger(sysfolderlist[i].winfolder, r_csidl);
485485
}
@@ -1923,7 +1923,7 @@ struct MCWindowsDesktop: public MCSystemInterface, public MCWindowsSystemService
19231923
bool t_wasfound = false;
19241924
MCAutoNumberRef t_special_folder;
19251925
MCAutoStringRef t_native_path;
1926-
if (MCNameIsEqualTo(p_type, MCN_temporary))
1926+
if (MCNameIsEqualToCaseless(p_type, MCN_temporary))
19271927
{
19281928
MCAutoArray<unichar_t> t_buffer;
19291929
uindex_t t_length;
@@ -1942,8 +1942,8 @@ struct MCWindowsDesktop: public MCSystemInterface, public MCWindowsSystemService
19421942
}
19431943
}
19441944
}
1945-
else if (MCNameIsEqualTo(p_type, MCN_engine, kMCCompareCaseless)
1946-
|| MCNameIsEqualTo(p_type, MCN_resources, kMCCompareCaseless))
1945+
else if (MCNameIsEqualToCaseless(p_type, MCN_engine)
1946+
|| MCNameIsEqualToCaseless(p_type, MCN_resources))
19471947
{
19481948
MCSAutoLibraryRef t_self;
19491949
MCSLibraryCreateWithAddress(reinterpret_cast<void *>(legacy_path_to_nt_path),

engine/src/em-fontlist.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ MCFontnode::getfont(MCNameRef p_name,
101101
uint16_t p_size,
102102
uint16_t p_style)
103103
{
104-
if (!MCNameIsEqualTo(p_name, *m_requested_name))
104+
if (!MCNameIsEqualToCaseless(p_name, *m_requested_name))
105105
{
106106
return NULL;
107107
}

engine/src/em-system.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -612,23 +612,23 @@ MCEmscriptenSystem::GetStandardFolder(MCNameRef p_type,
612612
MCAutoStringRef t_path;
613613

614614
/* Decode the requested standard folder name */
615-
if (MCNameIsEqualTo(p_type, MCN_engine))
615+
if (MCNameIsEqualToCaseless(p_type, MCN_engine))
616616
{
617617
t_path_chars = kMCEmscriptenStandardFolderEngine;
618618
}
619-
else if (MCNameIsEqualTo(p_type, MCN_resources))
619+
else if (MCNameIsEqualToCaseless(p_type, MCN_resources))
620620
{
621621
t_path_chars = kMCEmscriptenStandardFolderResources;
622622
}
623-
else if (MCNameIsEqualTo(p_type, MCN_temporary))
623+
else if (MCNameIsEqualToCaseless(p_type, MCN_temporary))
624624
{
625625
t_path_chars = kMCEmscriptenStandardFolderTemporary;
626626
}
627-
else if (MCNameIsEqualTo(p_type, MCN_fonts))
627+
else if (MCNameIsEqualToCaseless(p_type, MCN_fonts))
628628
{
629629
t_path_chars = kMCEmscriptenStandardFolderFonts;
630630
}
631-
else if (MCNameIsEqualTo(p_type, MCN_home))
631+
else if (MCNameIsEqualToCaseless(p_type, MCN_home))
632632
{
633633
t_path_chars = kMCEmscriptenStandardFolderHome;
634634
}

engine/src/exec-extension.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ void MCEngineExecUnloadExtension(MCExecContext& ctxt, MCStringRef p_module_name)
339339
}
340340

341341
for(MCLoadedExtension *t_previous = nil, *t_ext = MCextensions; t_ext != nil; t_previous = t_ext, t_ext = t_ext -> next)
342-
if (MCNameIsEqualTo(t_ext -> module_name, *t_name))
342+
if (MCNameIsEqualToCaseless(t_ext -> module_name, *t_name))
343343
{
344344
bool t_in_use = false;
345345

0 commit comments

Comments
 (0)