Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions engine/src/bitmapeffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ static Exec_stat MCBitmapEffectLookupProperty(MCBitmapEffectType p_type, MCNameR
for(uint4 i = 0; i < ELEMENTS(s_bitmap_effect_properties); i++)
{
// Check to see if we've found a match.
if (MCNameIsEqualToCString(p_token, s_bitmap_effect_properties[i] . token, kMCCompareCaseless))
if (MCStringIsEqualToCString(MCNameGetString(p_token), s_bitmap_effect_properties[i] . token, kMCCompareCaseless))
{
// Check to see if its applicable to this type.
if ((s_bitmap_effect_properties[i] . mask & (1 << p_type)) != 0)
Expand Down Expand Up @@ -706,7 +706,7 @@ bool MCBitmapEffectsGetProperty(MCExecContext& ctxt, MCBitmapEffectsRef& self, M
// Fetch the property, then store it into the array.
MCBitmapEffectFetchProperty(ctxt, t_effect, s_bitmap_effect_properties[i] . value, t_value);
MCExecTypeConvertAndReleaseAlways(ctxt, t_value . type, &t_value , kMCExecValueTypeValueRef, &(&t_valueref));
MCArrayStoreValue(*v, ctxt . GetCaseSensitive(), MCNAME(s_bitmap_effect_properties[i] . token), *t_valueref);
MCArrayStoreValue(*v, false, MCNAME(s_bitmap_effect_properties[i] . token), *t_valueref);
}
}
r_value . arrayref_value = MCValueRetain(*v);
Expand Down Expand Up @@ -1019,11 +1019,9 @@ bool MCBitmapEffectsSetProperty(MCExecContext& ctxt, MCBitmapEffectsRef& self, M
if ((s_bitmap_effect_properties[i] . mask & (1 << t_type)) != 0)
{
MCValueRef t_prop_value;
MCNewAutoNameRef t_key;

/* UNCHECKED */ MCNameCreateWithCString(s_bitmap_effect_properties[i] . token, &t_key);
// If we don't have the given element, then move to the next one
if (!MCArrayFetchValue(*t_array, kMCCompareExact, *t_key, t_prop_value))
if (!MCArrayFetchValue(*t_array, false, MCNAME(s_bitmap_effect_properties[i] . token), t_prop_value))
continue;

// Otherwise, fetch the keys value and attempt to set the property
Expand Down
6 changes: 3 additions & 3 deletions engine/src/block.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ MCBlock::MCBlock(const MCBlock &bref) : MCDLlist(bref)
// MW-2012-02-17: [[ SplitTextAttrs ]] Copy across the font attrs the other
// block has.
if ((flags & F_HAS_FNAME) != 0)
/* UNCHECKED */ MCNameClone(bref.atts->fontname, atts -> fontname);
atts->fontname = MCValueRetain(bref.atts->fontname);
if ((flags & F_HAS_FSIZE) != 0)
atts -> fontsize = bref . atts -> fontsize;
if ((flags & F_HAS_FSTYLE) != 0)
Expand Down Expand Up @@ -215,7 +215,7 @@ IO_stat MCBlock::load(IO_handle stream, uint32_t version, bool is_ext)
// MW-2012-02-17: [[ SplitTextAttrs ]] Only set the font attrs if they are
// not inherited.
if (!getflag(F_INHERIT_FNAME))
MCNameClone(t_fontname, atts -> fontname);
atts->fontname = MCValueRetain(t_fontname);
if (!getflag(F_INHERIT_FSIZE))
atts -> fontsize = t_fontsize;
if (!getflag(F_INHERIT_FSTYLE))
Expand Down Expand Up @@ -1837,7 +1837,7 @@ void MCBlock::freeatts()
freerefs();
// MW-2012-02-17: [[ SplitTextAttrs ]] Free the fontname name if we have that attr.
if (flags & F_HAS_FNAME)
MCNameDelete(atts -> fontname);
MCValueRelease(atts -> fontname);
if (flags & F_HAS_COLOR)
delete atts->color;
if (flags & F_HAS_BACK_COLOR)
Expand Down
4 changes: 2 additions & 2 deletions engine/src/button.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1643,7 +1643,7 @@ Boolean MCButton::doubleup(uint2 which)
#ifdef _MAC_DESKTOP
void MCButton::timer(MCNameRef mptr, MCParameter *params)
{
if (MCNameIsEqualTo(mptr, MCM_internal, kMCCompareCaseless))
if (MCNameIsEqualToCaseless(mptr, MCM_internal))
{
if (state & CS_SHOW_DEFAULT)
{
Expand Down Expand Up @@ -2447,7 +2447,7 @@ class ButtonMenuCallback : public IParseMenuCallback
newbutton->menubutton = parent->menubutton;
newbutton->menucontrol = MENUCONTROL_ITEM;
newbutton->m_theme_type = kMCPlatformControlTypeMenu;
if (MCNameGetCharAtIndex(newbutton -> getname(), 0) == '-')
if (MCStringGetNativeCharAtIndex(MCNameGetString(newbutton->getname()), 0) == '-')
{
newbutton->rect.height = 2;
newbutton->flags = DIVIDER_FLAGS;
Expand Down
4 changes: 1 addition & 3 deletions engine/src/card.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1048,7 +1048,7 @@ Boolean MCCard::doubleup(uint2 which)

void MCCard::timer(MCNameRef mptr, MCParameter *params)
{
if (MCNameIsEqualTo(mptr, MCM_idle, kMCCompareCaseless))
if (MCNameIsEqualToCaseless(mptr, MCM_idle))
{
if (opened)
{
Expand Down Expand Up @@ -1861,8 +1861,6 @@ void MCCard::geometrychanged(const MCRectangle &p_rect)

MCCard *MCCard::findname(Chunk_term type, MCNameRef inname)
{
// MCNewAutoNameRef t_name;
// /* UNCHECKED */ MCNameCreateWithOldString(inname, &t_name);
if (type == CT_CARD && MCU_matchname(inname, CT_CARD, getname()))
return this;
else
Expand Down
2 changes: 1 addition & 1 deletion engine/src/control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ Boolean MCControl::doubleup(uint2 which)

void MCControl::timer(MCNameRef mptr, MCParameter *params)
{
if (MCNameIsEqualTo(mptr, MCM_idle, kMCCompareCaseless))
if (MCNameIsEqualToCaseless(mptr, MCM_idle))
{
if (opened && getstack()->gettool(this) == T_BROWSE)
{
Expand Down
13 changes: 4 additions & 9 deletions engine/src/dispatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -704,11 +704,7 @@ static MCStack* script_only_stack_from_bytes(uint8_t *p_bytes,
return nullptr;
}

MCNewAutoNameRef t_script_name;
if (!MCNameClone(sp . gettoken_nameref(), &t_script_name))
{
return nullptr;
}
MCNewAutoNameRef t_script_name = sp.gettoken_nameref();

// Parse end of line.
Parse_stat t_stat;
Expand Down Expand Up @@ -855,8 +851,7 @@ void MCDispatch::processstack(MCStringRef p_openpath, MCStack* &x_stack)
{
if (x_stack->hasname(tstk->getname()))
{
MCAutoNameRef t_stack_name;
/* UNCHECKED */ t_stack_name . Clone(x_stack -> getname());
MCNewAutoNameRef t_stack_name = x_stack->getname();

delete x_stack;
x_stack = nullptr;
Expand All @@ -870,7 +865,7 @@ void MCDispatch::processstack(MCStringRef p_openpath, MCStack* &x_stack)
tstk = stacks;
do
{
if (MCNameIsEqualTo(t_stack_name, tstk->getname(), kMCCompareCaseless))
if (MCNameIsEqualToCaseless(*t_stack_name, tstk->getname()))
{
x_stack = tstk;
break;
Expand Down Expand Up @@ -2132,7 +2127,7 @@ void MCDispatch::remove_transient_stack(MCStack *sptr)

void MCDispatch::timer(MCNameRef p_message, MCParameter *p_parameters)
{
if (MCNameIsEqualTo(p_message, MCM_internal, kMCCompareCaseless))
if (MCNameIsEqualToCaseless(p_message, MCM_internal))
{
MCStackSecurityExecutionTimeout();
}
Expand Down
12 changes: 6 additions & 6 deletions engine/src/dsklnx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -995,17 +995,17 @@ class MCLinuxDesktop: public MCSystemInterface
!MCS_resolvepath(*t_tilde, &t_home))
return false;

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

Expand Down Expand Up @@ -1940,7 +1940,7 @@ class MCLinuxDesktop: public MCSystemInterface
sigaction(SIGCHLD, &action, NULL);
while (MCnprocesses--)
{
MCNameDelete(MCprocesses[MCnprocesses] . name);
MCValueRelease(MCprocesses[MCnprocesses] . name);
MCprocesses[MCnprocesses] . name = nil;
if (MCprocesses[MCnprocesses].pid != 0
&& (MCprocesses[MCnprocesses].ihandle != NULL
Expand Down
10 changes: 5 additions & 5 deletions engine/src/dskmac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3505,10 +3505,10 @@ struct MCMacDesktop: public MCSystemInterface, public MCMacSystemService


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

if (MCNameIsEqualTo(p_type, MCN_resources, kMCCompareCaseless))
if (MCNameIsEqualToCaseless(p_type, MCN_resources))
{
if (!MCS_apply_redirect(*t_engine_folder, false, r_folder))
return False;
Expand Down Expand Up @@ -4552,7 +4552,7 @@ struct MCMacDesktop: public MCSystemInterface, public MCMacSystemService
sigaction(SIGCHLD, &action, NULL);
while (MCnprocesses--)
{
MCNameDelete(MCprocesses[MCnprocesses] . name);
MCValueRelease(MCprocesses[MCnprocesses] . name);
MCprocesses[MCnprocesses] . name = nil;
if (MCprocesses[MCnprocesses].pid != 0
&& (MCprocesses[MCnprocesses].ihandle != NULL
Expand Down Expand Up @@ -5580,7 +5580,7 @@ static void MCS_startprocess_launch(MCNameRef name, MCStringRef docname, Open_mo
if (MCStringGetLength(docname))
{
for (i = 0 ; i < MCnprocesses ; i++)
if (MCNameIsEqualTo(name, MCprocesses[i].name, kMCCompareExact))
if (MCNameIsEqualTo(name, MCprocesses[i].name, kMCStringOptionCompareExact))
break;
if (i == MCnprocesses)
{
Expand Down
8 changes: 4 additions & 4 deletions engine/src/dskw32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ bool MCS_specialfolder_to_csidl(MCNameRef p_folder, MCNumberRef& r_csidl)
{
for (uindex_t i = 0 ; i < ELEMENTS(sysfolderlist) ; i++)
{
if (MCNameIsEqualTo(p_folder, *(sysfolderlist[i].token)))
if (MCNameIsEqualToCaseless(p_folder, *(sysfolderlist[i].token)))
{
return MCNumberCreateWithUnsignedInteger(sysfolderlist[i].winfolder, r_csidl);
}
Expand Down Expand Up @@ -1923,7 +1923,7 @@ struct MCWindowsDesktop: public MCSystemInterface, public MCWindowsSystemService
bool t_wasfound = false;
MCAutoNumberRef t_special_folder;
MCAutoStringRef t_native_path;
if (MCNameIsEqualTo(p_type, MCN_temporary))
if (MCNameIsEqualToCaseless(p_type, MCN_temporary))
{
MCAutoArray<unichar_t> t_buffer;
uindex_t t_length;
Expand All @@ -1942,8 +1942,8 @@ struct MCWindowsDesktop: public MCSystemInterface, public MCWindowsSystemService
}
}
}
else if (MCNameIsEqualTo(p_type, MCN_engine, kMCCompareCaseless)
|| MCNameIsEqualTo(p_type, MCN_resources, kMCCompareCaseless))
else if (MCNameIsEqualToCaseless(p_type, MCN_engine)
|| MCNameIsEqualToCaseless(p_type, MCN_resources))
{
MCSAutoLibraryRef t_self;
MCSLibraryCreateWithAddress(reinterpret_cast<void *>(legacy_path_to_nt_path),
Expand Down
2 changes: 1 addition & 1 deletion engine/src/em-fontlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ MCFontnode::getfont(MCNameRef p_name,
uint16_t p_size,
uint16_t p_style)
{
if (!MCNameIsEqualTo(p_name, *m_requested_name))
if (!MCNameIsEqualToCaseless(p_name, *m_requested_name))
{
return NULL;
}
Expand Down
10 changes: 5 additions & 5 deletions engine/src/em-system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -612,23 +612,23 @@ MCEmscriptenSystem::GetStandardFolder(MCNameRef p_type,
MCAutoStringRef t_path;

/* Decode the requested standard folder name */
if (MCNameIsEqualTo(p_type, MCN_engine))
if (MCNameIsEqualToCaseless(p_type, MCN_engine))
{
t_path_chars = kMCEmscriptenStandardFolderEngine;
}
else if (MCNameIsEqualTo(p_type, MCN_resources))
else if (MCNameIsEqualToCaseless(p_type, MCN_resources))
{
t_path_chars = kMCEmscriptenStandardFolderResources;
}
else if (MCNameIsEqualTo(p_type, MCN_temporary))
else if (MCNameIsEqualToCaseless(p_type, MCN_temporary))
{
t_path_chars = kMCEmscriptenStandardFolderTemporary;
}
else if (MCNameIsEqualTo(p_type, MCN_fonts))
else if (MCNameIsEqualToCaseless(p_type, MCN_fonts))
{
t_path_chars = kMCEmscriptenStandardFolderFonts;
}
else if (MCNameIsEqualTo(p_type, MCN_home))
else if (MCNameIsEqualToCaseless(p_type, MCN_home))
{
t_path_chars = kMCEmscriptenStandardFolderHome;
}
Expand Down
4 changes: 1 addition & 3 deletions engine/src/exec-ad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,10 @@ void MCAdExecCreateAd(MCExecContext& ctxt, MCStringRef p_name, MCStringRef p_typ
if (t_success)
{
t_timeout = 0;
MCNewAutoNameRef t_key;
MCNameCreateWithCString("refresh", &t_key);

MCValueRef t_value;

if (p_metadata != nil && MCArrayFetchValue(p_metadata, false, *t_key, t_value))
if (p_metadata != nil && MCArrayFetchValue(p_metadata, false, MCNAME("refresh"), t_value))
t_timeout = MCNumberFetchAsUnsignedInteger((MCNumberRef)t_value);
if (t_type == kMCAdTypeFullscreen)
t_timeout = 0;
Expand Down
2 changes: 1 addition & 1 deletion engine/src/exec-extension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ void MCEngineExecUnloadExtension(MCExecContext& ctxt, MCStringRef p_module_name)
}

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

Expand Down
2 changes: 1 addition & 1 deletion engine/src/exec-files.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ void MCFilesEvalSpecialFolderPath(MCExecContext& ctxt, MCStringRef p_folder, MCS
t_error = false;
MCNameCreate(p_folder, &t_path);
// We have a special, mode-specific resource folder
if (MCNameIsEqualTo(*t_path, MCN_resources, kMCStringOptionCompareCaseless))
if (MCNameIsEqualToCaseless(*t_path, MCN_resources))
MCModeGetResourcesFolder(r_path);
else if (!MCS_getspecialfolder(*t_path, r_path))
t_error = true;
Expand Down
2 changes: 1 addition & 1 deletion engine/src/exec-interface-field-chunk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3248,7 +3248,7 @@ void MCBlock::SetTextFont(MCExecContext& ctxt, MCStringRef p_fontname)
flags &= ~F_HAS_FNAME;
if (atts != nil)
{
MCNameDelete(atts -> fontname);
MCValueRelease(atts -> fontname);
atts -> fontname = nil;
}
}
Expand Down
2 changes: 1 addition & 1 deletion engine/src/exec-interface-group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ void MCGroup::SetHilitedButtonName(MCExecContext& ctxt, uint32_t part, MCStringR
// Clicking on the button attemps to hilite the option "title,menu,maximize,minimise,close"
// but only "title,menu,minimize,maximise,close" exists, returning a nil NameRef
MCNameRef t_nameref;
t_nameref = MCNameLookup(p_name);
t_nameref = MCNameLookupCaseless(p_name);
if (t_nameref != nil)
bptr->resethilite(part, bptr->hasname(t_nameref));
else
Expand Down
6 changes: 1 addition & 5 deletions engine/src/exec-interface-image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -868,10 +868,6 @@ void MCImage::GetMetadataProperty(MCExecContext& ctxt, MCNameRef p_prop, MCExecV
MCAutoArrayRef v;
t_stat = MCArrayCreateMutable(&v);

MCNewAutoNameRef t_key;
if (t_stat)
t_stat = MCNameCreateWithCString("density", &t_key);

MCValueRef t_prop_value;

if (t_stat)
Expand All @@ -881,7 +877,7 @@ void MCImage::GetMetadataProperty(MCExecContext& ctxt, MCNameRef p_prop, MCExecV
}

if (t_stat)
t_stat = MCArrayStoreValue(*v, kMCCompareExact, *t_key, t_prop_value);
t_stat = MCArrayStoreValue(*v, false, MCNAME("density"), t_prop_value);

if (t_stat)
{
Expand Down
5 changes: 2 additions & 3 deletions engine/src/exec-interface-object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1468,10 +1468,9 @@ void MCObject::SetName(MCExecContext& ctxt, MCStringRef p_name)
// change case of names of objects.
if (t_success && getname() != *t_new_name)
{
MCAutoNameRef t_old_name;
t_old_name . Clone(getname());
MCNewAutoNameRef t_old_name = getname();
setname(*t_new_name);
message_with_valueref_args(MCM_name_changed, t_old_name, getname());
message_with_valueref_args(MCM_name_changed, *t_old_name, getname());
}

if (t_success)
Expand Down
Loading