diff --git a/engine/src/bitmapeffect.cpp b/engine/src/bitmapeffect.cpp index 48d454646fa..897f419c5ab 100644 --- a/engine/src/bitmapeffect.cpp +++ b/engine/src/bitmapeffect.cpp @@ -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) @@ -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); @@ -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 diff --git a/engine/src/block.cpp b/engine/src/block.cpp index 6539f42c076..485121593bc 100755 --- a/engine/src/block.cpp +++ b/engine/src/block.cpp @@ -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) @@ -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)) @@ -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) diff --git a/engine/src/button.cpp b/engine/src/button.cpp index a5c32591cbb..b72b01bbd20 100755 --- a/engine/src/button.cpp +++ b/engine/src/button.cpp @@ -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) { @@ -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; diff --git a/engine/src/card.cpp b/engine/src/card.cpp index 6d78e3c1b0f..04b82d1625e 100644 --- a/engine/src/card.cpp +++ b/engine/src/card.cpp @@ -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) { @@ -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 diff --git a/engine/src/control.cpp b/engine/src/control.cpp index d92d2de8196..874abed952e 100644 --- a/engine/src/control.cpp +++ b/engine/src/control.cpp @@ -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) { diff --git a/engine/src/dispatch.cpp b/engine/src/dispatch.cpp index c4e26961578..2960579aada 100644 --- a/engine/src/dispatch.cpp +++ b/engine/src/dispatch.cpp @@ -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; @@ -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; @@ -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; @@ -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(); } diff --git a/engine/src/dsklnx.cpp b/engine/src/dsklnx.cpp index c4ff9c61768..262fb8529d0 100644 --- a/engine/src/dsklnx.cpp +++ b/engine/src/dsklnx.cpp @@ -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; @@ -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 diff --git a/engine/src/dskmac.cpp b/engine/src/dskmac.cpp index e2d55df39cf..66c99a9ab89 100644 --- a/engine/src/dskmac.cpp +++ b/engine/src/dskmac.cpp @@ -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; @@ -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; @@ -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 @@ -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) { diff --git a/engine/src/dskw32.cpp b/engine/src/dskw32.cpp index 566d9670228..83de4f02863 100644 --- a/engine/src/dskw32.cpp +++ b/engine/src/dskw32.cpp @@ -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); } @@ -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 t_buffer; uindex_t t_length; @@ -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(legacy_path_to_nt_path), diff --git a/engine/src/em-fontlist.cpp b/engine/src/em-fontlist.cpp index 577d3d7deed..6ed76956dc1 100644 --- a/engine/src/em-fontlist.cpp +++ b/engine/src/em-fontlist.cpp @@ -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; } diff --git a/engine/src/em-system.cpp b/engine/src/em-system.cpp index acdcbec5899..fb1f2b4fd95 100644 --- a/engine/src/em-system.cpp +++ b/engine/src/em-system.cpp @@ -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; } diff --git a/engine/src/exec-ad.cpp b/engine/src/exec-ad.cpp index dc2ce48446a..a7b8c9adba3 100644 --- a/engine/src/exec-ad.cpp +++ b/engine/src/exec-ad.cpp @@ -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; diff --git a/engine/src/exec-extension.cpp b/engine/src/exec-extension.cpp index a60db457bd5..4d3e622c299 100644 --- a/engine/src/exec-extension.cpp +++ b/engine/src/exec-extension.cpp @@ -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; diff --git a/engine/src/exec-files.cpp b/engine/src/exec-files.cpp index b16d6b1bc80..9d6006f0050 100644 --- a/engine/src/exec-files.cpp +++ b/engine/src/exec-files.cpp @@ -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; diff --git a/engine/src/exec-interface-field-chunk.cpp b/engine/src/exec-interface-field-chunk.cpp index c7772d86a74..ca6a17af414 100644 --- a/engine/src/exec-interface-field-chunk.cpp +++ b/engine/src/exec-interface-field-chunk.cpp @@ -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; } } diff --git a/engine/src/exec-interface-group.cpp b/engine/src/exec-interface-group.cpp index 6f825a1d56c..f39d166646f 100644 --- a/engine/src/exec-interface-group.cpp +++ b/engine/src/exec-interface-group.cpp @@ -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 diff --git a/engine/src/exec-interface-image.cpp b/engine/src/exec-interface-image.cpp index f0a76a747f2..072b25c9800 100644 --- a/engine/src/exec-interface-image.cpp +++ b/engine/src/exec-interface-image.cpp @@ -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) @@ -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) { diff --git a/engine/src/exec-interface-object.cpp b/engine/src/exec-interface-object.cpp index 1e8c1bd5b08..44e23a7ccc6 100644 --- a/engine/src/exec-interface-object.cpp +++ b/engine/src/exec-interface-object.cpp @@ -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) diff --git a/engine/src/exec-interface-stack.cpp b/engine/src/exec-interface-stack.cpp index c90c87fed60..5eb149b6319 100644 --- a/engine/src/exec-interface-stack.cpp +++ b/engine/src/exec-interface-stack.cpp @@ -403,8 +403,7 @@ void MCStack::SetName(MCExecContext& ctxt, MCStringRef p_name) MCNewAutoNameRef t_old_name; if (getextendedstate(ECS_HAS_PARENTSCRIPTS)) { - if (t_success) - t_success = MCNameClone(getname(), &t_old_name); + t_old_name = getname(); } // We don't allow ',' in stack names - so coerce to '_'. @@ -1155,7 +1154,6 @@ void MCStack::SetSubstacks(MCExecContext& ctxt, MCStringRef p_substacks) while (t_success && t_old_offset <= t_length) { MCAutoStringRef t_name_string; - MCNewAutoNameRef t_name; if (!MCStringFirstIndexOfChar(p_substacks, '\n', t_old_offset, kMCCompareExact, t_new_offset)) t_new_offset = t_length; @@ -1170,10 +1168,10 @@ void MCStack::SetSubstacks(MCExecContext& ctxt, MCStringRef p_substacks) { // Lookup 't_name_string' as a name, if it doesn't exist it can't exist as a substack // name. - &t_name = MCValueRetain(MCNameLookup(*t_name_string)); - if (*t_name != nil) - { - while (tsub -> hasname(*t_name)) + MCNameRef t_name = MCNameLookupCaseless(*t_name_string); + if (t_name != nullptr) + { + while (tsub -> hasname(t_name)) { tsub = (MCStack *)tsub->nptr; if (tsub == oldsubs) @@ -1509,25 +1507,23 @@ void MCStack::SetMenuBar(MCExecContext& ctxt, MCStringRef p_menubar) if (t_success) t_success = MCNameCreate(p_menubar, &t_new_menubar); - if (t_success && !MCNameIsEqualTo(getmenubar(), *t_new_menubar, kMCCompareCaseless)) + if (t_success && !MCNameIsEqualToCaseless(getmenubar(), *t_new_menubar)) { - MCNameDelete(_menubar); - t_success = MCNameClone(*t_new_menubar, _menubar); - if (t_success) - { - if (!hasmenubar()) - flags &= ~F_MENU_BAR; - else - flags |= F_MENU_BAR; - if (opened) - { - setgeom(); - updatemenubar(); + MCValueAssign(_menubar, *t_new_menubar); + + if (!hasmenubar()) + flags &= ~F_MENU_BAR; + else + flags |= F_MENU_BAR; + + if (opened) + { + setgeom(); + updatemenubar(); - // MW-2011-08-17: [[ Redraw ]] Tell the stack to dirty all of itself. - dirtyall(); - } - } + // MW-2011-08-17: [[ Redraw ]] Tell the stack to dirty all of itself. + dirtyall(); + } } if (t_success) diff --git a/engine/src/exec-interface.cpp b/engine/src/exec-interface.cpp index 84d40e93228..ec444d79490 100644 --- a/engine/src/exec-interface.cpp +++ b/engine/src/exec-interface.cpp @@ -1311,7 +1311,7 @@ void MCInterfaceEvalFlushEvents(MCExecContext& ctxt, MCNameRef p_name, MCStringR }; for (integer_t i = 0; i < FE_LAST; i++) { - if (MCNameIsEqualTo(p_name, enames[i])) + if (MCNameIsEqualToCaseless(p_name, enames[i])) { MCscreen->flushevents(i); break; diff --git a/engine/src/exec-mail.cpp b/engine/src/exec-mail.cpp index 608ded0aa73..d3b5cc07065 100644 --- a/engine/src/exec-mail.cpp +++ b/engine/src/exec-mail.cpp @@ -49,12 +49,6 @@ void MCMailDoComposeMail(MCExecContext& ctxt, MCStringRef p_to, MCStringRef p_cc MCAutoArray t_attachments; - MCNewAutoNameRef t_data_name, t_file_name, t_type_name, t_name_name; - MCNameCreateWithCString("data", &t_data_name); - MCNameCreateWithCString("file", &t_file_name); - MCNameCreateWithCString("type", &t_type_name); - MCNameCreateWithCString("name", &t_name_name); - if (p_attachments != nil && !MCArrayIsEmpty(p_attachments)) { MCValueRef t_data; @@ -72,19 +66,19 @@ void MCMailDoComposeMail(MCExecContext& ctxt, MCStringRef p_to, MCStringRef p_cc if (!MCValueIsArray(t_value)) continue; - if (!MCArrayFetchValue((MCArrayRef)t_value, false, *t_data_name, t_data) || + if (!MCArrayFetchValue((MCArrayRef)t_value, false, MCNAME("data"), t_data) || !ctxt . ConvertToData(t_data, t_attachment . data)) t_attachment . data = nil; - if (!MCArrayFetchValue((MCArrayRef)t_value, false, *t_file_name, t_file) || + if (!MCArrayFetchValue((MCArrayRef)t_value, false, MCNAME("file"), t_file) || !ctxt . ConvertToString(t_file, t_attachment . file)) t_attachment . file = nil; - if (!MCArrayFetchValue((MCArrayRef)t_value, false, *t_type_name, t_type) || + if (!MCArrayFetchValue((MCArrayRef)t_value, false, MCNAME("type"), t_type) || !ctxt . ConvertToString(t_type, t_attachment . type)) t_attachment . type = nil; - if (!MCArrayFetchValue((MCArrayRef)t_value, false, *t_name_name, t_name) || + if (!MCArrayFetchValue((MCArrayRef)t_value, false, MCNAME("name"), t_name) || !ctxt . ConvertToString(t_name, t_attachment . name)) t_attachment . name = nil; @@ -93,19 +87,19 @@ void MCMailDoComposeMail(MCExecContext& ctxt, MCStringRef p_to, MCStringRef p_cc } else { - if (!MCArrayFetchValue(p_attachments, false, *t_data_name, t_data) || + if (!MCArrayFetchValue(p_attachments, false, MCNAME("data"), t_data) || !ctxt . ConvertToData(t_data, t_attachment . data)) t_attachment . data = nil; - if (!MCArrayFetchValue(p_attachments, false, *t_file_name, t_file) || + if (!MCArrayFetchValue(p_attachments, false, MCNAME("file"), t_file) || !ctxt . ConvertToString(t_file, t_attachment . file)) t_attachment . file = nil; - if (!MCArrayFetchValue(p_attachments, false, *t_type_name, t_type) || + if (!MCArrayFetchValue(p_attachments, false, MCNAME("type"), t_type) || !ctxt . ConvertToString(t_type, t_attachment . type)) t_attachment . type = nil; - if (!MCArrayFetchValue(p_attachments, false, *t_name_name, t_name) || + if (!MCArrayFetchValue(p_attachments, false, MCNAME("name"), t_name) || !ctxt . ConvertToString(t_name, t_attachment . name)) t_attachment . name = nil; diff --git a/engine/src/exec-multimedia.cpp b/engine/src/exec-multimedia.cpp index 2b8944a2303..d8986293c29 100644 --- a/engine/src/exec-multimedia.cpp +++ b/engine/src/exec-multimedia.cpp @@ -575,7 +575,10 @@ static MCPlayer* MCMultimediaExecGetClip(MCExecContext& ctxt, MCStringRef p_clip if (p_chunk_type == CT_EXPRESSION) { // AL-2014-05-27: [[ Bug 12517 ]] MCNameLookup does not increase the ref count - return MCPlayer::FindPlayerByName(MCNameLookup(p_clip)); + MCNameRef t_name = MCNameLookupCaseless(p_clip); + if (t_name == nullptr) + return nullptr; + return MCPlayer::FindPlayerByName(t_name); } if (p_chunk_type == CT_ID) diff --git a/engine/src/exec-notification.cpp b/engine/src/exec-notification.cpp index a7430487fe5..8b12ba9f40f 100644 --- a/engine/src/exec-notification.cpp +++ b/engine/src/exec-notification.cpp @@ -78,36 +78,19 @@ void MCNotificationGetDetails(MCExecContext& ctxt, int32_t p_id, MCArrayRef& r_d MCAutoArrayRef t_details; /* UNCHECKED */ MCArrayCreateMutable(&t_details); - MCNewAutoNameRef t_key_body; - MCNameCreateWithCString("body", &t_key_body); - MCArrayStoreValue(*t_details, false, *t_key_body, t_notification.body); + MCArrayStoreValue(*t_details, false, MCNAME("body"), t_notification.body); + MCArrayStoreValue(*t_details, false, MCNAME("title"), t_notification.action); + MCArrayStoreValue(*t_details, false, MCNAME("payload"), t_notification.user_info); - MCNewAutoNameRef t_key_title; - MCNameCreateWithCString("title", &t_key_title); - MCArrayStoreValue(*t_details, false, *t_key_title, t_notification.action); - - MCNewAutoNameRef t_key_payload; - MCNameCreateWithCString("payload", &t_key_payload); - MCArrayStoreValue(*t_details, false, *t_key_payload, t_notification.user_info); - - MCNewAutoNameRef t_key_time; - MCNameCreateWithCString("time", &t_key_time); MCAutoNumberRef t_notification_time; MCNumberCreateWithUnsignedInteger(t_notification.time, &t_notification_time); - MCArrayStoreValue(*t_details, false, *t_key_time, *t_notification_time); + MCArrayStoreValue(*t_details, false, MCNAME("time"), *t_notification_time); - MCNewAutoNameRef t_key_badge_value; - MCNameCreateWithCString("badge value", &t_key_badge_value); MCAutoNumberRef t_notification_badge_value; MCNumberCreateWithUnsignedInteger(t_notification.badge_value, &t_notification_badge_value); - MCArrayStoreValue(*t_details, false, *t_key_badge_value, *t_notification_badge_value); + MCArrayStoreValue(*t_details, false, MCNAME("badge value"), *t_notification_badge_value); - MCNewAutoNameRef t_key_play_sound; - MCNameCreateWithCString("play sound", &t_key_play_sound); - if(t_notification.play_sound) - MCArrayStoreValue(*t_details, false, *t_key_play_sound, kMCTrue); - else - MCArrayStoreValue(*t_details, false, *t_key_play_sound, kMCFalse); + MCArrayStoreValue(*t_details, false, MCNAME("play sound"), t_notification.play_sound ? kMCTrue : kMCFalse); MCArrayCopy(*t_details, r_details); diff --git a/engine/src/exec-pasteboard.cpp b/engine/src/exec-pasteboard.cpp index 61f56336dba..6dd84e1648c 100644 --- a/engine/src/exec-pasteboard.cpp +++ b/engine/src/exec-pasteboard.cpp @@ -391,58 +391,58 @@ bool MCPasteboardCopyAsTypeForLegacyClipboard(const MCClipboard* p_clipboard, MC MCTransferType MCPasteboardTransferTypeFromName(MCNameRef p_key, bool p_legacy = false) { - if (MCNameIsEqualTo(p_key, MCN_text)) + if (MCNameIsEqualToCaseless(p_key, MCN_text)) return TRANSFER_TYPE_TEXT; - if (MCNameIsEqualTo(p_key, MCN_unicode)) + if (MCNameIsEqualToCaseless(p_key, MCN_unicode)) return TRANSFER_TYPE_UNICODE_TEXT; - if (MCNameIsEqualTo(p_key, MCN_styles)) + if (MCNameIsEqualToCaseless(p_key, MCN_styles)) return TRANSFER_TYPE_STYLED_TEXT; - if (MCNameIsEqualTo(p_key, MCN_styledtext)) + if (MCNameIsEqualToCaseless(p_key, MCN_styledtext)) return TRANSFER_TYPE_STYLED_TEXT_ARRAY; - if (MCNameIsEqualTo(p_key, MCN_rtf)) + if (MCNameIsEqualToCaseless(p_key, MCN_rtf)) return p_legacy ? TRANSFER_TYPE_RTF_TEXT : TRANSFER_TYPE_RTF; - if (MCNameIsEqualTo(p_key, MCN_html)) + if (MCNameIsEqualToCaseless(p_key, MCN_html)) return p_legacy ? TRANSFER_TYPE_HTML_TEXT : TRANSFER_TYPE_HTML; - if (MCNameIsEqualTo(p_key, MCN_files)) + if (MCNameIsEqualToCaseless(p_key, MCN_files)) return TRANSFER_TYPE_FILES; - if (MCNameIsEqualTo(p_key, MCN_private)) + if (MCNameIsEqualToCaseless(p_key, MCN_private)) return TRANSFER_TYPE_PRIVATE; - if (MCNameIsEqualTo(p_key, MCN_image)) + if (MCNameIsEqualToCaseless(p_key, MCN_image)) return TRANSFER_TYPE_IMAGE; - if (MCNameIsEqualTo(p_key, MCN_objects)) + if (MCNameIsEqualToCaseless(p_key, MCN_objects)) return TRANSFER_TYPE_OBJECTS; - if (MCNameIsEqualTo(p_key, MCN_rtftext)) + if (MCNameIsEqualToCaseless(p_key, MCN_rtftext)) return TRANSFER_TYPE_RTF_TEXT; - if (MCNameIsEqualTo(p_key, MCN_htmltext)) + if (MCNameIsEqualToCaseless(p_key, MCN_htmltext)) return TRANSFER_TYPE_HTML_TEXT; - if (MCNameIsEqualTo(p_key, MCN_png)) + if (MCNameIsEqualToCaseless(p_key, MCN_png)) return TRANSFER_TYPE_PNG; - if (MCNameIsEqualTo(p_key, MCN_gif)) + if (MCNameIsEqualToCaseless(p_key, MCN_gif)) return TRANSFER_TYPE_GIF; - if (MCNameIsEqualTo(p_key, MCN_jpeg)) + if (MCNameIsEqualToCaseless(p_key, MCN_jpeg)) return TRANSFER_TYPE_JPEG; - if (MCNameIsEqualTo(p_key, MCN_win_bitmap)) + if (MCNameIsEqualToCaseless(p_key, MCN_win_bitmap)) return TRANSFER_TYPE_BMP; - if (MCNameIsEqualTo(p_key, MCN_win_metafile)) + if (MCNameIsEqualToCaseless(p_key, MCN_win_metafile)) return TRANSFER_TYPE_WIN_METAFILE; - if (MCNameIsEqualTo(p_key, MCN_win_enh_metafile)) + if (MCNameIsEqualToCaseless(p_key, MCN_win_enh_metafile)) return TRANSFER_TYPE_WIN_ENH_METAFILE; return TRANSFER_TYPE_NULL; diff --git a/engine/src/exec-sensor.cpp b/engine/src/exec-sensor.cpp index 9d516e25d78..22f3ba2cf3a 100644 --- a/engine/src/exec-sensor.cpp +++ b/engine/src/exec-sensor.cpp @@ -131,58 +131,42 @@ static bool __MCSensorGetDetailedLocationArray(const MCSensorLocationReading& p_ /* UNCHECKED */ MCArrayCreateMutable(&t_location_array); MCAutoNumberRef t_latitude; - MCNewAutoNameRef t_latitude_name; /* UNCHECKED */ MCNumberCreateWithReal(p_reading.latitude, &t_latitude); - /* UNCHECKED */ MCNameCreateWithCString("latitude", &t_latitude_name); - /* UNCHECKED */ MCArrayStoreValue(*t_location_array, false, *t_latitude_name, *t_latitude); + /* UNCHECKED */ MCArrayStoreValue(*t_location_array, false, MCNAME("latitude"), *t_latitude); MCAutoNumberRef t_longitude; - MCNewAutoNameRef t_longitude_name; /* UNCHECKED */ MCNumberCreateWithReal(p_reading.longitude, &t_longitude); - /* UNCHECKED */ MCNameCreateWithCString("longitude", &t_longitude_name); - /* UNCHECKED */ MCArrayStoreValue(*t_location_array, false, *t_longitude_name, *t_longitude); + /* UNCHECKED */ MCArrayStoreValue(*t_location_array, false, MCNAME("longitude"), *t_longitude); MCAutoNumberRef t_altitude; - MCNewAutoNameRef t_altitude_name; /* UNCHECKED */ MCNumberCreateWithReal(p_reading.altitude, &t_altitude); - /* UNCHECKED */ MCNameCreateWithCString("altitude", &t_altitude_name); - /* UNCHECKED */ MCArrayStoreValue(*t_location_array, false, *t_altitude_name, *t_altitude); + /* UNCHECKED */ MCArrayStoreValue(*t_location_array, false, MCNAME("altitude"), *t_altitude); // MM-2013-02-21: Add speed and course to detailed location readings. if (p_reading.speed >= 0.0f) { MCAutoNumberRef t_speed; - MCNewAutoNameRef t_speed_name; /* UNCHECKED */ MCNumberCreateWithReal(p_reading.speed, &t_speed); - /* UNCHECKED */ MCNameCreateWithCString("speed", &t_speed_name); - /* UNCHECKED */ MCArrayStoreValue(*t_location_array, false, *t_speed_name, *t_speed); + /* UNCHECKED */ MCArrayStoreValue(*t_location_array, false, MCNAME("speed"), *t_speed); } if (p_reading.course >= 0.0f) { MCAutoNumberRef t_course; - MCNewAutoNameRef t_course_name; /* UNCHECKED */ MCNumberCreateWithReal(p_reading.course, &t_course); - /* UNCHECKED */ MCNameCreateWithCString("course", &t_course_name); - /* UNCHECKED */ MCArrayStoreValue(*t_location_array, false, *t_course_name, *t_course); + /* UNCHECKED */ MCArrayStoreValue(*t_location_array, false, MCNAME("course"), *t_course); } MCAutoNumberRef t_timestamp; - MCNewAutoNameRef t_timestamp_name; /* UNCHECKED */ MCNumberCreateWithReal(p_reading.timestamp, &t_timestamp); - /* UNCHECKED */ MCNameCreateWithCString("timestamp", &t_timestamp_name); - /* UNCHECKED */ MCArrayStoreValue(*t_location_array, false, *t_timestamp_name, *t_timestamp); + /* UNCHECKED */ MCArrayStoreValue(*t_location_array, false, MCNAME("timestamp"), *t_timestamp); MCAutoNumberRef t_horizontal_accuracy; - MCNewAutoNameRef t_horizontal_accuracy_name; /* UNCHECKED */ MCNumberCreateWithReal(p_reading.horizontal_accuracy, &t_horizontal_accuracy); - /* UNCHECKED */ MCNameCreateWithCString("horizontal accuracy", &t_horizontal_accuracy_name); - /* UNCHECKED */ MCArrayStoreValue(*t_location_array, false, *t_horizontal_accuracy_name, *t_horizontal_accuracy); + /* UNCHECKED */ MCArrayStoreValue(*t_location_array, false, MCNAME("horizontal accuracy"), *t_horizontal_accuracy); MCAutoNumberRef t_vertical_accuracy; - MCNewAutoNameRef t_vertical_accuracy_name; /* UNCHECKED */ MCNumberCreateWithReal(p_reading.vertical_accuracy, &t_vertical_accuracy); - /* UNCHECKED */ MCNameCreateWithCString("vertical accuracy", &t_vertical_accuracy_name); - /* UNCHECKED */ MCArrayStoreValue(*t_location_array, false, *t_vertical_accuracy_name, *t_vertical_accuracy); + /* UNCHECKED */ MCArrayStoreValue(*t_location_array, false, MCNAME("vertical accuracy"), *t_vertical_accuracy); r_detailed_location = t_location_array.Take(); @@ -279,52 +263,36 @@ void MCSensorGetDetailedHeadingOfDevice(MCExecContext& ctxt, MCArrayRef &r_detai /* UNCHECKED */ MCArrayCreateMutable(&t_heading_array); MCAutoNumberRef t_heading; - MCNewAutoNameRef t_heading_name; /* UNCHECKED */ MCNumberCreateWithReal(t_reading.heading, &t_heading); - /* UNCHECKED */ MCNameCreateWithCString("heading", &t_heading_name); - /* UNCHECKED */ MCArrayStoreValue(*t_heading_array, false, *t_heading_name, *t_heading); + /* UNCHECKED */ MCArrayStoreValue(*t_heading_array, false, MCNAME("heading"), *t_heading); MCAutoNumberRef t_magnetic_heading; - MCNewAutoNameRef t_magnetic_heading_name; /* UNCHECKED */ MCNumberCreateWithReal(t_reading.magnetic_heading, &t_magnetic_heading); - /* UNCHECKED */ MCNameCreateWithCString("magnetic heading", &t_magnetic_heading_name); - /* UNCHECKED */ MCArrayStoreValue(*t_heading_array, false, *t_magnetic_heading_name, *t_magnetic_heading); + /* UNCHECKED */ MCArrayStoreValue(*t_heading_array, false, MCNAME("magnetic heading"), *t_magnetic_heading); MCAutoNumberRef t_true_heading; - MCNewAutoNameRef t_true_heading_name; /* UNCHECKED */ MCNumberCreateWithReal(t_reading.true_heading, &t_true_heading); - /* UNCHECKED */ MCNameCreateWithCString("true heading", &t_true_heading_name); - /* UNCHECKED */ MCArrayStoreValue(*t_heading_array, false, *t_true_heading_name, *t_true_heading); + /* UNCHECKED */ MCArrayStoreValue(*t_heading_array, false, MCNAME("true heading"), *t_true_heading); MCAutoNumberRef t_x; - MCNewAutoNameRef t_x_name; /* UNCHECKED */ MCNumberCreateWithReal(t_reading.x, &t_x); - /* UNCHECKED */ MCNameCreateWithCString("x", &t_x_name); - /* UNCHECKED */ MCArrayStoreValue(*t_heading_array, false, *t_x_name, *t_x); + /* UNCHECKED */ MCArrayStoreValue(*t_heading_array, false, MCNAME("x"), *t_x); MCAutoNumberRef t_y; - MCNewAutoNameRef t_y_name; /* UNCHECKED */ MCNumberCreateWithReal(t_reading.y, &t_y); - /* UNCHECKED */ MCNameCreateWithCString("y", &t_y_name); - /* UNCHECKED */ MCArrayStoreValue(*t_heading_array, false, *t_y_name, *t_y); + /* UNCHECKED */ MCArrayStoreValue(*t_heading_array, false, MCNAME("y"), *t_y); MCAutoNumberRef t_z; - MCNewAutoNameRef t_z_name; /* UNCHECKED */ MCNumberCreateWithReal(t_reading.z, &t_z); - /* UNCHECKED */ MCNameCreateWithCString("z", &t_z_name); - /* UNCHECKED */ MCArrayStoreValue(*t_heading_array, false, *t_z_name, *t_z); + /* UNCHECKED */ MCArrayStoreValue(*t_heading_array, false, MCNAME("z"), *t_z); MCAutoNumberRef t_timestamp; - MCNewAutoNameRef t_timestamp_name; /* UNCHECKED */ MCNumberCreateWithReal(t_reading.timestamp, &t_timestamp); - /* UNCHECKED */ MCNameCreateWithCString("timestamp", &t_timestamp_name); - /* UNCHECKED */ MCArrayStoreValue(*t_heading_array, false, *t_timestamp_name, *t_timestamp); + /* UNCHECKED */ MCArrayStoreValue(*t_heading_array, false, MCNAME("timestamp"), *t_timestamp); MCAutoNumberRef t_accuracy; - MCNewAutoNameRef t_accuracy_name; /* UNCHECKED */ MCNumberCreateWithReal(t_reading.accuracy, &t_accuracy); - /* UNCHECKED */ MCNameCreateWithCString("accuracy", &t_accuracy_name); - /* UNCHECKED */ MCArrayStoreValue(*t_heading_array, false, *t_accuracy_name, *t_accuracy); + /* UNCHECKED */ MCArrayStoreValue(*t_heading_array, false, MCNAME("accuracy"), *t_accuracy); r_detailed_heading = MCValueRetain(*t_heading_array); } @@ -349,28 +317,20 @@ void MCSensorGetDetailedAccelerationOfDevice(MCExecContext& ctxt, MCArrayRef &r_ /* UNCHECKED */ MCArrayCreateMutable(&t_acceleration_array); MCAutoNumberRef t_x; - MCNewAutoNameRef t_x_name; /* UNCHECKED */ MCNumberCreateWithReal(t_reading.x, &t_x); - /* UNCHECKED */ MCNameCreateWithCString("x", &t_x_name); - /* UNCHECKED */ MCArrayStoreValue(*t_acceleration_array, false, *t_x_name, *t_x); + /* UNCHECKED */ MCArrayStoreValue(*t_acceleration_array, false, MCNAME("x"), *t_x); MCAutoNumberRef t_y; - MCNewAutoNameRef t_y_name; /* UNCHECKED */ MCNumberCreateWithReal(t_reading.y, &t_y); - /* UNCHECKED */ MCNameCreateWithCString("y", &t_y_name); - /* UNCHECKED */ MCArrayStoreValue(*t_acceleration_array, false, *t_y_name, *t_y); + /* UNCHECKED */ MCArrayStoreValue(*t_acceleration_array, false, MCNAME("y"), *t_y); MCAutoNumberRef t_z; - MCNewAutoNameRef t_z_name; /* UNCHECKED */ MCNumberCreateWithReal(t_reading.z, &t_z); - /* UNCHECKED */ MCNameCreateWithCString("z", &t_z_name); - /* UNCHECKED */ MCArrayStoreValue(*t_acceleration_array, false, *t_z_name, *t_z); + /* UNCHECKED */ MCArrayStoreValue(*t_acceleration_array, false, MCNAME("z"), *t_z); MCAutoNumberRef t_timestamp; - MCNewAutoNameRef t_timestamp_name; /* UNCHECKED */ MCNumberCreateWithReal(t_reading.timestamp, &t_timestamp); - /* UNCHECKED */ MCNameCreateWithCString("timestamp", &t_timestamp_name); - /* UNCHECKED */ MCArrayStoreValue(*t_acceleration_array, false, *t_timestamp_name, *t_timestamp); + /* UNCHECKED */ MCArrayStoreValue(*t_acceleration_array, false, MCNAME("timestamp"), *t_timestamp); r_detailed_acceleration = MCValueRetain(*t_acceleration_array); } @@ -395,28 +355,20 @@ void MCSensorGetDetailedRotationRateOfDevice(MCExecContext& ctxt, MCArrayRef &r_ /* UNCHECKED */ MCArrayCreateMutable(&t_rotation_array); MCAutoNumberRef t_x; - MCNewAutoNameRef t_x_name; /* UNCHECKED */ MCNumberCreateWithReal(t_reading.x, &t_x); - /* UNCHECKED */ MCNameCreateWithCString("x", &t_x_name); - /* UNCHECKED */ MCArrayStoreValue(*t_rotation_array, false, *t_x_name, *t_x); + /* UNCHECKED */ MCArrayStoreValue(*t_rotation_array, false, MCNAME("x"), *t_x); MCAutoNumberRef t_y; - MCNewAutoNameRef t_y_name; /* UNCHECKED */ MCNumberCreateWithReal(t_reading.y, &t_y); - /* UNCHECKED */ MCNameCreateWithCString("y", &t_y_name); - /* UNCHECKED */ MCArrayStoreValue(*t_rotation_array, false, *t_y_name, *t_y); + /* UNCHECKED */ MCArrayStoreValue(*t_rotation_array, false, MCNAME("y"), *t_y); MCAutoNumberRef t_z; - MCNewAutoNameRef t_z_name; /* UNCHECKED */ MCNumberCreateWithReal(t_reading.z, &t_z); - /* UNCHECKED */ MCNameCreateWithCString("z", &t_z_name); - /* UNCHECKED */ MCArrayStoreValue(*t_rotation_array, false, *t_z_name, *t_z); + /* UNCHECKED */ MCArrayStoreValue(*t_rotation_array, false, MCNAME("z"), *t_z); MCAutoNumberRef t_timestamp; - MCNewAutoNameRef t_timestamp_name; /* UNCHECKED */ MCNumberCreateWithReal(t_reading.timestamp, &t_timestamp); - /* UNCHECKED */ MCNameCreateWithCString("timestamp", &t_timestamp_name); - /* UNCHECKED */ MCArrayStoreValue(*t_rotation_array, false, *t_timestamp_name, *t_timestamp); + /* UNCHECKED */ MCArrayStoreValue(*t_rotation_array, false, MCNAME("timestamp"), *t_timestamp); r_detailed_rotation_rate = MCValueRetain(*t_rotation_array); } diff --git a/engine/src/exec.h b/engine/src/exec.h index a5352f5f1ab..d7854d1de58 100644 --- a/engine/src/exec.h +++ b/engine/src/exec.h @@ -5676,7 +5676,7 @@ template<> struct MCExecValueTraits self . nameref_value = p_value; } - inline static void release(MCNameRef& self) { MCNameDelete(self); } + inline static void release(MCNameRef& self) { MCValueRelease(self); } inline static MCNameRef retain(MCNameRef& self) { return MCValueRetain(self); } inline static bool eval(MCExecContext &ctxt, MCExpression* p_expr, Exec_errors p_error, MCNameRef& r_value) diff --git a/engine/src/external.cpp b/engine/src/external.cpp index 236cc38f19f..5e83395b65a 100644 --- a/engine/src/external.cpp +++ b/engine/src/external.cpp @@ -44,7 +44,7 @@ MCExternalHandlerList::~MCExternalHandlerList(void) MCExternal::Unload(m_externals[i]); for(uint32_t i = 0; i < m_handlers . Count(); i++) - MCNameDelete(m_handlers[i] . name); + MCValueRelease(m_handlers[i] . name); } bool MCExternalHandlerList::IsEmpty(void) @@ -173,19 +173,21 @@ bool MCExternalHandlerList::AddHandler(void *state, Handler_type type, const cha self = (MCExternalHandlerList *)state; // Inter the name of the handler. - MCAutoNameRef t_name; - if (!t_name . CreateWithCString(p_name_cstring)) - return false; - + MCNewAutoNameRef t_name; + if (!MCNameCreateWithNativeChars((const char_t*)p_name_cstring, strlen(p_name_cstring), &t_name)) + { + return false; + } + // If the handler is already in the table, then do nothing. Note that // 't_index' will always be set to the index the handler would be at. uindex_t t_index; - if (self -> Lookup(t_name, t_index)) + if (self -> Lookup(*t_name, t_index)) return true; // Make the entry. MCExternalHandlerListEntry t_entry; - t_entry . name = t_name; + t_entry . name = *t_name; t_entry . external = self -> m_externals . Count(); t_entry . handler = p_index; if (!self -> m_handlers . Insert(t_index, t_entry)) diff --git a/engine/src/externalv0.cpp b/engine/src/externalv0.cpp index b451dc58df4..bc61fd05115 100644 --- a/engine/src/externalv0.cpp +++ b/engine/src/externalv0.cpp @@ -434,11 +434,14 @@ static int trans_stat(Exec_stat stat) static Exec_stat getvarptr(MCExecContext& ctxt, const MCString &vname, MCContainer& r_container) { - MCAutoNameRef t_name; - /* UNCHECKED */ t_name . CreateWithOldString(vname); - + MCNewAutoNameRef t_name; + if (!MCNameCreateWithNativeChars((const char_t *)vname.getstring(), vname.getlength(), &t_name)) + { + return ES_ERROR; + } + MCAutoPointer newvar; - if (MCECptr -> FindVar(t_name, &(&newvar)) != PS_NORMAL) + if (MCECptr -> FindVar(*t_name, &(&newvar)) != PS_NORMAL) { return ES_ERROR; } @@ -626,7 +629,7 @@ static char *set_global(const char *arg1, const char *arg2, const char *arg3, int *retval) { MCNewAutoNameRef t_arg1; - /* UNCHECKED */ MCNameCreateWithCString(arg1, &t_arg1); + /* UNCHECKED */ MCNameCreateWithNativeChars((const char_t*)arg1, strlen(arg1), &t_arg1); MCVariable *tmp; if (!MCVariable::ensureglobal(*t_arg1, tmp)) { @@ -847,7 +850,7 @@ static char *get_variable_ex(const char *arg1, const char *arg2, if (arg2 != NULL && strlen(arg2) != 0) { MCNameRef t_key; - /* UNCHECKED */ MCNameCreateWithCString(arg2, t_key); + /* UNCHECKED */ MCNameCreateWithNativeChars((const char_t*)arg2, strlen(arg2), t_key); var.eval_on_path(*MCECptr, {&t_key, 1}, &t_value); MCValueRelease(t_key); } @@ -886,7 +889,7 @@ static char *set_variable_ex(const char *arg1, const char *arg2, if (arg2 != NULL && strlen(arg2) > 0) { MCNameRef t_key; - /* UNCHECKED */ MCNameCreateWithCString(arg2, t_key); + /* UNCHECKED */ MCNameCreateWithNativeChars((const char_t*)arg2, strlen(arg2), t_key); var.set_on_path(*MCECptr, {&t_key, 1}, *t_string); MCValueRelease(t_key); } @@ -1015,10 +1018,10 @@ static char *set_array(const char *arg1, const char *arg2, if (value->keys == NULL || value->keys[i] == NULL) { sprintf(tbuf,"%d",i+1); - /* UNCHECKED */ MCNameCreateWithCString(tbuf, t_key); + /* UNCHECKED */ MCNameCreateWithNativeChars((const char_t*)tbuf, strlen(tbuf), t_key); } else - /* UNCHECKED */ MCNameCreateWithCString(value -> keys[i], t_key); + /* UNCHECKED */ MCNameCreateWithNativeChars((const char_t*)value -> keys[i], strlen(value -> keys[i]), t_key); var.set_on_path(*MCECptr, {&t_key, 1}, *t_string); } return NULL; @@ -1582,7 +1585,7 @@ static char *set_array_utf8(const char *arg1, const char *arg2, if (value->keys == NULL || value->keys[i] == NULL) { sprintf(tbuf,"%d",i+1); - /* UNCHECKED */ MCNameCreateWithCString(tbuf, t_key); + /* UNCHECKED */ MCNameCreateWithNativeChars((const char_t*)tbuf, strlen(tbuf), t_key); } else { @@ -1592,7 +1595,7 @@ static char *set_array_utf8(const char *arg1, const char *arg2, } var.set_on_path(*MCECptr, {&t_key, 1}, *t_string); - MCNameDelete(t_key); + MCValueRelease(t_key); } return NULL; } diff --git a/engine/src/externalv1.cpp b/engine/src/externalv1.cpp index e76cf80c5c0..87c8d725ddc 100755 --- a/engine/src/externalv1.cpp +++ b/engine/src/externalv1.cpp @@ -2471,7 +2471,7 @@ static MCExternalError MCExternalObjectDispatch(MCExternalObjectRef p_object, MC } } - MCNameDelete(t_message_as_name); + MCValueRelease(t_message_as_name); while(t_params != nil) { diff --git a/engine/src/field.cpp b/engine/src/field.cpp index 81d3f3d7dfe..57f3cd82d9c 100644 --- a/engine/src/field.cpp +++ b/engine/src/field.cpp @@ -1353,7 +1353,7 @@ Boolean MCField::doubleup(uint2 which) void MCField::timer(MCNameRef mptr, MCParameter *params) { - if (MCNameIsEqualTo(mptr, MCM_internal, kMCCompareCaseless)) + if (MCNameIsEqualToCaseless(mptr, MCM_internal)) { if (opened && (state & CS_KFOCUSED) && !(state & CS_DRAG_TEXT)) @@ -1365,7 +1365,7 @@ void MCField::timer(MCNameRef mptr, MCParameter *params) MCscreen->addtimer(this, MCM_internal, MCblinkrate); } } - else if (MCNameIsEqualTo(mptr, MCM_internal2, kMCCompareCaseless)) + else if (MCNameIsEqualToCaseless(mptr, MCM_internal2)) { if (opened) { diff --git a/engine/src/fieldhtml.cpp b/engine/src/fieldhtml.cpp index 3949a2eaee7..c6271e22cdd 100644 --- a/engine/src/fieldhtml.cpp +++ b/engine/src/fieldhtml.cpp @@ -1036,7 +1036,7 @@ static void import_html_copy_style(const MCFieldCharacterStyle& p_src, MCFieldCh if (p_src . has_metadata) r_dst . metadata = MCValueRetain(p_src . metadata); if (p_src . has_text_font) - MCNameClone(p_src . text_font, r_dst . text_font); + r_dst.text_font = MCValueRetain(p_src.text_font); } static void import_html_free_style(MCFieldCharacterStyle& p_style) @@ -1044,7 +1044,7 @@ static void import_html_free_style(MCFieldCharacterStyle& p_style) MCValueRelease(p_style . link_text); MCValueRelease(p_style . image_source); MCValueRelease(p_style . metadata); - MCNameDelete(p_style . text_font); + MCValueRelease(p_style . text_font); } static bool import_html_equal_style(const MCFieldCharacterStyle& left, const MCFieldCharacterStyle& right) @@ -1733,7 +1733,7 @@ static void import_html_change_style(import_html_t& ctxt, const import_html_tag_ { t_style . has_text_font = true; if (t_style . text_font != nil) - MCNameDelete(t_style . text_font); + MCValueRelease(t_style . text_font); MCNameCreate(p_tag . attrs[i] . value, t_style . text_font); } break; diff --git a/engine/src/font.cpp b/engine/src/font.cpp index 345e870ebf4..f6bd1c9b141 100644 --- a/engine/src/font.cpp +++ b/engine/src/font.cpp @@ -124,7 +124,7 @@ bool MCFontCreateWithFontStruct(MCNameRef p_name, MCFontStyle p_style, int32_t p return false; self -> references = 1; - /* UNCHECKED */ MCNameClone(p_name, self -> name); + self->name = MCValueRetain(p_name); self -> style = p_style; self -> size = p_size; @@ -217,7 +217,7 @@ void MCFontRelease(MCFontRef self) else s_fonts = self -> next; - MCNameDelete(self -> name); + MCValueRelease(self -> name); MCMemoryDelete(self); } diff --git a/engine/src/fonttable.cpp b/engine/src/fonttable.cpp index b9bf3e20364..dbec47d8b37 100644 --- a/engine/src/fonttable.cpp +++ b/engine/src/fonttable.cpp @@ -92,7 +92,7 @@ static uint32_t MCLogicalFontTableLookupEntry(MCNameRef p_textfont, uint2 p_text /* UNCHECKED */ MCMemoryResizeArray(s_logical_font_table_capacity > 0 ? s_logical_font_table_capacity * 2 : 32, s_logical_font_table, s_logical_font_table_capacity); s_logical_font_table[s_logical_font_table_size++] = t_entry; - MCNameClone(t_entry . textfont, t_entry . textfont); + MCValueRetain(t_entry.textfont); } return s_logical_font_table_size - 1; @@ -210,7 +210,7 @@ void MCLogicalFontTableFinish(void) uint2 t_textsize; bool t_unicode; MCLogicalFontTableGetEntry(i, t_textfont, t_textstyle, t_textsize, t_unicode); - MCNameDelete(t_textfont); + MCValueRelease(t_textfont); } MCMemoryDeleteArray(s_logical_font_table); diff --git a/engine/src/foundation-legacy.cpp b/engine/src/foundation-legacy.cpp index ecb412e0b0b..b7ac69fe5ec 100644 --- a/engine/src/foundation-legacy.cpp +++ b/engine/src/foundation-legacy.cpp @@ -1057,29 +1057,13 @@ bool MCCStringIsInteger(const char *p_string) //////////////////////////////////////////////////////////////////////////////// -bool MCNameCreateWithCString(const char *p_cstring, MCNameRef& r_name) -{ - return MCNameCreateWithNativeChars((const char_t *)p_cstring, strlen(p_cstring), r_name); -} - -bool MCNameCreateWithOldString(const MCString& p_old_string, MCNameRef& r_name) -{ - return MCNameCreateWithNativeChars((const char_t *)p_old_string . getstring(), p_old_string . getlength(), r_name); -} - -void MCNameDelete(MCNameRef p_name) -{ - MCValueRelease(p_name); -} - -bool MCNameClone(MCNameRef p_name, MCNameRef& r_new_name) +struct get_array_extent_context_t { - r_new_name = p_name; - MCValueRetain(p_name); - return true; -} + index_t minimum; + index_t maximum; +}; -bool MCNameGetAsIndex(MCNameRef p_name, index_t& r_index) +static bool get_name_as_index(MCNameRef p_name, index_t& r_index) { MCStringRef t_key; t_key = MCNameGetString(p_name); @@ -1117,73 +1101,13 @@ bool MCNameGetAsIndex(MCNameRef p_name, index_t& r_index) return false; } -char MCNameGetCharAtIndex(MCNameRef p_name, uindex_t p_at) -{ - return MCStringGetNativeCharAtIndex(MCNameGetString(p_name), p_at); -} - -bool MCNameIsEqualTo(MCNameRef p_left, MCNameRef p_right, MCCompareOptions p_options) -{ - if (p_left == p_right) - return true; - - if (p_options == kMCCompareCaseless) - return MCNameIsEqualTo(p_left, p_right); - - return false; -} - -bool MCNameIsEqualToCString(MCNameRef p_left, const char *p_cstring, MCCompareOptions p_options) -{ - return MCStringIsEqualToCString(MCNameGetString(p_left), p_cstring, p_options); -} - -bool MCNameIsEqualToOldString(MCNameRef p_left, const MCString& p_oldstring, MCCompareOptions p_options) -{ - return MCStringIsEqualToOldString(MCNameGetString(p_left), p_oldstring, p_options); -} - -MCNameRef MCNameLookupWithCString(const char *cstring, MCCompareOptions options) -{ - MCStringRef t_string; - if (!MCStringCreateWithNativeChars((const char_t *)cstring, strlen(cstring), t_string)) - return nil; - - MCNameRef t_name; - t_name = MCNameLookup(t_string); - MCValueRelease(t_string); - - return t_name; -} - -MCNameRef MCNameLookupWithOldString(const MCString& string, MCCompareOptions options) -{ - MCStringRef t_string; - if (!MCStringCreateWithNativeChars((const char_t *)string . getstring(), string . getlength(), t_string)) - return nil; - - MCNameRef t_name; - t_name = MCNameLookup(t_string); - MCValueRelease(t_string); - - return t_name; -} - -//////////////////////////////////////////////////////////////////////////////// - -struct get_array_extent_context_t -{ - index_t minimum; - index_t maximum; -}; - static bool get_array_extent(void *context, MCArrayRef p_array, MCNameRef p_key, MCValueRef p_value) { get_array_extent_context_t *ctxt; ctxt = (get_array_extent_context_t *)context; index_t t_index; - if (!MCNameGetAsIndex(p_key, t_index)) + if (!get_name_as_index(p_key, t_index)) return false; ctxt -> minimum = MCMin(ctxt -> minimum, t_index); @@ -1362,7 +1286,7 @@ IO_stat MCArrayLoadFromHandleLegacy(MCArrayRef self, IO_handle p_stream) // so we pass p_translate = true. t_stat = IO_read_string_legacy_full(t_key, t_length, p_stream, 1, true, true); if (t_stat == IO_NORMAL) - if (!MCNameCreateWithOldString(MCString(t_key, t_length), &t_name)) + if (!MCNameCreateWithNativeChars((const char_t*)t_key, t_length, &t_name)) t_stat = IO_ERROR; MCMemoryDeallocate(t_key); diff --git a/engine/src/foundation-legacy.h b/engine/src/foundation-legacy.h index 9b8e1b505aa..f2a318dfee3 100644 --- a/engine/src/foundation-legacy.h +++ b/engine/src/foundation-legacy.h @@ -76,24 +76,6 @@ MCString MCDataGetOldString(MCDataRef data); //////////////////////////////////////////////////////////////////////////////// -bool MCNameCreateWithCString(const char *cstring, MCNameRef& r_name); -bool MCNameCreateWithOldString(const MCString& oldstring, MCNameRef& r_name); -void MCNameDelete(MCNameRef name); -bool MCNameClone(MCNameRef name, MCNameRef& r_new_name); - -bool MCNameGetAsIndex(MCNameRef name, index_t& r_index); - -char MCNameGetCharAtIndex(MCNameRef name, uindex_t at); - -bool MCNameIsEqualTo(MCNameRef left, MCNameRef right, MCCompareOptions options); -bool MCNameIsEqualToCString(MCNameRef left, const char *cstring, MCCompareOptions options); -bool MCNameIsEqualToOldString(MCNameRef left, const MCString& string, MCCompareOptions options); - -MCNameRef MCNameLookupWithCString(const char *cstring, MCCompareOptions options); -MCNameRef MCNameLookupWithOldString(const MCString& string, MCCompareOptions options); - -//////////////////////////////////////////////////////////////////////////////// - enum IO_stat { IO_NORMAL, @@ -271,58 +253,4 @@ template inline void MCListRemove(T*& x_list, T *p_element) //////////////////////////////////////////////////////////////////////////////// -class MCAutoNameRef -{ -public: - MCAutoNameRef(void) - { - m_name = nil; - } - - ~MCAutoNameRef(void) - { - MCValueRelease(m_name); - } - - bool CreateWithCString(const char *p_name) - { - return MCNameCreateWithCString(p_name, m_name); - } - - bool CreateWithOldString(const MCString& p_name) - { - return MCNameCreateWithOldString(p_name, m_name); - } - - bool Clone(MCNameRef p_name) - { - m_name = p_name; - MCValueRetain(m_name); - return true; - } - - MCNameRef Take(void) - { - MCNameRef t_name; - t_name = m_name; - m_name = nil; - return t_name; - } - - operator MCNameRef& (void) - { - return m_name; - } - - operator MCNameRef (void) const - { - return m_name; - } - -private: - MCNameRef m_name; -}; - -//////////////////////////////////////////////////////////////////////////////// - #endif diff --git a/engine/src/gradient.cpp b/engine/src/gradient.cpp index 083a24643c1..0facd1115ae 100644 --- a/engine/src/gradient.cpp +++ b/engine/src/gradient.cpp @@ -63,7 +63,7 @@ static Exec_stat MCGradientFillLookupProperty(MCNameRef p_token, MCGradientFillP uint4 tablesize = ELEMENTS(gradientprops); while (tablesize--) { - if (MCNameIsEqualToCString(p_token, gradientprops[tablesize].token, kMCCompareCaseless)) + if (MCStringIsEqualToCString(MCNameGetString(p_token), gradientprops[tablesize].token, kMCCompareCaseless)) { r_prop = gradientprops[tablesize].value; return ES_NORMAL; @@ -244,22 +244,16 @@ bool MCGradientFillGetProperties(MCExecContext& ctxt, MCGradientFill* p_gradient while (t_success && tablesize--) { MCValueRef t_prop_value; - MCNewAutoNameRef t_key; - - t_success = MCNameCreateWithCString(gradientprops[tablesize].token, &t_key); + MCExecValue t_value; + t_success = MCGradientFillFetchProperty(ctxt, p_gradient, gradientprops[tablesize].value, t_value); if (t_success) { - MCExecValue t_value; - t_success = MCGradientFillFetchProperty(ctxt, p_gradient, gradientprops[tablesize].value, t_value); - if (t_success) - { - MCExecTypeConvertAndReleaseAlways(ctxt, t_value . type, &t_value , kMCExecValueTypeValueRef, &t_prop_value); - t_success = !ctxt . HasError(); - } + MCExecTypeConvertAndReleaseAlways(ctxt, t_value . type, &t_value , kMCExecValueTypeValueRef, &t_prop_value); + t_success = !ctxt . HasError(); } if (t_success) - t_success = MCArrayStoreValue(*v, kMCCompareExact, *t_key, t_prop_value); + t_success = MCArrayStoreValue(*v, false, MCNAME(gradientprops[tablesize].token), t_prop_value); } MCerrorlock--; @@ -529,7 +523,7 @@ bool MCGradientFillSetProperties(MCExecContext& ctxt, MCGradientFill*& x_gradien { MCValueRef t_prop_value; - if (MCArrayFetchValue(*t_array, kMCCompareExact, MCNAME(gradientprops[tablesize].token), t_prop_value)) + if (MCArrayFetchValue(*t_array, false, MCNAME(gradientprops[tablesize].token), t_prop_value)) { MCExecValue t_value; t_value . valueref_value = MCValueRetain(t_prop_value); diff --git a/engine/src/handler.cpp b/engine/src/handler.cpp index a57e63b213c..e7034090ab0 100644 --- a/engine/src/handler.cpp +++ b/engine/src/handler.cpp @@ -87,20 +87,20 @@ MCHandler::~MCHandler() for(uint32_t i = 0; i < nvnames; i++) { - MCNameDelete(vinfo[i] . name); + MCValueRelease(vinfo[i] . name); MCValueRelease(vinfo[i] . init); } delete[] vinfo; /* Allocated with new[] */ for(uint32_t i = 0; i < npnames; i++) - MCNameDelete(pinfo[i] . name); + MCValueRelease(pinfo[i] . name); delete[] pinfo; /* Allocated with new[] */ delete[] globals; /* Allocated with new[] */ for(uint32_t i = 0; i < nconstants; i++) { - MCNameDelete(cinfo[i] . name); + MCValueRelease(cinfo[i] . name); MCValueRelease(cinfo[i] . value); } delete[] cinfo; /* Allocated with new[] */ @@ -108,7 +108,7 @@ MCHandler::~MCHandler() // MW-2013-11-08: [[ RefactorIt ]] Delete the it varref. delete m_it; - MCNameDelete(name); + MCValueRelease(name); } Parse_stat MCHandler::newparam(MCScriptPoint& sp) @@ -135,9 +135,9 @@ Parse_stat MCHandler::newparam(MCScriptPoint& sp) // OK-2010-01-11: [[Bug 7744]] - Check existing parsed parameters for duplicates. for (uint2 i = 0; i < npnames; i++) { - if (MCNameIsEqualTo(pinfo[i] . name, t_name, kMCCompareCaseless)) + if (MCNameIsEqualToCaseless(pinfo[i] . name, t_name)) { - MCNameDelete(t_name); + MCValueRelease(t_name); MCperror -> add(PE_HANDLER_DUPPARAM, sp); return PS_ERROR; } @@ -166,7 +166,7 @@ Parse_stat MCHandler::parse(MCScriptPoint &sp, Boolean isprop) return PS_ERROR; } - /* UNCHECKED */ MCNameClone(sp . gettoken_nameref(), name); + name = MCValueRetain(sp . gettoken_nameref()); const LT *te; // MW-2010-01-08: [[Bug 7792]] Check whether the handler name is a reserved function identifier @@ -228,7 +228,7 @@ Parse_stat MCHandler::parse(MCScriptPoint &sp, Boolean isprop) return PS_ERROR; // AL-2014-11-04: [[ Bug 13902 ]] Check if the param we just created was called 'it'. - if (MCNameIsEqualTo(pinfo[npnames - 1] . name, MCN_it)) + if (MCNameIsEqualToCaseless(pinfo[npnames - 1] . name, MCN_it)) t_needs_it = false; } @@ -288,7 +288,7 @@ Parse_stat MCHandler::parse(MCScriptPoint &sp, Boolean isprop) MCperror->add(PE_HANDLER_NOEND, sp); return PS_ERROR; } - if (!MCNameIsEqualTo(name, sp.gettoken_nameref(), kMCCompareCaseless)) + if (!MCNameIsEqualToCaseless(name, sp.gettoken_nameref())) { MCperror->add(PE_HANDLER_BADEND, sp); return PS_ERROR; @@ -367,7 +367,7 @@ Exec_stat MCHandler::exec(MCExecContext& ctxt, MCParameter *plist) // AL-2014-11-04: [[ Bug 13902 ]] If 'it' was this parameter's name then create the MCVarref as a // param type, with this handler and param index, so that use of the get command syncs up correctly. - if (i < npnames && MCNameIsEqualTo(pinfo[i] . name, MCN_it)) + if (i < npnames && MCNameIsEqualToCaseless(pinfo[i] . name, MCN_it)) m_it = new (nothrow) MCVarref(this, i, True); plist = plist->getnext(); @@ -538,7 +538,7 @@ Exec_stat MCHandler::exec(MCExecContext& ctxt, MCParameter *plist) { if (nvnames >= oldnvnames) { - MCNameDelete(vinfo[nvnames] . name); + MCValueRelease(vinfo[nvnames] . name); MCValueRelease(vinfo[nvnames] . init); } delete vars[nvnames]; @@ -593,14 +593,14 @@ Parse_stat MCHandler::findvar(MCNameRef p_name, MCVarref **dptr) { uint2 i; for (i = 0 ; i < nvnames ; i++) - if (MCNameIsEqualTo(p_name, vinfo[i] . name, kMCCompareCaseless)) + if (MCNameIsEqualToCaseless(p_name, vinfo[i] . name)) { *dptr = new (nothrow) MCVarref(this, i, False); return PS_NORMAL; } for (i = 0 ; i < npnames ; i++) - if (MCNameIsEqualTo(p_name, pinfo[i] . name, kMCCompareCaseless)) + if (MCNameIsEqualToCaseless(p_name, pinfo[i] . name)) { *dptr = new (nothrow) MCVarref(this, i, True); return PS_NORMAL; @@ -615,7 +615,7 @@ Parse_stat MCHandler::findvar(MCNameRef p_name, MCVarref **dptr) } } - if (MCNameGetCharAtIndex(p_name, 0) == '$') + if (MCStringGetNativeCharAtIndex(MCNameGetString(p_name), 0) == '$') { MCVariable *t_global; /* UNCHECKED */ MCVariable::ensureglobal(p_name, t_global); @@ -631,7 +631,7 @@ Parse_stat MCHandler::findvar(MCNameRef p_name, MCVarref **dptr) Parse_stat MCHandler::newvar(MCNameRef p_name, MCValueRef p_init, MCVarref **r_ref) { MCU_realloc((char **)&vinfo, nvnames, nvnames + 1, sizeof(MCHandlerVarInfo)); - /* UNCHECKED */ MCNameClone(p_name, vinfo[nvnames] . name); + vinfo[nvnames] . name = MCValueRetain(p_name); if (p_init != nil) /* UNCHECKED */ vinfo[nvnames] . init = MCValueRetain(p_init); else @@ -660,7 +660,7 @@ Parse_stat MCHandler::findconstant(MCNameRef p_name, MCExpression **dptr) { uint2 i; for (i = 0 ; i < nconstants ; i++) - if (MCNameIsEqualTo(p_name, cinfo[i].name, kMCCompareCaseless)) + if (MCNameIsEqualToCaseless(p_name, cinfo[i].name)) { *dptr = new (nothrow) MCLiteral(cinfo[i].value); return PS_NORMAL; @@ -671,8 +671,8 @@ Parse_stat MCHandler::findconstant(MCNameRef p_name, MCExpression **dptr) Parse_stat MCHandler::newconstant(MCNameRef p_name, MCValueRef p_value) { MCU_realloc((char **)&cinfo, nconstants, nconstants + 1, sizeof(MCHandlerConstantInfo)); - /* UNCHECKED */ MCNameClone(p_name, cinfo[nconstants].name); - /* UNCHECKED */ cinfo[nconstants++].value = MCValueRetain(p_value); + cinfo[nconstants].name = MCValueRetain(p_name); + cinfo[nconstants++].value = MCValueRetain(p_value); return PS_NORMAL; } diff --git a/engine/src/handler.h b/engine/src/handler.h index 0b7c1dfb813..c238105f224 100644 --- a/engine/src/handler.h +++ b/engine/src/handler.h @@ -83,7 +83,7 @@ class MCHandler bool hasname(MCNameRef other_name) { - return MCNameIsEqualTo(name, other_name, kMCCompareCaseless); + return MCNameIsEqualToCaseless(name, other_name); } Parse_stat parse(MCScriptPoint &sp, Boolean isprop); diff --git a/engine/src/hndlrlst.cpp b/engine/src/hndlrlst.cpp index 18883f43e4d..ed378276bfe 100644 --- a/engine/src/hndlrlst.cpp +++ b/engine/src/hndlrlst.cpp @@ -172,7 +172,7 @@ void MCHandlerlist::reset(void) for(uint32_t i = 0; i < nconstants; i++) { - MCNameDelete(cinfo[i] . name); + MCValueRelease(cinfo[i] . name); MCValueRelease(cinfo[i] . value); } delete[] cinfo; /* Allocated with new[] */ @@ -209,13 +209,13 @@ Parse_stat MCHandlerlist::findvar(MCNameRef p_name, bool p_ignore_uql, MCVarref } } - if (MCNameIsEqualTo(p_name, MCN_msg, kMCCompareCaseless)) + if (MCNameIsEqualToCaseless(p_name, MCN_msg)) { *dptr = new (nothrow) MCVarref(MCmb); return PS_NORMAL; } - if (MCNameIsEqualTo(p_name, MCN_each, kMCCompareCaseless)) + if (MCNameIsEqualToCaseless(p_name, MCN_each)) { *dptr = new (nothrow) MCVarref(MCeach); return PS_NORMAL; @@ -224,7 +224,7 @@ Parse_stat MCHandlerlist::findvar(MCNameRef p_name, bool p_ignore_uql, MCVarref // In server mode, we need to resolve $ vars in the context of the global // scope. (This doesn't happen in non-server mode as there is never any // 'code' in 'global' scope). - if (MCNameGetCharAtIndex(p_name, 0) == '$') + if (MCStringGetNativeCharAtIndex(MCNameGetString(p_name), 0) == '$') { for (tmp = MCglobals ; tmp != NULL ; tmp = tmp->getnext()) if (tmp->hasname(p_name)) @@ -329,7 +329,7 @@ Parse_stat MCHandlerlist::findconstant(MCNameRef p_name, MCExpression **dptr) { uint2 i; for (i = 0 ; i < nconstants ; i++) - if (MCNameIsEqualTo(p_name, cinfo[i].name, kMCCompareCaseless)) + if (MCNameIsEqualToCaseless(p_name, cinfo[i].name)) { *dptr = new (nothrow) MCLiteral(cinfo[i].value); return PS_NORMAL; @@ -340,8 +340,8 @@ Parse_stat MCHandlerlist::findconstant(MCNameRef p_name, MCExpression **dptr) Parse_stat MCHandlerlist::newconstant(MCNameRef p_name, MCValueRef p_value) { MCU_realloc((char **)&cinfo, nconstants, nconstants + 1, sizeof(MCHandlerConstantInfo)); - /* UNCHECKED */ MCNameClone(p_name, cinfo[nconstants].name); - /* UNCHECKED */ cinfo[nconstants++].value = MCValueRetain(p_value); + cinfo[nconstants].name = MCValueRetain(p_name); + cinfo[nconstants++].value = MCValueRetain(p_value); return PS_NORMAL; } diff --git a/engine/src/ide.cpp b/engine/src/ide.cpp index abf5dc5599d..88226279724 100644 --- a/engine/src/ide.cpp +++ b/engine/src/ide.cpp @@ -2473,7 +2473,7 @@ struct MCIdeFilterControlsVisitor: public MCObjectVisitor break; case kMCIdeFilterPropertyName: if (p_object -> getname() != nil) - MCNameClone(p_object -> getname(), (MCNameRef&)&t_left_value); + t_left_value = p_object->getname(); else t_left_value = kMCEmptyString; break; diff --git a/engine/src/image.cpp b/engine/src/image.cpp index 5ff78e6b4f8..4af67001429 100644 --- a/engine/src/image.cpp +++ b/engine/src/image.cpp @@ -526,7 +526,7 @@ Boolean MCImage::doubleup(uint2 which) void MCImage::timer(MCNameRef mptr, MCParameter *params) { - if (MCNameIsEqualTo(mptr, MCM_internal, kMCCompareCaseless)) + if (MCNameIsEqualToCaseless(mptr, MCM_internal)) { if (state & CS_OWN_SELECTION) { @@ -557,7 +557,7 @@ void MCImage::timer(MCNameRef mptr, MCParameter *params) } } } - else if (MCNameIsEqualTo(mptr, MCM_internal2, kMCCompareCaseless)) + else if (MCNameIsEqualToCaseless(mptr, MCM_internal2)) { if (state & CS_MAGNIFY) { diff --git a/engine/src/keywords.cpp b/engine/src/keywords.cpp index 2545ee9944e..2470f40b9ee 100644 --- a/engine/src/keywords.cpp +++ b/engine/src/keywords.cpp @@ -135,26 +135,25 @@ Parse_stat MCLocaltoken::parse(MCScriptPoint &sp) return PS_ERROR; } - MCAutoNameRef t_token_name; - /* UNCHECKED */ t_token_name . Clone(sp . gettoken_nameref()); + MCNewAutoNameRef t_token_name = sp . gettoken_nameref(); // MW-2013-11-08: [[ RefactorIt ]] The 'it' variable is always present now, // so there's no need to 'local it'. However, scripts do contain this so // don't do a check for an existing var in this case. - if (!MCNameIsEqualTo(t_token_name, MCN_it, kMCCompareCaseless)) + if (!MCNameIsEqualToCaseless(*t_token_name, MCN_it)) { MCExpression *e = NULL; MCVarref *v = NULL; if (sp.gethandler() == NULL) if (constant) - sp.gethlist()->findconstant(t_token_name, &e); + sp.gethlist()->findconstant(*t_token_name, &e); else - sp.gethlist()->findvar(t_token_name, false, &v); + sp.gethlist()->findvar(*t_token_name, false, &v); else if (constant) - sp.gethandler()->findconstant(t_token_name, &e); + sp.gethandler()->findconstant(*t_token_name, &e); else - sp.gethandler()->findvar(t_token_name, &v); + sp.gethandler()->findvar(*t_token_name, &v); if (e != NULL || v != NULL) { MCperror->add(PE_LOCAL_SHADOW, sp); @@ -245,8 +244,8 @@ Parse_stat MCLocaltoken::parse(MCScriptPoint &sp) if (sp.gethandler() == NULL) { if (constant) - sp.gethlist()->newconstant(t_token_name, *t_init_value); - else if (sp.gethlist()->newvar(t_token_name, *t_init_value, &tvar, initialised) != PS_NORMAL) + sp.gethlist()->newconstant(*t_token_name, *t_init_value); + else if (sp.gethlist()->newvar(*t_token_name, *t_init_value, &tvar, initialised) != PS_NORMAL) { MCperror->add(PE_LOCAL_BADNAME, sp); return PS_ERROR; @@ -254,8 +253,8 @@ Parse_stat MCLocaltoken::parse(MCScriptPoint &sp) } else if (constant) - sp.gethandler()->newconstant(t_token_name, *t_init_value); - else if (sp.gethandler()->newvar(t_token_name, *t_init_value, &tvar) != PS_NORMAL) + sp.gethandler()->newconstant(*t_token_name, *t_init_value); + else if (sp.gethandler()->newvar(*t_token_name, *t_init_value, &tvar) != PS_NORMAL) { MCperror->add(PE_LOCAL_BADNAME, sp); return PS_ERROR; diff --git a/engine/src/linux-theme.cpp b/engine/src/linux-theme.cpp index a55b543a959..0e76a6aa6de 100644 --- a/engine/src/linux-theme.cpp +++ b/engine/src/linux-theme.cpp @@ -382,23 +382,25 @@ bool MCPlatformGetControlThemePropFont(MCPlatformControlType p_type, MCPlatformC int t_font_size; // We use 12-point Helvetica on Linux, traditionally + const char *t_font_name_cstr = nullptr; if (p_state & kMCPlatformControlStateCompatibility) { - MCNameCreateWithCString(DEFAULT_TEXT_FONT, t_font_name); + t_font_name_cstr = DEFAULT_TEXT_FONT; t_font_size = 12; } else { - t_found = MCNameCreateWithCString(pango_font_description_get_family(t_pango), t_font_name); + t_font_name_cstr = pango_font_description_get_family(t_pango); t_font_size = pango_font_description_get_size(t_pango)/PANGO_SCALE; /* UNCHECKED */ MCPlatformGetControlThemePropInteger(p_type, p_part, p_state, kMCPlatformThemePropertyTextSize, t_font_size); } + MCNameCreateWithNativeChars((const char_t*)t_font_name_cstr, strlen(t_font_name_cstr), t_font_name); if (t_found) t_found = MCFontCreate(t_font_name, 0, t_font_size, t_font_ref); if (t_found) r_font = t_font_ref; - MCNameDelete(t_font_name); + MCValueRelease(t_font_name); return t_found; } diff --git a/engine/src/lnxflst.cpp b/engine/src/lnxflst.cpp index d07ad3f4931..9a93f41eec3 100644 --- a/engine/src/lnxflst.cpp +++ b/engine/src/lnxflst.cpp @@ -159,7 +159,7 @@ MCFontStruct *MCNewFontlist::getfont(MCNameRef p_family, uint2& p_size, uint2 p_ { MCNewFontStruct *t_font; for(t_font = m_fonts; t_font != nil; t_font = t_font -> next) - if (MCNameIsEqualTo(p_family, t_font -> family) && p_size == t_font -> size && p_style == t_font -> style) + if (MCNameIsEqualToCaseless(p_family, t_font -> family) && p_size == t_font -> size && p_style == t_font -> style) return t_font; t_font = new (nothrow) MCNewFontStruct; @@ -171,17 +171,17 @@ MCFontStruct *MCNewFontlist::getfont(MCNameRef p_family, uint2& p_size, uint2 p_ // If the font name identifies one of the special fonts, resolve it MCAutoStringRef t_family_name; - if (MCNameIsEqualTo(p_family, MCN_font_usertext)) + if (MCNameIsEqualToCaseless(p_family, MCN_font_usertext)) MCPlatformGetControlThemePropString(kMCPlatformControlTypeInputField, kMCPlatformControlPartNone, kMCPlatformControlStateNormal, kMCPlatformThemePropertyTextFont, &t_family_name); - else if (MCNameIsEqualTo(p_family, MCN_font_menutext)) + else if (MCNameIsEqualToCaseless(p_family, MCN_font_menutext)) MCPlatformGetControlThemePropString(kMCPlatformControlTypeMenu, kMCPlatformControlPartNone, kMCPlatformControlStateNormal, kMCPlatformThemePropertyTextFont, &t_family_name); - else if (MCNameIsEqualTo(p_family, MCN_font_content)) + else if (MCNameIsEqualToCaseless(p_family, MCN_font_content)) MCPlatformGetControlThemePropString(kMCPlatformControlTypeInputField, kMCPlatformControlPartNone, kMCPlatformControlStateNormal, kMCPlatformThemePropertyTextFont, &t_family_name); - else if (MCNameIsEqualTo(p_family, MCN_font_message)) + else if (MCNameIsEqualToCaseless(p_family, MCN_font_message)) MCPlatformGetControlThemePropString(kMCPlatformControlTypeButton, kMCPlatformControlPartNone, kMCPlatformControlStateNormal, kMCPlatformThemePropertyTextFont, &t_family_name); - else if (MCNameIsEqualTo(p_family, MCN_font_tooltip)) + else if (MCNameIsEqualToCaseless(p_family, MCN_font_tooltip)) MCPlatformGetControlThemePropString(kMCPlatformControlTypeLabel, kMCPlatformControlPartNone, kMCPlatformControlStateNormal, kMCPlatformThemePropertyTextFont, &t_family_name); - else if (MCNameIsEqualTo(p_family, MCN_font_system)) + else if (MCNameIsEqualToCaseless(p_family, MCN_font_system)) MCPlatformGetControlThemePropString(kMCPlatformControlTypeGeneric, kMCPlatformControlPartNone, kMCPlatformControlStateNormal, kMCPlatformThemePropertyTextFont, &t_family_name); else { diff --git a/engine/src/mblandroidfs.cpp b/engine/src/mblandroidfs.cpp index 3c9bc08b732..57f3ca7e306 100644 --- a/engine/src/mblandroidfs.cpp +++ b/engine/src/mblandroidfs.cpp @@ -419,8 +419,8 @@ Boolean MCAndroidSystem::GetStandardFolder(MCNameRef p_folder, MCStringRef &r_fo { // SN-2015-04-16: [[ Bug 14295 ]] The resources folder on Mobile is the same // as the engine folder. - if (MCNameIsEqualTo(p_folder, MCN_engine, kMCCompareCaseless) - || MCNameIsEqualTo(p_folder, MCN_resources, kMCCompareCaseless)) + if (MCNameIsEqualToCaseless(p_folder, MCN_engine) + || MCNameIsEqualToCaseless(p_folder, MCN_resources)) { MCLog("GetStandardFolder(\"%@\") -> \"%@\"", MCNameGetString(p_folder), MCcmd); return MCStringCopy(MCcmd, r_folder); diff --git a/engine/src/mblandroidmisc.cpp b/engine/src/mblandroidmisc.cpp index 207d5ae6e68..1e8716abbf0 100644 --- a/engine/src/mblandroidmisc.cpp +++ b/engine/src/mblandroidmisc.cpp @@ -106,7 +106,7 @@ class MCMessageEvent : public MCCustomEvent void Destroy(void) { - MCNameDelete(m_message); + MCValueRelease(m_message); delete this; } @@ -116,7 +116,7 @@ class MCMessageEvent : public MCCustomEvent bool setMessage(const char *p_message) { - return MCNameCreateWithCString(p_message, m_message); + return MCNameCreateWithNativeChars((const char_t*)p_message, strlen(p_message), m_message); } bool setObject(MCObjectHandle p_object) diff --git a/engine/src/mblcalendar.cpp b/engine/src/mblcalendar.cpp index f7fd1d1f1cd..a0a41ec9ab4 100644 --- a/engine/src/mblcalendar.cpp +++ b/engine/src/mblcalendar.cpp @@ -48,11 +48,9 @@ bool MCArrayDataToCalendar (MCArrayRef p_array, MCCalendar& r_calendar) if (t_success) { - MCNewAutoNameRef t_key_allday; - MCNameCreateWithCString("allday", &t_key_allday); MCValueRef t_str_allday; - t_success = MCArrayFetchValue(p_array, false, *t_key_allday, t_str_allday); + t_success = MCArrayFetchValue(p_array, false, MCNAME("allday"), t_str_allday); if (t_success) { @@ -65,11 +63,9 @@ bool MCArrayDataToCalendar (MCArrayRef p_array, MCCalendar& r_calendar) if (t_success) { - MCNewAutoNameRef t_key_note; - MCNameCreateWithCString("note", &t_key_note); MCValueRef t_str_note; - t_success = MCArrayFetchValue(p_array, false, *t_key_note, t_str_note); + t_success = MCArrayFetchValue(p_array, false, MCNAME("note"), t_str_note); if (t_success) t_success = MCStringCopy((MCStringRef)t_str_note, r_calendar.mcnote); @@ -77,11 +73,9 @@ bool MCArrayDataToCalendar (MCArrayRef p_array, MCCalendar& r_calendar) if (t_success) { - MCNewAutoNameRef t_key_title; - MCNameCreateWithCString("title", &t_key_title); MCValueRef t_str_title; - t_success = MCArrayFetchValue(p_array, false, *t_key_title, t_str_title); + t_success = MCArrayFetchValue(p_array, false, MCNAME("title"), t_str_title); if (t_success) t_success = MCStringCopy((MCStringRef)t_str_title, r_calendar.mctitle); @@ -89,11 +83,9 @@ bool MCArrayDataToCalendar (MCArrayRef p_array, MCCalendar& r_calendar) if (t_success) { - MCNewAutoNameRef t_key_location; - MCNameCreateWithCString("location", &t_key_location); MCValueRef t_str_location; - t_success = MCArrayFetchValue(p_array, false, *t_key_location, t_str_location); + t_success = MCArrayFetchValue(p_array, false, MCNAME("location"), t_str_location); if (t_success) t_success = MCStringCopy((MCStringRef)t_str_location, r_calendar.mclocation); @@ -101,11 +93,9 @@ bool MCArrayDataToCalendar (MCArrayRef p_array, MCCalendar& r_calendar) if (t_success) { - MCNewAutoNameRef t_key_calendar; - MCNameCreateWithCString("calendar", &t_key_calendar); MCValueRef t_str_calendar; - t_success = MCArrayFetchValue(p_array, false, *t_key_calendar, t_str_calendar); + t_success = MCArrayFetchValue(p_array, false, MCNAME("calendar"), t_str_calendar); if (t_success) t_success = MCStringCopy((MCStringRef)t_str_calendar, r_calendar.mccalendar); @@ -113,29 +103,23 @@ bool MCArrayDataToCalendar (MCArrayRef p_array, MCCalendar& r_calendar) if (t_success) { - MCNewAutoNameRef t_key_frequency; - MCNewAutoNameRef t_key_frequency_count; - MCNewAutoNameRef t_key_frequency_interval; - MCNameCreateWithCString("frequency", &t_key_frequency); - MCNameCreateWithCString("frequencycount", &t_key_frequency_count); - MCNameCreateWithCString("frequencyinterval", &t_key_frequency_interval); MCValueRef t_str_frequency; MCValueRef t_int_frequency_count; MCValueRef t_int_frequency_interval; - t_success = MCArrayFetchValue(p_array, false, *t_key_frequency, t_str_frequency); + t_success = MCArrayFetchValue(p_array, false, MCNAME("frequency"), t_str_frequency); if (t_success) t_success = MCStringCopy((MCStringRef)t_str_frequency, r_calendar.mcfrequency); if (t_success) - t_success = MCArrayFetchValue(p_array, false, *t_key_frequency_count, t_int_frequency_count); + t_success = MCArrayFetchValue(p_array, false, MCNAME("frequencycount"), t_int_frequency_count); if (t_success) r_calendar.mcfrequencycount = MCNumberFetchAsInteger((MCNumberRef)t_int_frequency_count); if (t_success) - t_success = MCArrayFetchValue(p_array, false, *t_key_frequency_interval, t_int_frequency_interval); + t_success = MCArrayFetchValue(p_array, false, MCNAME("frequencyinterval"), t_int_frequency_interval); if (t_success) r_calendar.mcfrequencyinterval = MCNumberFetchAsInteger((MCNumberRef)t_int_frequency_interval); @@ -143,11 +127,9 @@ bool MCArrayDataToCalendar (MCArrayRef p_array, MCCalendar& r_calendar) if (t_success) { - MCNewAutoNameRef t_key_alert1; - MCNameCreateWithCString("alert1", &t_key_alert1); MCValueRef t_int_alert1; - t_success = MCArrayFetchValue(p_array, false, *t_key_alert1, t_int_alert1); + t_success = MCArrayFetchValue(p_array, false, MCNAME("alert1"), t_int_alert1); if (t_success) r_calendar.mcalert1 = MCNumberFetchAsInteger((MCNumberRef)t_int_alert1); @@ -155,11 +137,9 @@ bool MCArrayDataToCalendar (MCArrayRef p_array, MCCalendar& r_calendar) if (t_success) { - MCNewAutoNameRef t_key_alert2; - MCNameCreateWithCString("alert2", &t_key_alert2); MCValueRef t_int_alert2; - t_success = MCArrayFetchValue(p_array, false, *t_key_alert2, t_int_alert2); + t_success = MCArrayFetchValue(p_array, false, MCNAME("alert2"), t_int_alert2); if (t_success) r_calendar.mcalert2 = MCNumberFetchAsInteger((MCNumberRef)t_int_alert2); @@ -167,11 +147,9 @@ bool MCArrayDataToCalendar (MCArrayRef p_array, MCCalendar& r_calendar) if (t_success) { - MCNewAutoNameRef t_key_startdate; - MCNameCreateWithCString("startdate", &t_key_startdate); MCValueRef t_int_startdate; - t_success = MCArrayFetchValue(p_array, false, *t_key_startdate, t_int_startdate); + t_success = MCArrayFetchValue(p_array, false, MCNAME("startdate"), t_int_startdate); if (t_success) { @@ -183,11 +161,9 @@ bool MCArrayDataToCalendar (MCArrayRef p_array, MCCalendar& r_calendar) if (t_success) { - MCNewAutoNameRef t_key_enddate; - MCNameCreateWithCString("enddate", &t_key_enddate); MCValueRef t_int_enddate; - t_success = MCArrayFetchValue(p_array, false, *t_key_enddate, t_int_enddate); + t_success = MCArrayFetchValue(p_array, false, MCNAME("enddate"), t_int_enddate); if (t_success) { @@ -210,8 +186,6 @@ bool MCCalendarToArrayData (MCExecContext &ctxt, MCCalendar p_calendar, MCArrayR if (t_success) { - MCNewAutoNameRef t_key_allday; - MCNameCreateWithCString("allday", &t_key_allday); MCAutoStringRef t_str_allday; if (p_calendar.mcallday == true) @@ -219,80 +193,63 @@ bool MCCalendarToArrayData (MCExecContext &ctxt, MCCalendar p_calendar, MCArrayR else t_success = MCStringCopy(kMCFalseString, &t_str_allday); - t_success = MCArrayStoreValue(r_result, false, *t_key_allday, *t_str_allday); + t_success = MCArrayStoreValue(r_result, false, MCNAME("allday"), *t_str_allday); } if (t_success) { - MCNewAutoNameRef t_key_note; - MCNameCreateWithCString("note", &t_key_note); if (MCStringGetLength(p_calendar.mcnote) > 0) { - t_success = MCArrayStoreValue(r_result, false, *t_key_note, p_calendar.mcnote); + t_success = MCArrayStoreValue(r_result, false, MCNAME("note"), p_calendar.mcnote); } } if (t_success) { - MCNewAutoNameRef t_key_title; - MCNameCreateWithCString("title", &t_key_title); - if (MCStringGetLength(p_calendar.mctitle) > 0) { - t_success = MCArrayStoreValue(r_result, false, *t_key_title, p_calendar.mctitle); + t_success = MCArrayStoreValue(r_result, false, MCNAME("title"), p_calendar.mctitle); } } if (t_success) { - MCNewAutoNameRef t_key_location; - MCNameCreateWithCString("location", &t_key_location); if (MCStringGetLength(p_calendar.mclocation) > 0) { - MCArrayStoreValue(r_result, false, *t_key_location, p_calendar.mclocation); + MCArrayStoreValue(r_result, false, MCNAME("location"), p_calendar.mclocation); } } if (t_success) { - MCNewAutoNameRef t_key_calendar; - MCNameCreateWithCString("calendar", &t_key_calendar); MCAutoStringRef t_str_calendar; if (MCStringGetLength(p_calendar.mccalendar) > 0) { - t_success = MCArrayStoreValue(r_result, false, *t_key_calendar, p_calendar.mccalendar); + t_success = MCArrayStoreValue(r_result, false, MCNAME("calendar"), p_calendar.mccalendar); } } if (t_success) { - MCNewAutoNameRef t_key_frequency; - MCNewAutoNameRef t_key_frequency_count; - MCNewAutoNameRef t_key_frequency_interval; - MCNameCreateWithCString("frequency", &t_key_frequency); - MCNameCreateWithCString("frequencycount", &t_key_frequency_count); - MCNameCreateWithCString("frequencyinterval", &t_key_frequency_interval); MCAutoNumberRef t_int_frequency_count; MCAutoNumberRef t_int_frequency_interval; if (MCStringGetLength(p_calendar.mcfrequency) > 0) { - t_success = MCArrayStoreValue(r_result, false, *t_key_frequency, p_calendar.mcfrequency); + t_success = MCArrayStoreValue(r_result, false, MCNAME("frequency"), p_calendar.mcfrequency); if (t_success) t_success = MCNumberCreateWithInteger(p_calendar.mcfrequencycount, &t_int_frequency_count); if (t_success) - t_success = MCArrayStoreValue(r_result, false, *t_key_frequency_count, *t_int_frequency_count); + t_success = MCArrayStoreValue(r_result, false, MCNAME("frequencycount"), *t_int_frequency_count); if (t_success) t_success = MCNumberCreateWithInteger(p_calendar.mcfrequencyinterval, &t_int_frequency_interval); if (t_success) - t_success = MCArrayStoreValue(r_result, false, *t_key_frequency_interval, *t_int_frequency_interval); + t_success = MCArrayStoreValue(r_result, false, MCNAME("frequencyinterval"), *t_int_frequency_interval); } } if (t_success) { - MCNewAutoNameRef t_key_alert1; - MCNameCreateWithCString("alert1", &t_key_alert1); MCAutoNumberRef t_int_alert1; if (p_calendar.mcalert1 >= 0) @@ -300,14 +257,12 @@ bool MCCalendarToArrayData (MCExecContext &ctxt, MCCalendar p_calendar, MCArrayR t_success = MCNumberCreateWithInteger(p_calendar.mcalert1, &t_int_alert1); if (t_success) - t_success = MCArrayStoreValue(r_result, false, *t_key_alert1, *t_int_alert1); + t_success = MCArrayStoreValue(r_result, false, MCNAME("alert1"), *t_int_alert1); } } if (t_success) { - MCNewAutoNameRef t_key_alert2; - MCNameCreateWithCString("alert2", &t_key_alert2); MCAutoNumberRef t_int_alert2; if (p_calendar.mcalert2 >= 0) @@ -315,7 +270,7 @@ bool MCCalendarToArrayData (MCExecContext &ctxt, MCCalendar p_calendar, MCArrayR t_success = MCNumberCreateWithInteger(p_calendar.mcalert2, &t_int_alert2); if (t_success) - t_success = MCArrayStoreValue(r_result, false, *t_key_alert2, *t_int_alert2); + t_success = MCArrayStoreValue(r_result, false, MCNAME("alert2"), *t_int_alert2); } } @@ -325,14 +280,12 @@ bool MCCalendarToArrayData (MCExecContext &ctxt, MCCalendar p_calendar, MCArrayR MCAutoValueRef t_time; if (MCD_convert_from_datetime(ctxt, p_calendar.mcstartdate, CF_SECONDS, CF_SECONDS, &t_time)) { - MCNewAutoNameRef t_key_startdate; - MCNameCreateWithCString("startdate", &t_key_startdate); MCAutoNumberRef t_int_startdate; t_success = ctxt.ConvertToNumber(*t_time, &t_int_startdate); if (t_success) - t_success = MCArrayStoreValue(r_result, false, *t_key_startdate, *t_int_startdate); + t_success = MCArrayStoreValue(r_result, false, MCNAME("startdate"), *t_int_startdate); } } @@ -342,14 +295,12 @@ bool MCCalendarToArrayData (MCExecContext &ctxt, MCCalendar p_calendar, MCArrayR MCAutoValueRef t_time; if (MCD_convert_from_datetime(ctxt, p_calendar.mcenddate, CF_SECONDS, CF_SECONDS, &t_time)) { - MCNewAutoNameRef t_key_enddate; - MCNameCreateWithCString("enddate", &t_key_enddate); MCAutoNumberRef t_int_enddate; t_success = ctxt.ConvertToNumber(*t_time, &t_int_enddate); if (t_success) - t_success = MCArrayStoreValue(r_result, false, *t_key_enddate, *t_int_enddate); + t_success = MCArrayStoreValue(r_result, false, MCNAME("enddate"), *t_int_enddate); } } diff --git a/engine/src/mblflst.cpp b/engine/src/mblflst.cpp index 9f27849c6a8..7f838f5ced3 100644 --- a/engine/src/mblflst.cpp +++ b/engine/src/mblflst.cpp @@ -115,7 +115,7 @@ MCFontnode::~MCFontnode(void) MCFontStruct *MCFontnode::getfont(MCNameRef fname, uint2 size, uint2 style) { - if (!MCNameIsEqualTo(fname, *reqname)) + if (!MCNameIsEqualToCaseless(fname, *reqname)) return NULL; if (size == 0) return font; diff --git a/engine/src/mblhandlers.cpp b/engine/src/mblhandlers.cpp index 3fcb6073979..4cfd1604c58 100644 --- a/engine/src/mblhandlers.cpp +++ b/engine/src/mblhandlers.cpp @@ -4605,7 +4605,7 @@ bool MCIsPlatformMessage(MCNameRef handler_name) for(uint32_t i = 0; s_platform_messages[i] . message != nil; i++) { - if (MCNameIsEqualToCString(handler_name, s_platform_messages[i].message, kMCCompareCaseless)) + if (MCStringIsEqualToCString(MCNameGetString(handler_name), s_platform_messages[i].message, kMCCompareCaseless)) found = true; } @@ -4662,7 +4662,7 @@ bool MCDoHandlePlatformMessage(bool p_waitable, MCPlatformMessageHandler p_handl bool MCHandlePlatformMessage(MCNameRef p_message, MCParameter *p_parameters, Exec_stat& r_result) { for(uint32_t i = 0; s_platform_messages[i] . message != nil; i++) - if (MCNameIsEqualToCString(p_message, s_platform_messages[i] . message, kMCCompareCaseless)) + if (MCStringIsEqualToCString(MCNameGetString(p_message), s_platform_messages[i] . message, kMCCompareCaseless)) { return MCDoHandlePlatformMessage(s_platform_messages[i] . waitable, s_platform_messages[i] . handler, s_platform_messages[i] . context, p_parameters, r_result); } diff --git a/engine/src/mbliphone.mm b/engine/src/mbliphone.mm index 8d78886492f..2a05f3a5f22 100644 --- a/engine/src/mbliphone.mm +++ b/engine/src/mbliphone.mm @@ -676,7 +676,7 @@ virtual uint64_t GetFileSize(void) { MCAutoStringRef t_path; - if (MCNameIsEqualTo(p_type, MCN_temporary, kMCCompareCaseless)) + if (MCNameIsEqualToCaseless(p_type, MCN_temporary)) { MCAutoStringRef t_temp; MCStringCreateWithCFString((CFStringRef)NSTemporaryDirectory() , &t_temp); @@ -688,17 +688,17 @@ virtual uint64_t GetFileSize(void) else /* UNCHECKED */ MCStringCopy(*t_temp, &t_path); } - else if (MCNameIsEqualTo(p_type, MCN_documents, kMCCompareCaseless)) + else if (MCNameIsEqualToCaseless(p_type, MCN_documents)) { NSArray *t_paths; t_paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); MCStringCreateWithCFString((CFStringRef)[t_paths objectAtIndex: 0] , &t_path); } - else if (MCNameIsEqualTo(p_type, MCN_home, kMCCompareCaseless)) + else if (MCNameIsEqualToCaseless(p_type, MCN_home)) { MCStringCreateWithCFString((CFStringRef)NSHomeDirectory() , &t_path); } - else if (MCNameIsEqualToCString(p_type, "cache", kMCCompareCaseless)) + else if (MCStringIsEqualToCString(MCNameGetString(p_type), "cache", kMCCompareCaseless)) { NSArray *t_paths; t_paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES); @@ -706,8 +706,8 @@ virtual uint64_t GetFileSize(void) } // SN-2015-04-16: [[ Bug 14295 ]] The resources folder on Mobile is the same // as the engine folder. - 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)) { extern MCStringRef MCcmd; uindex_t t_index; @@ -716,7 +716,7 @@ virtual uint64_t GetFileSize(void) /* UNCHECKED */ MCStringCopySubstring(MCcmd, MCRangeMake(0, t_index), &t_path); } - else if (MCNameIsEqualToCString(p_type, "library", kMCCompareCaseless)) + else if (MCStringIsEqualToCString(MCNameGetString(p_type), "library", kMCCompareCaseless)) { NSArray *t_paths; t_paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES); diff --git a/engine/src/mbliphonead.mm b/engine/src/mbliphonead.mm index b5ac5d49b8d..9cfedd7be64 100644 --- a/engine/src/mbliphonead.mm +++ b/engine/src/mbliphonead.mm @@ -441,53 +441,32 @@ bool MCSystemInneractiveAdCreate(MCExecContext &ctxt, MCAd*& r_ad, MCAdType p_ty { MCValueRef t_value; - MCNewAutoNameRef t_age_key; if (t_success) - t_success = MCNameCreateWithCString("age", &t_age_key); - if (t_success) - if (MCArrayFetchValue(p_meta_data, false, *t_age_key, t_value)) + if (MCArrayFetchValue(p_meta_data, false, MCNAME("age"), t_value)) [t_meta_data setObject:MCStringConvertToAutoreleasedNSString(((MCStringRef)t_value)) forKey:[NSNumber numberWithInt:Key_Age]]; - MCNewAutoNameRef t_dist_id_key; - if (t_success) - t_success = MCNameCreateWithCString("distribution id", &t_dist_id_key); if (t_success) - if (MCArrayFetchValue(p_meta_data, false, *t_dist_id_key, t_value)) + if (MCArrayFetchValue(p_meta_data, false, MCNAME("distribution id"), t_value)) [t_meta_data setObject:MCStringConvertToAutoreleasedNSString(((MCStringRef)t_value)) forKey:[NSNumber numberWithInt:Key_Distribution_Id]]; - MCNewAutoNameRef t_gender_key; if (t_success) - t_success = MCNameCreateWithCString("gender", &t_gender_key); - if (t_success) - if (MCArrayFetchValue(p_meta_data, false, *t_gender_key, t_value)) + if (MCArrayFetchValue(p_meta_data, false, MCNAME("gender"), t_value)) [t_meta_data setObject:MCStringConvertToAutoreleasedNSString(((MCStringRef)t_value)) forKey:[NSNumber numberWithInt:Key_Gender]]; - MCNewAutoNameRef t_coordinates_key; - if (t_success) - t_success = MCNameCreateWithCString("coordinates", &t_coordinates_key); if (t_success) - if (MCArrayFetchValue(p_meta_data, false, *t_coordinates_key, t_value)) + if (MCArrayFetchValue(p_meta_data, false, MCNAME("coordinates"), t_value)) [t_meta_data setObject:MCStringConvertToAutoreleasedNSString(((MCStringRef)t_value)) forKey:[NSNumber numberWithInt:Key_Gps_Coordinates]]; - MCNewAutoNameRef t_keywords_key; if (t_success) - t_success = MCNameCreateWithCString("keywords", &t_keywords_key); - if (t_success) - if (MCArrayFetchValue(p_meta_data, false, *t_keywords_key, t_value)) + if (MCArrayFetchValue(p_meta_data, false, MCNAME("keywords"), t_value)) [t_meta_data setObject:MCStringConvertToAutoreleasedNSString(((MCStringRef)t_value)) forKey:[NSNumber numberWithInt:Key_Keywords]]; - MCNewAutoNameRef t_location_key; - if (t_success) - t_success = MCNameCreateWithCString("location", &t_location_key); if (t_success) - if (MCArrayFetchValue(p_meta_data, false, *t_location_key, t_value)) + if (MCArrayFetchValue(p_meta_data, false, MCNAME("location"), t_value)) [t_meta_data setObject:MCStringConvertToAutoreleasedNSString(((MCStringRef)t_value)) forKey:[NSNumber numberWithInt:Key_Location]]; - MCNewAutoNameRef t_phone_key; - if (t_success) - t_success = MCNameCreateWithCString("phone number", &t_phone_key); if (t_success) - if (MCArrayFetchValue(p_meta_data, false, *t_phone_key, t_value)) + if (MCArrayFetchValue(p_meta_data, false, MCNAME("phone number"), t_value)) [t_meta_data setObject:MCStringConvertToAutoreleasedNSString(((MCStringRef)t_value)) forKey:[NSNumber numberWithInt:Key_Msisdn]]; } diff --git a/engine/src/mbliphonecontact.mm b/engine/src/mbliphonecontact.mm index 8ceb97151d4..de1cd41aa60 100644 --- a/engine/src/mbliphonecontact.mm +++ b/engine/src/mbliphonecontact.mm @@ -142,7 +142,7 @@ static bool name_to_key(MCNameRef p_name, CFStringRef &r_key) { for (uindex_t i = 0; i < ELEMENTS(s_key_map); i++) { - if (MCNameIsEqualTo(*s_key_map[i].name, p_name, kMCCompareCaseless)) + if (MCNameIsEqualToCaseless(*s_key_map[i].name, p_name)) { r_key = s_key_map[i].key; return true; diff --git a/engine/src/mbliphoneextra.mm b/engine/src/mbliphoneextra.mm index 65a07d24b9d..e3c834f9aec 100644 --- a/engine/src/mbliphoneextra.mm +++ b/engine/src/mbliphoneextra.mm @@ -983,11 +983,7 @@ bool MCSystemSetRemoteControlDisplayProperties(MCExecContext& ctxt, MCArrayRef p t_info_dict = [[NSMutableDictionary alloc] initWithCapacity: 8]; for(uindex_t i = 0; i < sizeof(s_props) / sizeof(s_props[0]); i++) { - MCNewAutoNameRef t_key; - if (!MCNameCreateWithCString(s_props[i] . key, &t_key)) - return false; - - if (!MCArrayFetchValue(p_props, false, *t_key, t_prop_value)) + if (!MCArrayFetchValue(p_props, false, MCNAME(s_props[i].key), t_prop_value)) continue; NSObject *t_value; diff --git a/engine/src/mbliphonestore.mm b/engine/src/mbliphonestore.mm index c82f4ea613b..a3cf08993b7 100644 --- a/engine/src/mbliphonestore.mm +++ b/engine/src/mbliphonestore.mm @@ -901,59 +901,48 @@ bool MCNSStringToUnicode(NSString *p_ns_string, unichar_t *&r_uni_string, uint32 MCAutoNumberRef t_price_number; - MCNewAutoNameRef t_price_key, t_description_key, t_title_key, t_currency_code_key, t_currency_symbol_key; - MCNewAutoNameRef t_unicode_description_key, t_unicode_title_key, t_unicode_currency_symbol_key; - MCAutoArrayRef t_array; if (t_success) t_success = MCArrayCreateMutable(&t_array); if (t_success) t_success = (MCNumberCreateWithReal([[m_product price] doubleValue], &t_price_number) - && MCNameCreateWithCString("price", &t_price_key) - && MCArrayStoreValue(*t_array, kMCCompareCaseless, *t_price_key, *t_price_number)); + && MCArrayStoreValue(*t_array, kMCCompareCaseless, MCNAME("price"), *t_price_number)); if (t_success && *t_description != nil) { - t_success = (MCNameCreateWithCString("description", &t_description_key) - && MCArrayStoreValue(*t_array, kMCCompareCaseless, *t_description_key, *t_description)); + t_success = MCArrayStoreValue(*t_array, kMCCompareCaseless, MCNAME("description"), *t_description); } if (t_success && *t_title != nil) { - t_success = (MCNameCreateWithCString("title", &t_title_key) - && MCArrayStoreValue(*t_array, kMCCompareCaseless, *t_title_key, *t_title)); + t_success = MCArrayStoreValue(*t_array, kMCCompareCaseless, MCNAME("title"), *t_title); } if (t_success && *t_currency_code != nil) { - t_success = (MCNameCreateWithCString("currency code", &t_currency_code_key) - && MCArrayStoreValue(*t_array, kMCCompareCaseless, *t_currency_code_key, *t_currency_code)); + t_success = MCArrayStoreValue(*t_array, kMCCompareCaseless, MCNAME("currency code"), *t_currency_code); } if (t_success && *t_currency_symbol != nil) { - t_success = (MCNameCreateWithCString("currency symbol", &t_currency_symbol_key) - && MCArrayStoreValue(*t_array, kMCCompareCaseless, *t_currency_symbol_key, *t_currency_symbol)); + t_success = MCArrayStoreValue(*t_array, kMCCompareCaseless, MCNAME("currency symbol"), *t_currency_symbol); } if (t_success && *t_unicode_description != 0) { - t_success = (MCNameCreateWithCString("unicode description", &t_unicode_description_key) - && MCArrayStoreValue(*t_array, kMCCompareCaseless, *t_unicode_description_key, *t_utf16_description)); + t_success = MCArrayStoreValue(*t_array, kMCCompareCaseless, MCNAME("unicode description"), *t_utf16_description); } if (t_success && *t_unicode_title != 0) { - t_success = (MCNameCreateWithCString("unicode title", &t_unicode_title_key) - && MCArrayStoreValue(*t_array, kMCCompareCaseless, *t_unicode_title_key, *t_utf16_title)); + t_success = MCArrayStoreValue(*t_array, kMCCompareCaseless, MCNAME("unicode title"), *t_utf16_title); } if (t_success && *t_unicode_currency_symbol != 0) { - t_success = (MCNameCreateWithCString("unicode currency symbol", &t_unicode_currency_symbol_key) - && MCArrayStoreValue(*t_array, kMCCompareCaseless, *t_unicode_currency_symbol_key, *t_utf16_currency_symbol)); + t_success = MCArrayStoreValue(*t_array, kMCCompareCaseless, MCNAME("unicode currency symbol"), *t_utf16_currency_symbol); } MCParameter p1, p2; diff --git a/engine/src/mcio.cpp b/engine/src/mcio.cpp index 1c8b9ff143f..85020f2bc60 100644 --- a/engine/src/mcio.cpp +++ b/engine/src/mcio.cpp @@ -53,7 +53,7 @@ bool IO_findstream(Streamnode *p_nodes, uindex_t p_node_count, MCNameRef p_name, { while (p_node_count-- > 0) { - if (MCNameIsEqualTo(p_name, p_nodes[p_node_count].name, kMCCompareExact)) + if (MCNameIsEqualTo(p_name, p_nodes[p_node_count].name, kMCStringOptionCompareExact)) { r_index = p_node_count; return true; @@ -114,9 +114,9 @@ void IO_cleanprocesses() MCPlayerHandle t_player = MCplayers; while (t_player.IsValid()) { - if (MCNameIsEqualToCString(MCprocesses[i].name, - t_player->getcommand(), - kMCCompareExact)) + if (MCStringIsEqualToCString(MCNameGetString(MCprocesses[i].name), + t_player->getcommand(), + kMCCompareExact)) { t_player->playstop(); // removes from linked list break; @@ -177,7 +177,7 @@ bool IO_findsocket(MCNameRef p_name, uindex_t& r_index) { IO_cleansockets(MCS_time()); for (r_index = 0 ; r_index < MCnsockets ; r_index++) - if (MCNameIsEqualTo(p_name, MCsockets[r_index]->name)) + if (MCNameIsEqualToCaseless(p_name, MCsockets[r_index]->name)) return true; return false; } diff --git a/engine/src/mcstring.cpp b/engine/src/mcstring.cpp index ed1fb24ce68..c4bc9e23053 100644 --- a/engine/src/mcstring.cpp +++ b/engine/src/mcstring.cpp @@ -207,7 +207,6 @@ MCNameRef MCN_image; MCNameRef MCN_objects; MCNameRef MCN_private; MCNameRef MCN_text; -//MCNameRef MCN_unicode; MCNameRef MCN_styles; MCNameRef MCN_styledtext; MCNameRef MCN_rtftext; @@ -274,7 +273,6 @@ MCNameRef MCN_x86_64; MCNameRef MCN_motorola_powerpc; MCNameRef MCN_i386; MCNameRef MCN_arm; -// SN-2015-01-07: [[ iOS-64bit ]] ARM64 added MCNameRef MCN_arm64; MCNameRef MCN_local_mac; @@ -306,7 +304,6 @@ MCNameRef MCN_fonts; MCNameRef MCN_resources; MCNameRef MCN_home; MCNameRef MCN_start; -//MCNameRef MCN_system; MCNameRef MCN_temporary; MCNameRef MCN_support; @@ -327,22 +324,16 @@ MCNameRef MCN_color_chooser; MCNameRef MCN_color; MCNameRef MCN_file_selector; MCNameRef MCN_file; -//MCNameRef MCN_files; MCNameRef MCN_folder; MCNameRef MCN_folders; MCNameRef MCN_answer_dialog; MCNameRef MCN_ask_dialog; -//MCNameRef MCN_plain; MCNameRef MCN_clear; -//MCNameRef MCN_color; MCNameRef MCN_effect; MCNameRef MCN_error; -//MCNameRef MCN_file; -//MCNameRef MCN_folder; MCNameRef MCN_information; MCNameRef MCN_password; -//MCNameRef MCN_printer; MCNameRef MCN_program; MCNameRef MCN_question; MCNameRef MCN_record; @@ -370,7 +361,6 @@ MCNameRef MCM_current_time_changed; MCNameRef MCM_cut_key; MCNameRef MCM_debug_str; -// AL-2014-11-27: [[ NewIdeMEssages ]] Add deleteAudioclip message MCNameRef MCM_delete_audioclip; MCNameRef MCM_delete_background; MCNameRef MCM_delete_button; @@ -384,7 +374,6 @@ MCNameRef MCM_delete_key; MCNameRef MCM_delete_scrollbar; MCNameRef MCM_delete_player; MCNameRef MCM_delete_stack; -// AL-2014-11-27: [[ NewIdeMEssages ]] Add deleteVideoclip message MCNameRef MCM_delete_videoclip; MCNameRef MCM_delete_widget; MCNameRef MCM_delete_url; @@ -432,8 +421,6 @@ MCNameRef MCM_library_stack; MCNameRef MCM_link_clicked; MCNameRef MCM_load_url; MCNameRef MCM_main_stack_changed; - -// MW-2013-03-20: [[ MainStacksChanged ]] MCNameRef MCM_main_stacks_changed; MCNameRef MCM_menu_pick; @@ -457,13 +444,11 @@ MCNameRef MCM_move_stack; MCNameRef MCM_move_stopped; MCNameRef MCM_movie_touched; MCNameRef MCM_name_changed; -// AL-2014-11-27: [[ NewIdeMEssages ]] Add newAudioclip message MCNameRef MCM_new_audioclip; MCNameRef MCM_new_background; MCNameRef MCM_new_card; MCNameRef MCM_new_stack; MCNameRef MCM_new_tool; -// AL-2014-11-27: [[ NewIdeMEssages ]] Add newVideoclip message MCNameRef MCM_new_videoclip; MCNameRef MCM_node_changed; MCNameRef MCM_object_selection_ended; @@ -558,11 +543,8 @@ MCNameRef MCN_email; MCNameRef MCN_phone; MCNameRef MCN_address; -//MCNameRef MCN_home; MCNameRef MCN_work; MCNameRef MCN_other; -//MCNameRef MCN_mobile; -//MCNameRef MCN_iphone; MCNameRef MCN_main; MCNameRef MCN_homefax; MCNameRef MCN_workfax; @@ -622,7 +604,6 @@ MCNameRef MCM_input_text_changed; MCNameRef MCM_product_details_received; MCNameRef MCM_product_request_error; MCNameRef MCM_nfc_tag_received; - #endif #ifdef _IOS_MOBILE @@ -638,12 +619,8 @@ MCNameRef MCM_player_state_changed; MCNameRef MCM_player_movie_changed; MCNameRef MCM_player_stopped; MCNameRef MCM_reachability_changed; -//MCNameRef MCM_product_details_received; -//MCNameRef MCM_product_request_error; MCNameRef MCM_protected_data_available; MCNameRef MCM_protected_data_unavailable; - -// MW-2013-05-30: [[ RemoteControl ]] Message sent when a remote control event is received. MCNameRef MCM_remote_control_received; #endif @@ -655,927 +632,471 @@ MCNameRef MCN_font_message; MCNameRef MCN_font_tooltip; MCNameRef MCN_font_system; -void X_initialize_names(void) +const struct { const char *cstring; MCNameRef *name_var; } kInitialNames[] = { - /* UNCHECKED */ MCNameCreateWithCString("msg", MCN_msg); - /* UNCHECKED */ MCNameCreateWithCString("each", MCN_each); - /* UNCHECKED */ MCNameCreateWithCString("it", MCN_it); + { "msg", &MCN_msg }, + { "each", &MCN_each }, + { "it", &MCN_it }, - // SN-2014-08-11: [[ Bug 13144 ]] Cancel string should be 'Cancel', not 'cancel' - /* UNCHECKED */ MCNameCreateWithCString("Cancel", MCN_cancel); - - /* UNCHECKED */ MCNameCreateWithCString(DEFAULT_TEXT_FONT, MCN_default_text_font); - /* UNCHECKED */ MCNameCreateWithCString(PLATFORM_STRING, MCN_platform_string); - /* UNCHECKED */ MCNameCreateWithCString(MC_BUILD_ENGINE_SHORT_VERSION, MCN_version_string); - - /* UNCHECKED */ MCNameCreateWithCString("metadata", MCN_metadata); - /* UNCHECKED */ MCNameCreateWithCString("runs", MCN_runs); - /* UNCHECKED */ MCNameCreateWithCString("style", MCN_style); - - /* UNCHECKED */ MCNameCreateWithCString("down", MCN_down); - /* UNCHECKED */ MCNameCreateWithCString("up", MCN_up); - - /* UNCHECKED */ MCNameCreateWithCString("empty", MCN_empty); - /* UNCHECKED */ MCNameCreateWithCString("files", MCN_files); - /* UNCHECKED */ MCNameCreateWithCString("image", MCN_image); - /* UNCHECKED */ MCNameCreateWithCString("objects", MCN_objects); - /* UNCHECKED */ MCNameCreateWithCString("private", MCN_private); - /* UNCHECKED */ MCNameCreateWithCString("text", MCN_text); -// /* UNCHECKED */ MCNameCreateWithCString("unicode", MCN_unicode); - /* UNCHECKED */ MCNameCreateWithCString("styles", MCN_styles); - /* UNCHECKED */ MCNameCreateWithCString("styledtext", MCN_styledtext); - /* UNCHECKED */ MCNameCreateWithCString("rtftext", MCN_rtftext); - /* UNCHECKED */ MCNameCreateWithCString("htmltext", MCN_htmltext); - /* UNCHECKED */ MCNameCreateWithCString("png", MCN_png); - /* UNCHECKED */ MCNameCreateWithCString("gif", MCN_gif); - /* UNCHECKED */ MCNameCreateWithCString("jpeg", MCN_jpeg); - /* UNCHECKED */ MCNameCreateWithCString("windows bitmap", MCN_win_bitmap); - /* UNCHECKED */ MCNameCreateWithCString("windows metafile", MCN_win_metafile); - /* UNCHECKED */ MCNameCreateWithCString("windows enhanced metafile", MCN_win_enh_metafile); - /* UNCHECKED */ MCNameCreateWithCString("rtf", MCN_rtf); - /* UNCHECKED */ MCNameCreateWithCString("html", MCN_html); - - /* UNCHECKED */ MCNameCreateWithCString("browser", MCN_browser); - /* UNCHECKED */ MCNameCreateWithCString("command line", MCN_command_line); - /* UNCHECKED */ MCNameCreateWithCString("development", MCN_development); - /* UNCHECKED */ MCNameCreateWithCString("development command line", MCN_development_cmdline); - /* UNCHECKED */ MCNameCreateWithCString("helper application", MCN_helper_application); - /* UNCHECKED */ MCNameCreateWithCString("installer", MCN_installer); - /* UNCHECKED */ MCNameCreateWithCString("installer command line", MCN_installer_cmdline); - /* UNCHECKED */ MCNameCreateWithCString("mobile", MCN_mobile); - /* UNCHECKED */ MCNameCreateWithCString("player", MCN_player); - /* UNCHECKED */ MCNameCreateWithCString("server", MCN_server); - /* UNCHECKED */ MCNameCreateWithCString("standalone application", MCN_standalone_application); - - /* UNCHECKED */ MCNameCreateWithCString("all", MCN_all); - /* UNCHECKED */ MCNameCreateWithCString("autokey", MCN_auto_key); - /* UNCHECKED */ MCNameCreateWithCString("disk", MCN_disk); - /* UNCHECKED */ MCNameCreateWithCString("activate", MCN_activate); - /* UNCHECKED */ MCNameCreateWithCString("highlevel", MCN_high_level); - /* UNCHECKED */ MCNameCreateWithCString("system", MCN_system); - - /* UNCHECKED */ MCNameCreateWithCString("ansi", MCN_ansi); - /* UNCHECKED */ MCNameCreateWithCString("arabic", MCN_arabic); - /* UNCHECKED */ MCNameCreateWithCString("bulgarian", MCN_bulgarian); - /* UNCHECKED */ MCNameCreateWithCString("chinese", MCN_chinese); - /* UNCHECKED */ MCNameCreateWithCString("english", MCN_english); - /* UNCHECKED */ MCNameCreateWithCString("greek", MCN_greek); - /* UNCHECKED */ MCNameCreateWithCString("hebrew", MCN_hebrew); - /* UNCHECKED */ MCNameCreateWithCString("japanese", MCN_japanese); - /* UNCHECKED */ MCNameCreateWithCString("korean", MCN_korean); - /* UNCHECKED */ MCNameCreateWithCString("lithuanian", MCN_lithuanian); - /* UNCHECKED */ MCNameCreateWithCString("polish", MCN_polish); - /* UNCHECKED */ MCNameCreateWithCString("roman", MCN_roman); - /* UNCHECKED */ MCNameCreateWithCString("russian", MCN_russian); - /* UNCHECKED */ MCNameCreateWithCString("simpleChinese", MCN_simple_chinese); - /* UNCHECKED */ MCNameCreateWithCString("thai", MCN_thai); - /* UNCHECKED */ MCNameCreateWithCString("turkish", MCN_turkish); - /* UNCHECKED */ MCNameCreateWithCString("ukrainian", MCN_ukrainian); - /* UNCHECKED */ MCNameCreateWithCString("unicode", MCN_unicode); - /* UNCHECKED */ MCNameCreateWithCString("utf8", MCN_utf8); - /* UNCHECKED */ MCNameCreateWithCString("vietnamese", MCN_vietnamese); - /* UNCHECKED */ MCNameCreateWithCString("w", MCN_w_char); - /* UNCHECKED */ MCNameCreateWithCString("*", MCN_asterisk_char); - - /* UNCHECKED */ MCNameCreateWithCString("plain", MCN_plain); - /* UNCHECKED */ MCNameCreateWithCString("bold", MCN_bold); - /* UNCHECKED */ MCNameCreateWithCString("italic", MCN_italic); - /* UNCHECKED */ MCNameCreateWithCString("bold-italic", MCN_bold_italic); - - /* UNCHECKED */ MCNameCreateWithCString("unknown", MCN_unknown); - /* UNCHECKED */ MCNameCreateWithCString("x86", MCN_x86); - /* UNCHECKED */ MCNameCreateWithCString("x86_64", MCN_x86_64); - /* UNCHECKED */ MCNameCreateWithCString("Motorola PowerPC", MCN_motorola_powerpc); - /* UNCHECKED */ MCNameCreateWithCString("i386", MCN_i386); - /* UNCHECKED */ MCNameCreateWithCString("ARM", MCN_arm); - // SN-2015-01-07: [[ iOS-64bit ]] ARM64 added - /* UNCHECKED */ MCNameCreateWithCString("arm64", MCN_arm64); - - /* UNCHECKED */ MCNameCreateWithCString("local Mac", MCN_local_mac); - /* UNCHECKED */ MCNameCreateWithCString("local Win32", MCN_local_win32); - /* UNCHECKED */ MCNameCreateWithCString("android", MCN_android); - /* UNCHECKED */ MCNameCreateWithCString("iphone", MCN_iphone); - /* UNCHECKED */ MCNameCreateWithCString("wince", MCN_wince); - - /* UNCHECKED */ MCNameCreateWithCString("Mac OS", MCN_mac_os); - /* UNCHECKED */ MCNameCreateWithCString("Win32", MCN_win32); - - /* UNCHECKED */ MCNameCreateWithCString("done", MCN_done); - - /* UNCHECKED */ MCNameCreateWithCString("StaticGray", MCN_staticgray); - /* UNCHECKED */ MCNameCreateWithCString("GrayScale", MCN_grayscale); - /* UNCHECKED */ MCNameCreateWithCString("StaticColor", MCN_staticcolor); - /* UNCHECKED */ MCNameCreateWithCString("PseudoColor", MCN_pseudocolor); - /* UNCHECKED */ MCNameCreateWithCString("TrueColor", MCN_truecolor); - /* UNCHECKED */ MCNameCreateWithCString("DirectColor", MCN_directcolor); - - /* UNCHECKED */ MCNameCreateWithCString("bounds", MCN_bounds); - /* UNCHECKED */ MCNameCreateWithCString("pixels", MCN_pixels); - /* UNCHECKED */ MCNameCreateWithCString("opaque pixels", MCN_opaque_pixels); - - /* UNCHECKED */ MCNameCreateWithCString("desktop", MCN_desktop); - /* UNCHECKED */ MCNameCreateWithCString("documents", MCN_documents); - /* UNCHECKED */ MCNameCreateWithCString("engine", MCN_engine); - /* UNCHECKED */ MCNameCreateWithCString("resources", MCN_resources); - /* UNCHECKED */ MCNameCreateWithCString("fonts", MCN_fonts); - /* UNCHECKED */ MCNameCreateWithCString("home", MCN_home); - /* UNCHECKED */ MCNameCreateWithCString("start", MCN_start); -// /* UNCHECKED */ MCNameCreateWithCString("system", MCN_system); - /* UNCHECKED */ MCNameCreateWithCString("temporary", MCN_temporary); - /* UNCHECKED */ MCNameCreateWithCString("support", MCN_support); - - /* UNCHECKED */ MCNameCreateWithCString("Apple", MCN_apple); - /* UNCHECKED */ MCNameCreateWithCString("Control", MCN_control); - /* UNCHECKED */ MCNameCreateWithCString("Extension", MCN_extension); - /* UNCHECKED */ MCNameCreateWithCString("Preferences", MCN_preferences); + { "Cancel", &MCN_cancel }, + + { DEFAULT_TEXT_FONT, &MCN_default_text_font }, + { PLATFORM_STRING, &MCN_platform_string }, + { MC_BUILD_ENGINE_SHORT_VERSION, &MCN_version_string }, + + { "metadata", &MCN_metadata }, + { "runs", &MCN_runs }, + { "style", &MCN_style }, + + { "down", &MCN_down }, + { "up", &MCN_up }, + + { "empty", &MCN_empty }, + { "files", &MCN_files }, + { "image", &MCN_image }, + { "objects", &MCN_objects }, + { "private", &MCN_private }, + { "text", &MCN_text }, + { "styles", &MCN_styles }, + { "styledtext", &MCN_styledtext }, + { "rtftext", &MCN_rtftext }, + { "htmltext", &MCN_htmltext }, + { "png", &MCN_png }, + { "gif", &MCN_gif }, + { "jpeg", &MCN_jpeg }, + { "windows bitmap", &MCN_win_bitmap }, + { "windows metafile", &MCN_win_metafile }, + { "windows enhanced metafile", &MCN_win_enh_metafile }, + { "rtf", &MCN_rtf }, + { "html", &MCN_html }, + + { "browser", &MCN_browser }, + { "command line", &MCN_command_line }, + { "development", &MCN_development }, + { "development command line", &MCN_development_cmdline }, + { "helper application", &MCN_helper_application }, + { "installer", &MCN_installer }, + { "installer command line", &MCN_installer_cmdline }, + { "mobile", &MCN_mobile }, + { "player", &MCN_player }, + { "server", &MCN_server }, + { "standalone application", &MCN_standalone_application }, + + { "all", &MCN_all }, + { "autokey", &MCN_auto_key }, + { "disk", &MCN_disk }, + { "activate", &MCN_activate }, + { "highlevel", &MCN_high_level }, + { "system", &MCN_system }, + + { "ansi", &MCN_ansi }, + { "arabic", &MCN_arabic }, + { "bulgarian", &MCN_bulgarian }, + { "chinese", &MCN_chinese }, + { "english", &MCN_english }, + { "greek", &MCN_greek }, + { "hebrew", &MCN_hebrew }, + { "japanese", &MCN_japanese }, + { "korean", &MCN_korean }, + { "lithuanian", &MCN_lithuanian }, + { "polish", &MCN_polish }, + { "roman", &MCN_roman }, + { "russian", &MCN_russian }, + { "simpleChinese", &MCN_simple_chinese }, + { "thai", &MCN_thai }, + { "turkish", &MCN_turkish }, + { "ukrainian", &MCN_ukrainian }, + { "unicode", &MCN_unicode }, + { "utf8", &MCN_utf8 }, + { "vietnamese", &MCN_vietnamese }, + { "w", &MCN_w_char }, + { "*", &MCN_asterisk_char }, + + { "plain", &MCN_plain }, + { "bold", &MCN_bold }, + { "italic", &MCN_italic }, + { "bold-italic", &MCN_bold_italic }, + + { "unknown", &MCN_unknown }, + { "x86", &MCN_x86 }, + { "x86_64", &MCN_x86_64 }, + { "Motorola PowerPC", &MCN_motorola_powerpc }, + { "i386", &MCN_i386 }, + { "ARM", &MCN_arm }, + { "arm64", &MCN_arm64 }, + + { "local Mac", &MCN_local_mac }, + { "local Win32", &MCN_local_win32 }, + { "android", &MCN_android }, + { "iphone", &MCN_iphone }, + { "wince", &MCN_wince }, + + { "Mac OS", &MCN_mac_os }, + { "Win32", &MCN_win32 }, + + { "done", &MCN_done }, + + { "StaticGray", &MCN_staticgray }, + { "GrayScale", &MCN_grayscale }, + { "StaticColor", &MCN_staticcolor }, + { "PseudoColor", &MCN_pseudocolor }, + { "TrueColor", &MCN_truecolor }, + { "DirectColor", &MCN_directcolor }, + + { "bounds", &MCN_bounds }, + { "pixels", &MCN_pixels }, + { "opaque pixels", &MCN_opaque_pixels }, + + { "desktop", &MCN_desktop }, + { "documents", &MCN_documents }, + { "engine", &MCN_engine }, + { "resources", &MCN_resources }, + { "fonts", &MCN_fonts }, + { "home", &MCN_home }, + { "start", &MCN_start }, + { "temporary", &MCN_temporary }, + { "support", &MCN_support }, + + { "Apple", &MCN_apple }, + { "Control", &MCN_control }, + { "Extension", &MCN_extension }, + { "Preferences", &MCN_preferences }, - /* UNCHECKED */ MCNameCreateWithCString("unhandled", MCN_unhandled); - /* UNCHECKED */ MCNameCreateWithCString("handled", MCN_handled); - /* UNCHECKED */ MCNameCreateWithCString("passed", MCN_passed); - - /* UNCHECKED */ MCNameCreateWithCString("Page Setup Dialog", MCN_page_setup_dialog); - /* UNCHECKED */ MCNameCreateWithCString("pagesetup", MCN_pagesetup); - /* UNCHECKED */ MCNameCreateWithCString("Print Dialog", MCN_print_dialog); - /* UNCHECKED */ MCNameCreateWithCString("printer", MCN_printer); - /* UNCHECKED */ MCNameCreateWithCString("Color Chooser", MCN_color_chooser); - /* UNCHECKED */ MCNameCreateWithCString("color", MCN_color); - /* UNCHECKED */ MCNameCreateWithCString("File Selector", MCN_file_selector); - /* UNCHECKED */ MCNameCreateWithCString("file", MCN_file); - ///* UNCHECKED */ MCNameCreateWithCString("files", MCN_files); - /* UNCHECKED */ MCNameCreateWithCString("folder", MCN_folder); - /* UNCHECKED */ MCNameCreateWithCString("folders", MCN_folders); - /* UNCHECKED */ MCNameCreateWithCString("Answer Dialog", MCN_answer_dialog); - /* UNCHECKED */ MCNameCreateWithCString("Ask Dialog", MCN_ask_dialog); - - ///* UNCHECKED */ MCNameCreateWithCString("plain", MCN_plain); - /* UNCHECKED */ MCNameCreateWithCString("clear", MCN_clear); - ///* UNCHECKED */ MCNameCreateWithCString("color", MCN_color); - /* UNCHECKED */ MCNameCreateWithCString("effect", MCN_effect); - /* UNCHECKED */ MCNameCreateWithCString("error", MCN_error); - ///* UNCHECKED */ MCNameCreateWithCString("file", MCN_file); - ///* UNCHECKED */ MCNameCreateWithCString("folder", MCN_folder); - /* UNCHECKED */ MCNameCreateWithCString("information", MCN_information); - /* UNCHECKED */ MCNameCreateWithCString("password", MCN_password); - ///* UNCHECKED */ MCNameCreateWithCString("printer", MCN_printer); - /* UNCHECKED */ MCNameCreateWithCString("program", MCN_program); - /* UNCHECKED */ MCNameCreateWithCString("question", MCN_question); - /* UNCHECKED */ MCNameCreateWithCString("record", MCN_record); - /* UNCHECKED */ MCNameCreateWithCString("titled", MCN_titled); - /* UNCHECKED */ MCNameCreateWithCString("warning", MCN_warning); - - /* UNCHECKED */ MCNameCreateWithCString("Message Box", MCN_messagename); - /* UNCHECKED */ MCNameCreateWithCString("msgchanged", MCM_msgchanged); - /* UNCHECKED */ MCNameCreateWithCString("HyperCard Import Status", MCN_hcstat); - /* UNCHECKED */ MCNameCreateWithCString("appleEvent", MCM_apple_event); - /* UNCHECKED */ MCNameCreateWithCString("arrowKey", MCM_arrow_key); - /* UNCHECKED */ MCNameCreateWithCString("assertError", MCM_assert_error); - /* UNCHECKED */ MCNameCreateWithCString("backspaceKey", MCM_backspace_key); - /* UNCHECKED */ MCNameCreateWithCString("closeBackground", MCM_close_background); - /* UNCHECKED */ MCNameCreateWithCString("closeCard", MCM_close_card); - /* UNCHECKED */ MCNameCreateWithCString("closeControl", MCM_close_control); - /* UNCHECKED */ MCNameCreateWithCString("closeField", MCM_close_field); - /* UNCHECKED */ MCNameCreateWithCString("closeStack", MCM_close_stack); - /* UNCHECKED */ MCNameCreateWithCString("closeStackRequest", MCM_close_stack_request); - /* UNCHECKED */ MCNameCreateWithCString("colorChanged", MCM_color_changed); - /* UNCHECKED */ MCNameCreateWithCString("commandKeyDown", MCM_command_key_down); - /* UNCHECKED */ MCNameCreateWithCString("controlKeyDown", MCM_control_key_down); - /* UNCHECKED */ MCNameCreateWithCString("copyKey", MCM_copy_key); - /* UNCHECKED */ MCNameCreateWithCString("currentTimeChanged", MCM_current_time_changed); - /* UNCHECKED */ MCNameCreateWithCString("cutKey", MCM_cut_key); - /* UNCHECKED */ MCNameCreateWithCString("debugStr", MCM_debug_str); - /* UNCHECKED */ MCNameCreateWithCString("deleteBackground", MCM_delete_background); - /* UNCHECKED */ MCNameCreateWithCString("deleteButton", MCM_delete_button); - /* UNCHECKED */ MCNameCreateWithCString("deleteCard", MCM_delete_card); - /* UNCHECKED */ MCNameCreateWithCString("deleteEPS", MCM_delete_eps); - /* UNCHECKED */ MCNameCreateWithCString("deleteField", MCM_delete_field); - /* UNCHECKED */ MCNameCreateWithCString("deleteGraphic", MCM_delete_graphic); - /* UNCHECKED */ MCNameCreateWithCString("deleteGroup", MCM_delete_group); - /* UNCHECKED */ MCNameCreateWithCString("deleteImage", MCM_delete_image); - /* UNCHECKED */ MCNameCreateWithCString("deleteKey", MCM_delete_key); - /* UNCHECKED */ MCNameCreateWithCString("deleteScrollbar", MCM_delete_scrollbar); - /* UNCHECKED */ MCNameCreateWithCString("deletePlayer", MCM_delete_player); - /* UNCHECKED */ MCNameCreateWithCString("deleteStack", MCM_delete_stack); - /* UNCHECKED */ MCNameCreateWithCString("deleteWidget", MCM_delete_widget); - /* UNCHECKED */ MCNameCreateWithCString("deleteURL", MCM_delete_url); - /* UNCHECKED */ MCNameCreateWithCString("desktopChanged", MCM_desktop_changed); - /* UNCHECKED */ MCNameCreateWithCString("dragDrop", MCM_drag_drop); - /* UNCHECKED */ MCNameCreateWithCString("dragEnd", MCM_drag_end); - /* UNCHECKED */ MCNameCreateWithCString("dragEnter", MCM_drag_enter); - /* UNCHECKED */ MCNameCreateWithCString("dragLeave", MCM_drag_leave); - /* UNCHECKED */ MCNameCreateWithCString("dragMove", MCM_drag_move); - /* UNCHECKED */ MCNameCreateWithCString("dragStart", MCM_drag_start); - /* UNCHECKED */ MCNameCreateWithCString("editScript", MCM_edit_script); - /* UNCHECKED */ MCNameCreateWithCString("enterInField", MCM_enter_in_field); - /* UNCHECKED */ MCNameCreateWithCString("enterKey", MCM_enter_key); - /* UNCHECKED */ MCNameCreateWithCString("errorDialog", MCM_error_dialog); - /* UNCHECKED */ MCNameCreateWithCString("escapeKey", MCM_escape_key); - /* UNCHECKED */ MCNameCreateWithCString("eval", MCM_eval); - /* UNCHECKED */ MCNameCreateWithCString("exitField", MCM_exit_field); - /* UNCHECKED */ MCNameCreateWithCString("focusIn", MCM_focus_in); - /* UNCHECKED */ MCNameCreateWithCString("focusOut", MCM_focus_out); - /* UNCHECKED */ MCNameCreateWithCString("functionKey", MCM_function_key); - /* UNCHECKED */ MCNameCreateWithCString("getCachedURLs", MCM_get_cached_urls); - /* UNCHECKED */ MCNameCreateWithCString("getURL", MCM_get_url); - /* UNCHECKED */ MCNameCreateWithCString("getURLStatus", MCM_get_url_status); - /* UNCHECKED */ MCNameCreateWithCString("gradientEditEnded", MCM_gradient_edit_ended); - /* UNCHECKED */ MCNameCreateWithCString("gradientEditStarted", MCM_gradient_edit_started); - /* UNCHECKED */ MCNameCreateWithCString("help", MCM_help); - /* UNCHECKED */ MCNameCreateWithCString("hotSpotClicked", MCM_hot_spot_clicked); - /* UNCHECKED */ MCNameCreateWithCString("iconMenuPick", MCM_icon_menu_pick); - /* UNCHECKED */ MCNameCreateWithCString("iconMenuOpening", MCM_icon_menu_opening); - /* UNCHECKED */ MCNameCreateWithCString("statusIconMenuPick", MCM_status_icon_menu_pick); - /* UNCHECKED */ MCNameCreateWithCString("statusIconMenuOpening", MCM_status_icon_menu_opening); - /* UNCHECKED */ MCNameCreateWithCString("statusIconClick", MCM_status_icon_click); - /* UNCHECKED */ MCNameCreateWithCString("statusIconDoubleClick", MCM_status_icon_double_click); - /* UNCHECKED */ MCNameCreateWithCString("iconifyStack", MCM_iconify_stack); - /* UNCHECKED */ MCNameCreateWithCString("idChanged", MCM_id_changed); - /* UNCHECKED */ MCNameCreateWithCString("idle", MCM_idle); - /* UNCHECKED */ MCNameCreateWithCString("internal", MCM_internal); - /* UNCHECKED */ MCNameCreateWithCString("internal2", MCM_internal2); - /* UNCHECKED */ MCNameCreateWithCString("internal3", MCM_internal3); - /* UNCHECKED */ MCNameCreateWithCString("keyDown", MCM_key_down); - /* UNCHECKED */ MCNameCreateWithCString("keyUp", MCM_key_up); - /* UNCHECKED */ MCNameCreateWithCString("keyboardActivated", MCM_keyboard_activated); - /* UNCHECKED */ MCNameCreateWithCString("keyboardDeactivated", MCM_keyboard_deactivated); - /* UNCHECKED */ MCNameCreateWithCString("libraryStack", MCM_library_stack); - /* UNCHECKED */ MCNameCreateWithCString("linkClicked", MCM_link_clicked); - /* UNCHECKED */ MCNameCreateWithCString("loadURL", MCM_load_url); - /* UNCHECKED */ MCNameCreateWithCString("mainStackChanged", MCM_main_stack_changed); - // MW-2013-03-20: [[ MainStacksChanged ]] - /* UNCHECKED */ MCNameCreateWithCString("_mainStacksChanged", MCM_main_stacks_changed); - /* UNCHECKED */ MCNameCreateWithCString("menuPick", MCM_menu_pick); - /* UNCHECKED */ MCNameCreateWithCString("message", MCM_message); - /* UNCHECKED */ MCNameCreateWithCString("messageHandled", MCM_message_handled); - /* UNCHECKED */ MCNameCreateWithCString("messageNotHandled", MCM_message_not_handled); - /* UNCHECKED */ MCNameCreateWithCString("mouseDoubleDown", MCM_mouse_double_down); - /* UNCHECKED */ MCNameCreateWithCString("mouseDoubleUp", MCM_mouse_double_up); - /* UNCHECKED */ MCNameCreateWithCString("mouseDown", MCM_mouse_down); - /* UNCHECKED */ MCNameCreateWithCString("mouseDownInBackdrop", MCM_mouse_down_in_backdrop); - /* UNCHECKED */ MCNameCreateWithCString("mouseEnter", MCM_mouse_enter); - /* UNCHECKED */ MCNameCreateWithCString("mouseLeave", MCM_mouse_leave); - /* UNCHECKED */ MCNameCreateWithCString("mouseMove", MCM_mouse_move); - /* UNCHECKED */ MCNameCreateWithCString("mouseRelease", MCM_mouse_release); - /* UNCHECKED */ MCNameCreateWithCString("mouseStillDown", MCM_mouse_still_down); - /* UNCHECKED */ MCNameCreateWithCString("mouseUp", MCM_mouse_up); - /* UNCHECKED */ MCNameCreateWithCString("mouseUpInBackdrop", MCM_mouse_up_in_backdrop); - /* UNCHECKED */ MCNameCreateWithCString("mouseWithin", MCM_mouse_within); - /* UNCHECKED */ MCNameCreateWithCString("moveControl", MCM_move_control); - /* UNCHECKED */ MCNameCreateWithCString("moveStack", MCM_move_stack); - /* UNCHECKED */ MCNameCreateWithCString("moveStopped", MCM_move_stopped); - /* UNCHECKED */ MCNameCreateWithCString("movieTouched", MCM_movie_touched); - /* UNCHECKED */ MCNameCreateWithCString("nameChanged", MCM_name_changed); - /* UNCHECKED */ MCNameCreateWithCString("newBackground", MCM_new_background); - /* UNCHECKED */ MCNameCreateWithCString("newCard", MCM_new_card); - /* UNCHECKED */ MCNameCreateWithCString("newStack", MCM_new_stack); - /* UNCHECKED */ MCNameCreateWithCString("newTool", MCM_new_tool); - /* UNCHECKED */ MCNameCreateWithCString("nodeChanged", MCM_node_changed); - /* UNCHECKED */ MCNameCreateWithCString("objectSelectionEnded", MCM_object_selection_ended); - /* UNCHECKED */ MCNameCreateWithCString("objectSelectionStarted", MCM_object_selection_started); - /* UNCHECKED */ MCNameCreateWithCString("openBackground", MCM_open_background); - /* UNCHECKED */ MCNameCreateWithCString("openCard", MCM_open_card); - /* UNCHECKED */ MCNameCreateWithCString("openControl", MCM_open_control); - /* UNCHECKED */ MCNameCreateWithCString("openField", MCM_open_field); - /* UNCHECKED */ MCNameCreateWithCString("openStack", MCM_open_stack); - /* UNCHECKED */ MCNameCreateWithCString("optionKeyDown", MCM_option_key_down); - /* UNCHECKED */ MCNameCreateWithCString("pasteKey", MCM_paste_key); - /* UNCHECKED */ MCNameCreateWithCString("playPaused", MCM_play_paused); - /* UNCHECKED */ MCNameCreateWithCString("playRateChanged", MCM_play_rate_changed); - /* UNCHECKED */ MCNameCreateWithCString("playStarted", MCM_play_started); - /* UNCHECKED */ MCNameCreateWithCString("playStopped", MCM_play_stopped); - /* UNCHECKED */ MCNameCreateWithCString("postURL", MCM_post_url); - /* UNCHECKED */ MCNameCreateWithCString("preOpenBackground", MCM_preopen_background); - /* UNCHECKED */ MCNameCreateWithCString("preOpenCard", MCM_preopen_card); - /* UNCHECKED */ MCNameCreateWithCString("preOpenControl", MCM_preopen_control); - /* UNCHECKED */ MCNameCreateWithCString("preOpenStack", MCM_preopen_stack); - /* UNCHECKED */ MCNameCreateWithCString("propertyChanged", MCM_property_changed); - /* UNCHECKED */ MCNameCreateWithCString("putURL", MCM_put_url); - /* UNCHECKED */ MCNameCreateWithCString("QTDebugStr", MCM_qtdebugstr); - /* UNCHECKED */ MCNameCreateWithCString("rawKeyDown", MCM_raw_key_down); - /* UNCHECKED */ MCNameCreateWithCString("rawKeyUp", MCM_raw_key_up); - /* UNCHECKED */ MCNameCreateWithCString("relaunch", MCM_relaunch); - /* UNCHECKED */ MCNameCreateWithCString("releaseStack", MCM_release_stack); - /* UNCHECKED */ MCNameCreateWithCString("reloadStack", MCM_reload_stack); - /* UNCHECKED */ MCNameCreateWithCString("resizeControl", MCM_resize_control); - /* UNCHECKED */ MCNameCreateWithCString("resizeControlEnded", MCM_resize_control_ended); - /* UNCHECKED */ MCNameCreateWithCString("resizeControlStarted", MCM_resize_control_started); - /* UNCHECKED */ MCNameCreateWithCString("resizeStack", MCM_resize_stack); - /* UNCHECKED */ MCNameCreateWithCString("resolutionError", MCM_resolution_error); - /* UNCHECKED */ MCNameCreateWithCString("resume", MCM_resume); - /* UNCHECKED */ MCNameCreateWithCString("resumeStack", MCM_resume_stack); - /* UNCHECKED */ MCNameCreateWithCString("returnInField", MCM_return_in_field); - /* UNCHECKED */ MCNameCreateWithCString("returnKey", MCM_return_key); - /* UNCHECKED */ MCNameCreateWithCString("saveStackRequest", MCM_save_stack_request); - /* UNCHECKED */ MCNameCreateWithCString("scriptParsingError", MCM_script_error); - /* UNCHECKED */ MCNameCreateWithCString("scriptExecutionError", MCM_script_execution_error); - /* UNCHECKED */ MCNameCreateWithCString("scrollbarBeginning", MCM_scrollbar_beginning); - /* UNCHECKED */ MCNameCreateWithCString("scrollbarDrag", MCM_scrollbar_drag); - /* UNCHECKED */ MCNameCreateWithCString("scrollbarEnd", MCM_scrollbar_end); - /* UNCHECKED */ MCNameCreateWithCString("scrollbarLineDec", MCM_scrollbar_line_dec); - /* UNCHECKED */ MCNameCreateWithCString("scrollbarLineInc", MCM_scrollbar_line_inc); - /* UNCHECKED */ MCNameCreateWithCString("scrollbarPageDec", MCM_scrollbar_page_dec); - /* UNCHECKED */ MCNameCreateWithCString("scrollbarPageInc", MCM_scrollbar_page_inc); - /* UNCHECKED */ MCNameCreateWithCString("selectedObjectChanged", MCM_selected_object_changed); - /* UNCHECKED */ MCNameCreateWithCString("selectionChanged", MCM_selection_changed); - /* UNCHECKED */ MCNameCreateWithCString("shell", MCM_shell); - /* UNCHECKED */ MCNameCreateWithCString("signal", MCM_signal); - /* UNCHECKED */ MCNameCreateWithCString("shutDown", MCM_shut_down); - /* UNCHECKED */ MCNameCreateWithCString("shutDownRequest", MCM_shut_down_request); - /* UNCHECKED */ MCNameCreateWithCString("socketError", MCM_socket_error); - /* UNCHECKED */ MCNameCreateWithCString("socketClosed", MCM_socket_closed); - /* UNCHECKED */ MCNameCreateWithCString("socketTimeout", MCM_socket_timeout); - /* UNCHECKED */ MCNameCreateWithCString("startUp", MCM_start_up); - /* UNCHECKED */ MCNameCreateWithCString("suspend", MCM_suspend); - /* UNCHECKED */ MCNameCreateWithCString("suspendStack", MCM_suspend_stack); - /* UNCHECKED */ MCNameCreateWithCString("tabKey", MCM_tab_key); - /* UNCHECKED */ MCNameCreateWithCString("textChanged", MCM_text_changed); - /* UNCHECKED */ MCNameCreateWithCString("trace", MCM_trace); - /* UNCHECKED */ MCNameCreateWithCString("traceBreak", MCM_trace_break); - /* UNCHECKED */ MCNameCreateWithCString("traceDone", MCM_trace_done); - /* UNCHECKED */ MCNameCreateWithCString("traceError", MCM_trace_error); - /* UNCHECKED */ MCNameCreateWithCString("undoChanged", MCM_undo_changed); - /* UNCHECKED */ MCNameCreateWithCString("undoKey", MCM_undo_key); - /* UNCHECKED */ MCNameCreateWithCString("uniconifyStack", MCM_uniconify_stack); - /* UNCHECKED */ MCNameCreateWithCString("unloadURL", MCM_unload_url); - /* UNCHECKED */ MCNameCreateWithCString("updateScreen", MCM_update_screen); - /* UNCHECKED */ MCNameCreateWithCString("updateVariable", MCM_update_var); + { "unhandled", &MCN_unhandled }, + { "handled", &MCN_handled }, + { "passed", &MCN_passed }, + + { "Page Setup Dialog", &MCN_page_setup_dialog }, + { "pagesetup", &MCN_pagesetup }, + { "Print Dialog", &MCN_print_dialog }, + { "printer", &MCN_printer }, + { "Color Chooser", &MCN_color_chooser }, + { "color", &MCN_color }, + { "File Selector", &MCN_file_selector }, + { "file", &MCN_file }, + { "folder", &MCN_folder }, + { "folders", &MCN_folders }, + { "Answer Dialog", &MCN_answer_dialog }, + { "Ask Dialog", &MCN_ask_dialog }, + + { "clear", &MCN_clear }, + { "effect", &MCN_effect }, + { "error", &MCN_error }, + { "information", &MCN_information }, + { "password", &MCN_password }, + { "program", &MCN_program }, + { "question", &MCN_question }, + { "record", &MCN_record }, + { "titled", &MCN_titled }, + { "warning", &MCN_warning }, + + { "Message Box", &MCN_messagename }, + { "msgchanged", &MCM_msgchanged }, + { "HyperCard Import Status", &MCN_hcstat }, + { "appleEvent", &MCM_apple_event }, + { "arrowKey", &MCM_arrow_key }, + { "assertError", &MCM_assert_error }, + { "backspaceKey", &MCM_backspace_key }, + { "closeBackground", &MCM_close_background }, + { "closeCard", &MCM_close_card }, + { "closeControl", &MCM_close_control }, + { "closeField", &MCM_close_field }, + { "closeStack", &MCM_close_stack }, + { "closeStackRequest", &MCM_close_stack_request }, + { "colorChanged", &MCM_color_changed }, + { "commandKeyDown", &MCM_command_key_down }, + { "controlKeyDown", &MCM_control_key_down }, + { "copyKey", &MCM_copy_key }, + { "currentTimeChanged", &MCM_current_time_changed }, + { "cutKey", &MCM_cut_key }, + { "debugStr", &MCM_debug_str }, + { "deleteBackground", &MCM_delete_background }, + { "deleteButton", &MCM_delete_button }, + { "deleteCard", &MCM_delete_card }, + { "deleteEPS", &MCM_delete_eps }, + { "deleteField", &MCM_delete_field }, + { "deleteGraphic", &MCM_delete_graphic }, + { "deleteGroup", &MCM_delete_group }, + { "deleteImage", &MCM_delete_image }, + { "deleteKey", &MCM_delete_key }, + { "deleteScrollbar", &MCM_delete_scrollbar }, + { "deletePlayer", &MCM_delete_player }, + { "deleteStack", &MCM_delete_stack }, + { "deleteWidget", &MCM_delete_widget }, + { "deleteURL", &MCM_delete_url }, + { "desktopChanged", &MCM_desktop_changed }, + { "dragDrop", &MCM_drag_drop }, + { "dragEnd", &MCM_drag_end }, + { "dragEnter", &MCM_drag_enter }, + { "dragLeave", &MCM_drag_leave }, + { "dragMove", &MCM_drag_move }, + { "dragStart", &MCM_drag_start }, + { "editScript", &MCM_edit_script }, + { "enterInField", &MCM_enter_in_field }, + { "enterKey", &MCM_enter_key }, + { "errorDialog", &MCM_error_dialog }, + { "escapeKey", &MCM_escape_key }, + { "eval", &MCM_eval }, + { "exitField", &MCM_exit_field }, + { "focusIn", &MCM_focus_in }, + { "focusOut", &MCM_focus_out }, + { "functionKey", &MCM_function_key }, + { "getCachedURLs", &MCM_get_cached_urls }, + { "getURL", &MCM_get_url }, + { "getURLStatus", &MCM_get_url_status }, + { "gradientEditEnded", &MCM_gradient_edit_ended }, + { "gradientEditStarted", &MCM_gradient_edit_started }, + { "help", &MCM_help }, + { "hotSpotClicked", &MCM_hot_spot_clicked }, + { "iconMenuPick", &MCM_icon_menu_pick }, + { "iconMenuOpening", &MCM_icon_menu_opening }, + { "statusIconMenuPick", &MCM_status_icon_menu_pick }, + { "statusIconMenuOpening", &MCM_status_icon_menu_opening }, + { "statusIconClick", &MCM_status_icon_click }, + { "statusIconDoubleClick", &MCM_status_icon_double_click }, + { "iconifyStack", &MCM_iconify_stack }, + { "idChanged", &MCM_id_changed }, + { "idle", &MCM_idle }, + { "internal", &MCM_internal }, + { "internal2", &MCM_internal2 }, + { "internal3", &MCM_internal3 }, + { "keyDown", &MCM_key_down }, + { "keyUp", &MCM_key_up }, + { "keyboardActivated", &MCM_keyboard_activated }, + { "keyboardDeactivated", &MCM_keyboard_deactivated }, + { "libraryStack", &MCM_library_stack }, + { "linkClicked", &MCM_link_clicked }, + { "loadURL", &MCM_load_url }, + { "mainStackChanged", &MCM_main_stack_changed }, + { "_mainStacksChanged", &MCM_main_stacks_changed }, + { "menuPick", &MCM_menu_pick }, + { "message", &MCM_message }, + { "messageHandled", &MCM_message_handled }, + { "messageNotHandled", &MCM_message_not_handled }, + { "mouseDoubleDown", &MCM_mouse_double_down }, + { "mouseDoubleUp", &MCM_mouse_double_up }, + { "mouseDown", &MCM_mouse_down }, + { "mouseDownInBackdrop", &MCM_mouse_down_in_backdrop }, + { "mouseEnter", &MCM_mouse_enter }, + { "mouseLeave", &MCM_mouse_leave }, + { "mouseMove", &MCM_mouse_move }, + { "mouseRelease", &MCM_mouse_release }, + { "mouseStillDown", &MCM_mouse_still_down }, + { "mouseUp", &MCM_mouse_up }, + { "mouseUpInBackdrop", &MCM_mouse_up_in_backdrop }, + { "mouseWithin", &MCM_mouse_within }, + { "moveControl", &MCM_move_control }, + { "moveStack", &MCM_move_stack }, + { "moveStopped", &MCM_move_stopped }, + { "movieTouched", &MCM_movie_touched }, + { "nameChanged", &MCM_name_changed }, + { "newBackground", &MCM_new_background }, + { "newCard", &MCM_new_card }, + { "newStack", &MCM_new_stack }, + { "newTool", &MCM_new_tool }, + { "nodeChanged", &MCM_node_changed }, + { "objectSelectionEnded", &MCM_object_selection_ended }, + { "objectSelectionStarted", &MCM_object_selection_started }, + { "openBackground", &MCM_open_background }, + { "openCard", &MCM_open_card }, + { "openControl", &MCM_open_control }, + { "openField", &MCM_open_field }, + { "openStack", &MCM_open_stack }, + { "optionKeyDown", &MCM_option_key_down }, + { "pasteKey", &MCM_paste_key }, + { "playPaused", &MCM_play_paused }, + { "playRateChanged", &MCM_play_rate_changed }, + { "playStarted", &MCM_play_started }, + { "playStopped", &MCM_play_stopped }, + { "postURL", &MCM_post_url }, + { "preOpenBackground", &MCM_preopen_background }, + { "preOpenCard", &MCM_preopen_card }, + { "preOpenControl", &MCM_preopen_control }, + { "preOpenStack", &MCM_preopen_stack }, + { "propertyChanged", &MCM_property_changed }, + { "putURL", &MCM_put_url }, + { "QTDebugStr", &MCM_qtdebugstr }, + { "rawKeyDown", &MCM_raw_key_down }, + { "rawKeyUp", &MCM_raw_key_up }, + { "relaunch", &MCM_relaunch }, + { "releaseStack", &MCM_release_stack }, + { "reloadStack", &MCM_reload_stack }, + { "resizeControl", &MCM_resize_control }, + { "resizeControlEnded", &MCM_resize_control_ended }, + { "resizeControlStarted", &MCM_resize_control_started }, + { "resizeStack", &MCM_resize_stack }, + { "resolutionError", &MCM_resolution_error }, + { "resume", &MCM_resume }, + { "resumeStack", &MCM_resume_stack }, + { "returnInField", &MCM_return_in_field }, + { "returnKey", &MCM_return_key }, + { "saveStackRequest", &MCM_save_stack_request }, + { "scriptParsingError", &MCM_script_error }, + { "scriptExecutionError", &MCM_script_execution_error }, + { "scrollbarBeginning", &MCM_scrollbar_beginning }, + { "scrollbarDrag", &MCM_scrollbar_drag }, + { "scrollbarEnd", &MCM_scrollbar_end }, + { "scrollbarLineDec", &MCM_scrollbar_line_dec }, + { "scrollbarLineInc", &MCM_scrollbar_line_inc }, + { "scrollbarPageDec", &MCM_scrollbar_page_dec }, + { "scrollbarPageInc", &MCM_scrollbar_page_inc }, + { "selectedObjectChanged", &MCM_selected_object_changed }, + { "selectionChanged", &MCM_selection_changed }, + { "shell", &MCM_shell }, + { "signal", &MCM_signal }, + { "shutDown", &MCM_shut_down }, + { "shutDownRequest", &MCM_shut_down_request }, + { "socketError", &MCM_socket_error }, + { "socketClosed", &MCM_socket_closed }, + { "socketTimeout", &MCM_socket_timeout }, + { "startUp", &MCM_start_up }, + { "suspend", &MCM_suspend }, + { "suspendStack", &MCM_suspend_stack }, + { "tabKey", &MCM_tab_key }, + { "textChanged", &MCM_text_changed }, + { "trace", &MCM_trace }, + { "traceBreak", &MCM_trace_break }, + { "traceDone", &MCM_trace_done }, + { "traceError", &MCM_trace_error }, + { "undoChanged", &MCM_undo_changed }, + { "undoKey", &MCM_undo_key }, + { "uniconifyStack", &MCM_uniconify_stack }, + { "unloadURL", &MCM_unload_url }, + { "updateScreen", &MCM_update_screen }, + { "updateVariable", &MCM_update_var }, #ifdef FEATURE_PLATFORM_URL - /* UNCHECKED */ MCNameCreateWithCString("urlProgress", MCM_url_progress); + { "urlProgress", &MCM_url_progress }, #endif - - /* UNCHECKED */ MCNameCreateWithCString("deleteAudioclip", MCM_delete_audioclip); - /* UNCHECKED */ MCNameCreateWithCString("deleteVideoclip", MCM_delete_videoclip); - /* UNCHECKED */ MCNameCreateWithCString("newAudioclip", MCM_new_audioclip); - /* UNCHECKED */ MCNameCreateWithCString("newVideoclip", MCM_new_videoclip); + { "deleteAudioclip", &MCM_delete_audioclip }, + { "deleteVideoclip", &MCM_delete_videoclip }, + { "newAudioclip", &MCM_new_audioclip }, + { "newVideoclip", &MCM_new_videoclip }, #ifdef _MOBILE - /* UNCHECKED */ MCNameCreateWithCString("firstname", MCN_firstname); - /* UNCHECKED */ MCNameCreateWithCString("lastname", MCN_lastname); - /* UNCHECKED */ MCNameCreateWithCString("middlename", MCN_middlename); - /* UNCHECKED */ MCNameCreateWithCString("prefix", MCN_prefix); - /* UNCHECKED */ MCNameCreateWithCString("suffix", MCN_suffix); - /* UNCHECKED */ MCNameCreateWithCString("nickname", MCN_nickname); - /* UNCHECKED */ MCNameCreateWithCString("firstnamephonetic", MCN_firstnamephonetic); - /* UNCHECKED */ MCNameCreateWithCString("lastnamephonetic", MCN_lastnamephonetic); - /* UNCHECKED */ MCNameCreateWithCString("middlenamephonetic", MCN_middlenamephonetic); - /* UNCHECKED */ MCNameCreateWithCString("organization", MCN_organization); - /* UNCHECKED */ MCNameCreateWithCString("jobtitle", MCN_jobtitle); - /* UNCHECKED */ MCNameCreateWithCString("department", MCN_department); - /* UNCHECKED */ MCNameCreateWithCString("note", MCN_note); - - /* UNCHECKED */ MCNameCreateWithCString("email", MCN_email); - /* UNCHECKED */ MCNameCreateWithCString("phone", MCN_phone); - /* UNCHECKED */ MCNameCreateWithCString("address", MCN_address); - -// /* UNCHECKED */ MCNameCreateWithCString("home", MCN_home); - /* UNCHECKED */ MCNameCreateWithCString("work", MCN_work); - /* UNCHECKED */ MCNameCreateWithCString("other", MCN_other); - -// /* UNCHECKED */ MCNameCreateWithCString("mobile", MCN_mobile); -// /* UNCHECKED */ MCNameCreateWithCString("iphone", MCN_iphone); - /* UNCHECKED */ MCNameCreateWithCString("main", MCN_main); - /* UNCHECKED */ MCNameCreateWithCString("homefax", MCN_homefax); - /* UNCHECKED */ MCNameCreateWithCString("workfax", MCN_workfax); - /* UNCHECKED */ MCNameCreateWithCString("otherfax", MCN_otherfax); - /* UNCHECKED */ MCNameCreateWithCString("pager", MCN_pager); + { "firstname", &MCN_firstname }, + { "lastname", &MCN_lastname }, + { "middlename", &MCN_middlename }, + { "prefix", &MCN_prefix }, + { "suffix", &MCN_suffix }, + { "nickname", &MCN_nickname }, + { "firstnamephonetic", &MCN_firstnamephonetic }, + { "lastnamephonetic", &MCN_lastnamephonetic }, + { "middlenamephonetic", &MCN_middlenamephonetic }, + { "organization", &MCN_organization }, + { "jobtitle", &MCN_jobtitle }, + { "department", &MCN_department }, + { "note", &MCN_note }, + + { "email", &MCN_email }, + { "phone", &MCN_phone }, + { "address", &MCN_address }, + + { "work", &MCN_work }, + { "other", &MCN_other }, + + { "main", &MCN_main }, + { "homefax", &MCN_homefax }, + { "workfax", &MCN_workfax }, + { "otherfax", &MCN_otherfax }, + { "pager", &MCN_pager }, - /* UNCHECKED */ MCNameCreateWithCString("street", MCN_street); - /* UNCHECKED */ MCNameCreateWithCString("city", MCN_city); - /* UNCHECKED */ MCNameCreateWithCString("state", MCN_state); - /* UNCHECKED */ MCNameCreateWithCString("zip", MCN_zip); - /* UNCHECKED */ MCNameCreateWithCString("country", MCN_country); - /* UNCHECKED */ MCNameCreateWithCString("countrycode", MCN_countrycode); + { "street", &MCN_street }, + { "city", &MCN_city }, + { "state", &MCN_state }, + { "zip", &MCN_zip }, + { "country", &MCN_country }, + { "countrycode", &MCN_countrycode }, - /* UNCHECKED */ MCNameCreateWithCString("touchStart", MCM_touch_start); - /* UNCHECKED */ MCNameCreateWithCString("touchMove", MCM_touch_move); - /* UNCHECKED */ MCNameCreateWithCString("touchEnd", MCM_touch_end); - /* UNCHECKED */ MCNameCreateWithCString("touchRelease", MCM_touch_release); - /* UNCHECKED */ MCNameCreateWithCString("motionStart", MCM_motion_start); - /* UNCHECKED */ MCNameCreateWithCString("motionEnd", MCM_motion_end); - /* UNCHECKED */ MCNameCreateWithCString("motionRelease", MCM_motion_release); - /* UNCHECKED */ MCNameCreateWithCString("accelerationChanged", MCM_acceleration_changed); - /* UNCHECKED */ MCNameCreateWithCString("orientationChanged", MCM_orientation_changed); - /* UNCHECKED */ MCNameCreateWithCString("locationChanged", MCM_location_changed); - /* UNCHECKED */ MCNameCreateWithCString("locationError", MCM_location_error); - /* UNCHECKED */ MCNameCreateWithCString("headingChanged", MCM_heading_changed); - /* UNCHECKED */ MCNameCreateWithCString("headingError", MCM_heading_error); - /* UNCHECKED */ MCNameCreateWithCString("purchaseStateUpdate", MCM_purchase_updated); - /* UNCHECKED */ MCNameCreateWithCString("rotationRateChanged", MCM_rotation_rate_changed); - /* UNCHECKED */ MCNameCreateWithCString("trackingError", MCM_tracking_error); - /* UNCHECKED */ MCNameCreateWithCString("localNotificationReceived", MCM_local_notification_received); - /* UNCHECKED */ MCNameCreateWithCString("pushNotificationReceived", MCM_push_notification_received); - /* UNCHECKED */ MCNameCreateWithCString("pushNotificationRegistered", MCM_push_notification_registered); - /* UNCHECKED */ MCNameCreateWithCString("pushNotificationRegistrationError", MCM_push_notification_registration_error); - /* UNCHECKED */ MCNameCreateWithCString("urlWakeUp", MCM_url_wake_up); - /* UNCHECKED */ MCNameCreateWithCString("launchDataChanged", MCM_launch_data_changed); - /* UNCHECKED */ MCNameCreateWithCString("browserStartedLoading", MCM_browser_started_loading); - /* UNCHECKED */ MCNameCreateWithCString("browserFinishedLoading", MCM_browser_finished_loading); - /* UNCHECKED */ MCNameCreateWithCString("browserLoadFailed", MCM_browser_load_failed); - /* UNCHECKED */ MCNameCreateWithCString("soundFinishedOnChannel", MCM_sound_finished_on_channel); - /* UNCHECKED */ MCNameCreateWithCString("adLoaded", MCM_ad_loaded); - /* UNCHECKED */ MCNameCreateWithCString("adClicked", MCM_ad_clicked); - /* UNCHECKED */ MCNameCreateWithCString("adLoadFailed", MCM_ad_load_failed); - /* UNCHECKED */ MCNameCreateWithCString("adResizeStart", MCM_ad_resize_start); - /* UNCHECKED */ MCNameCreateWithCString("adResizeEnd", MCM_ad_resize_end); - /* UNCHECKED */ MCNameCreateWithCString("adExpandStart", MCM_ad_expand_start); - /* UNCHECKED */ MCNameCreateWithCString("adExpandEnd", MCM_ad_expand_end); - /* UNCHECKED */ MCNameCreateWithCString("scrollerDidScroll", MCM_scroller_did_scroll); - /* UNCHECKED */ MCNameCreateWithCString("scrollerBeginDrag", MCM_scroller_begin_drag); - /* UNCHECKED */ MCNameCreateWithCString("scrollerEndDrag", MCM_scroller_end_drag); - /* UNCHECKED */ MCNameCreateWithCString("playerFinished", MCM_player_finished); - /* UNCHECKED */ MCNameCreateWithCString("playerError", MCM_player_error); - /* UNCHECKED */ MCNameCreateWithCString("playerPropertyAvailable", MCM_player_property_available); - /* UNCHECKED */ MCNameCreateWithCString("inputBeginEditing", MCM_input_begin_editing); - /* UNCHECKED */ MCNameCreateWithCString("inputEndEditing", MCM_input_end_editing); - /* UNCHECKED */ MCNameCreateWithCString("inputReturnKey", MCM_input_return_key); - /* UNCHECKED */ MCNameCreateWithCString("inputTextChanged", MCM_input_text_changed); - /* UNCHECKED */ MCNameCreateWithCString("productDetailsReceived", MCM_product_details_received); - /* UNCHECKED */ MCNameCreateWithCString("productRequestError", MCM_product_request_error); - /* UNCHECKED */ MCNameCreateWithCString("nfcTagReceived", MCM_nfc_tag_received); + { "touchStart", &MCM_touch_start }, + { "touchMove", &MCM_touch_move }, + { "touchEnd", &MCM_touch_end }, + { "touchRelease", &MCM_touch_release }, + { "motionStart", &MCM_motion_start }, + { "motionEnd", &MCM_motion_end }, + { "motionRelease", &MCM_motion_release }, + { "accelerationChanged", &MCM_acceleration_changed }, + { "orientationChanged", &MCM_orientation_changed }, + { "locationChanged", &MCM_location_changed }, + { "locationError", &MCM_location_error }, + { "headingChanged", &MCM_heading_changed }, + { "headingError", &MCM_heading_error }, + { "purchaseStateUpdate", &MCM_purchase_updated }, + { "rotationRateChanged", &MCM_rotation_rate_changed }, + { "trackingError", &MCM_tracking_error }, + { "localNotificationReceived", &MCM_local_notification_received }, + { "pushNotificationReceived", &MCM_push_notification_received }, + { "pushNotificationRegistered", &MCM_push_notification_registered }, + { "pushNotificationRegistrationError", &MCM_push_notification_registration_error }, + { "urlWakeUp", &MCM_url_wake_up }, + { "launchDataChanged", &MCM_launch_data_changed }, + { "browserStartedLoading", &MCM_browser_started_loading }, + { "browserFinishedLoading", &MCM_browser_finished_loading }, + { "browserLoadFailed", &MCM_browser_load_failed }, + { "soundFinishedOnChannel", &MCM_sound_finished_on_channel }, + { "adLoaded", &MCM_ad_loaded }, + { "adClicked", &MCM_ad_clicked }, + { "adLoadFailed", &MCM_ad_load_failed }, + { "adResizeStart", &MCM_ad_resize_start }, + { "adResizeEnd", &MCM_ad_resize_end }, + { "adExpandStart", &MCM_ad_expand_start }, + { "adExpandEnd", &MCM_ad_expand_end }, + { "scrollerDidScroll", &MCM_scroller_did_scroll }, + { "scrollerBeginDrag", &MCM_scroller_begin_drag }, + { "scrollerEndDrag", &MCM_scroller_end_drag }, + { "playerFinished", &MCM_player_finished }, + { "playerError", &MCM_player_error }, + { "playerPropertyAvailable", &MCM_player_property_available }, + { "inputBeginEditing", &MCM_input_begin_editing }, + { "inputEndEditing", &MCM_input_end_editing }, + { "inputReturnKey", &MCM_input_return_key }, + { "inputTextChanged", &MCM_input_text_changed }, + { "productDetailsReceived", &MCM_product_details_received }, + { "productRequestError", &MCM_product_request_error }, + { "nfcTagReceived", &MCM_nfc_tag_received }, #endif #ifdef _IOS_MOBILE - /* UNCHECKED */ MCNameCreateWithCString("browserLoadRequest", MCM_browser_load_request); - /* UNCHECKED */ MCNameCreateWithCString("browserLoadRequested", MCM_browser_load_requested); - /* UNCHECKED */ MCNameCreateWithCString("scrollerBeginDecelerate", MCM_scroller_begin_decelerate); - /* UNCHECKED */ MCNameCreateWithCString("scrollerEndDecelerate", MCM_scroller_end_decelerate); - /* UNCHECKED */ MCNameCreateWithCString("scrollerScrollToTop", MCM_scroller_scroll_to_top); - /* UNCHECKED */ MCNameCreateWithCString("playerProgressChanged", MCM_player_progress_changed); - /* UNCHECKED */ MCNameCreateWithCString("playerEnterFullscreen", MCM_player_enter_fullscreen); - /* UNCHECKED */ MCNameCreateWithCString("playerLeaveFullscreen", MCM_player_leave_fullscreen); - /* UNCHECKED */ MCNameCreateWithCString("playerStateChanged", MCM_player_state_changed); - /* UNCHECKED */ MCNameCreateWithCString("playerMovieChanged", MCM_player_movie_changed); - /* UNCHECKED */ MCNameCreateWithCString("playerStopped", MCM_player_stopped); - /* UNCHECKED */ MCNameCreateWithCString("reachabilityChanged", MCM_reachability_changed); - /* UNCHECKED */ MCNameCreateWithCString("protectedDataDidBecomeAvailable", MCM_protected_data_available); - /* UNCHECKED */ MCNameCreateWithCString("protectedDataWillBecomeUnavailable", MCM_protected_data_unavailable); - - // MW-2013-05-30: [[ RemoteControl ]] Message sent when a remote control event is received. - /* UNCHECKED */ MCNameCreateWithCString("remoteControlReceived", MCM_remote_control_received); + { "browserLoadRequest", &MCM_browser_load_request }, + { "browserLoadRequested", &MCM_browser_load_requested }, + { "scrollerBeginDecelerate", &MCM_scroller_begin_decelerate }, + { "scrollerEndDecelerate", &MCM_scroller_end_decelerate }, + { "scrollerScrollToTop", &MCM_scroller_scroll_to_top }, + { "playerProgressChanged", &MCM_player_progress_changed }, + { "playerEnterFullscreen", &MCM_player_enter_fullscreen }, + { "playerLeaveFullscreen", &MCM_player_leave_fullscreen }, + { "playerStateChanged", &MCM_player_state_changed }, + { "playerMovieChanged", &MCM_player_movie_changed }, + { "playerStopped", &MCM_player_stopped }, + { "reachabilityChanged", &MCM_reachability_changed }, + { "protectedDataDidBecomeAvailable", &MCM_protected_data_available }, + { "protectedDataWillBecomeUnavailable", &MCM_protected_data_unavailable }, + { "remoteControlReceived", &MCM_remote_control_received }, #endif - /* UNCHECKED */ MCNameCreateWithCString("(Default)", MCN_font_default); - /* UNCHECKED */ MCNameCreateWithCString("(Styled Text)", MCN_font_usertext); - /* UNCHECKED */ MCNameCreateWithCString("(Menu)", MCN_font_menutext); - /* UNCHECKED */ MCNameCreateWithCString("(Text)", MCN_font_content); - /* UNCHECKED */ MCNameCreateWithCString("(Message)", MCN_font_message); - /* UNCHECKED */ MCNameCreateWithCString("(Tooltip)", MCN_font_tooltip); - /* UNCHECKED */ MCNameCreateWithCString("(System)", MCN_font_system); + { "(Default)", &MCN_font_default }, + { "(Styled Text)", &MCN_font_usertext }, + { "(Menu)", &MCN_font_menutext }, + { "(Text)", &MCN_font_content }, + { "(Message)", &MCN_font_message }, + { "(Tooltip)", &MCN_font_tooltip }, + { "(System)", &MCN_font_system }, +}; + +void X_initialize_names(void) +{ + for(size_t i = 0; i < sizeof(kInitialNames) / sizeof(kInitialNames[0]); i++) + { + MCNameCreateWithNativeChars((const char_t*)kInitialNames[i].cstring, strlen(kInitialNames[i].cstring), *kInitialNames[i].name_var); + } } void MCU_finalize_names(void) { - MCNameDelete(MCN_msg); - MCNameDelete(MCN_each); - MCNameDelete(MCN_it); - - MCNameDelete(MCN_cancel); - - MCNameDelete(MCN_default_text_font); - MCNameDelete(MCN_platform_string); - MCNameDelete(MCN_version_string); - - MCNameDelete(MCN_metadata); - MCNameDelete(MCN_runs); - MCNameDelete(MCN_style); - - MCNameDelete(MCN_down); - MCNameDelete(MCN_up); - - MCNameDelete(MCN_empty); - MCNameDelete(MCN_files); - MCNameDelete(MCN_image); - MCNameDelete(MCN_objects); - MCNameDelete(MCN_private); - MCNameDelete(MCN_text); -// MCNameDelete(MCN_unicode); - MCNameDelete(MCN_styles); - MCNameDelete(MCN_styledtext); - MCNameDelete(MCN_rtftext); - MCNameDelete(MCN_htmltext); - MCNameDelete(MCN_png); - MCNameDelete(MCN_gif); - MCNameDelete(MCN_jpeg); - MCNameDelete(MCN_win_bitmap); - MCNameDelete(MCN_win_metafile); - MCNameDelete(MCN_win_enh_metafile); - MCNameDelete(MCN_rtf); - MCNameDelete(MCN_html); - - MCNameDelete(MCN_browser); - MCNameDelete(MCN_command_line); - MCNameDelete(MCN_development); - MCNameDelete(MCN_development_cmdline); - MCNameDelete(MCN_helper_application); - MCNameDelete(MCN_installer); - MCNameDelete(MCN_installer_cmdline); - MCNameDelete(MCN_mobile); - MCNameDelete(MCN_player); - MCNameDelete(MCN_server); - MCNameDelete(MCN_standalone_application); - - MCNameDelete(MCN_all); - MCNameDelete(MCN_auto_key); - MCNameDelete(MCN_disk); - MCNameDelete(MCN_activate); - MCNameDelete(MCN_high_level); - MCNameDelete(MCN_system); - - MCNameDelete(MCN_ansi); - MCNameDelete(MCN_arabic); - MCNameDelete(MCN_bulgarian); - MCNameDelete(MCN_chinese); - MCNameDelete(MCN_english); - MCNameDelete(MCN_greek); - MCNameDelete(MCN_hebrew); - MCNameDelete(MCN_japanese); - MCNameDelete(MCN_korean); - MCNameDelete(MCN_lithuanian); - MCNameDelete(MCN_polish); - MCNameDelete(MCN_roman); - MCNameDelete(MCN_russian); - MCNameDelete(MCN_simple_chinese); - MCNameDelete(MCN_thai); - MCNameDelete(MCN_turkish); - MCNameDelete(MCN_ukrainian); - MCNameDelete(MCN_unicode); - MCNameDelete(MCN_utf8); - MCNameDelete(MCN_vietnamese); - MCNameDelete(MCN_w_char); - MCNameDelete(MCN_asterisk_char); - - MCNameDelete(MCN_plain); - MCNameDelete(MCN_bold); - MCNameDelete(MCN_italic); - MCNameDelete(MCN_bold_italic); - - MCNameDelete(MCN_unknown); - MCNameDelete(MCN_x86); - MCNameDelete(MCN_x86_64); - MCNameDelete(MCN_motorola_powerpc); - MCNameDelete(MCN_i386); - MCNameDelete(MCN_arm); - // SN-2015-01-07: [[ iOS-64bit ]] ARM64 added - MCNameDelete(MCN_arm64); - - MCNameDelete(MCN_local_mac); - MCNameDelete(MCN_local_win32); - MCNameDelete(MCN_android); - MCNameDelete(MCN_iphone); - MCNameDelete(MCN_wince); - - MCNameDelete(MCN_mac_os); - MCNameDelete(MCN_win32); - - MCNameDelete(MCN_done); - - MCNameDelete(MCN_staticgray); - MCNameDelete(MCN_grayscale); - MCNameDelete(MCN_staticcolor); - MCNameDelete(MCN_pseudocolor); - MCNameDelete(MCN_truecolor); - MCNameDelete(MCN_directcolor); - - MCNameDelete(MCN_bounds); - MCNameDelete(MCN_pixels); - MCNameDelete(MCN_opaque_pixels); - - MCNameDelete(MCN_desktop); - MCNameDelete(MCN_documents); - MCNameDelete(MCN_engine); - MCNameDelete(MCN_resources); - MCNameDelete(MCN_fonts); - MCNameDelete(MCN_home); - MCNameDelete(MCN_start); -// MCNameDelete(MCN_system); - MCNameDelete(MCN_temporary); - - MCNameDelete(MCN_apple); - MCNameDelete(MCN_control); - MCNameDelete(MCN_extension); - MCNameDelete(MCN_preferences); - - MCNameDelete(MCN_unhandled); - MCNameDelete(MCN_handled); - MCNameDelete(MCN_passed); - - MCNameDelete(MCN_page_setup_dialog); - MCNameDelete(MCN_pagesetup); - MCNameDelete(MCN_print_dialog); - MCNameDelete(MCN_printer); - MCNameDelete(MCN_color_chooser); - MCNameDelete(MCN_color); - MCNameDelete(MCN_file_selector); - MCNameDelete(MCN_file); - //MCNameDelete(MCN_files); - MCNameDelete(MCN_folder); - MCNameDelete(MCN_folders); - MCNameDelete(MCN_answer_dialog); - MCNameDelete(MCN_ask_dialog); - - //MCNameDelete(MCN_plain); - MCNameDelete(MCN_clear); - //MCNameDelete(MCN_color); - MCNameDelete(MCN_effect); - MCNameDelete(MCN_error); - //MCNameDelete(MCN_file); - //MCNameDelete(MCN_folder); - MCNameDelete(MCN_information); - MCNameDelete(MCN_password); - //MCNameDelete(MCN_printer); - MCNameDelete(MCN_program); - MCNameDelete(MCN_question); - MCNameDelete(MCN_record); - MCNameDelete(MCN_titled); - MCNameDelete(MCN_warning); - - MCNameDelete(MCN_messagename); - MCNameDelete(MCM_msgchanged); - MCNameDelete(MCN_hcstat); - - MCNameDelete(MCM_apple_event); - MCNameDelete(MCM_arrow_key); - MCNameDelete(MCM_assert_error); - MCNameDelete(MCM_backspace_key); - MCNameDelete(MCM_close_background); - MCNameDelete(MCM_close_card); - MCNameDelete(MCM_close_control); - MCNameDelete(MCM_close_field); - MCNameDelete(MCM_close_stack); - MCNameDelete(MCM_close_stack_request); - MCNameDelete(MCM_color_changed); - MCNameDelete(MCM_command_key_down); - MCNameDelete(MCM_control_key_down); - MCNameDelete(MCM_copy_key); - MCNameDelete(MCM_current_time_changed); - MCNameDelete(MCM_cut_key); - MCNameDelete(MCM_debug_str); - MCNameDelete(MCM_delete_background); - MCNameDelete(MCM_delete_button); - MCNameDelete(MCM_delete_card); - MCNameDelete(MCM_delete_eps); - MCNameDelete(MCM_delete_field); - MCNameDelete(MCM_delete_graphic); - MCNameDelete(MCM_delete_group); - MCNameDelete(MCM_delete_image); - MCNameDelete(MCM_delete_key); - MCNameDelete(MCM_delete_scrollbar); - MCNameDelete(MCM_delete_player); - MCNameDelete(MCM_delete_stack); - MCNameDelete(MCM_delete_widget); - MCNameDelete(MCM_delete_url); - MCNameDelete(MCM_desktop_changed); - MCNameDelete(MCM_drag_drop); - MCNameDelete(MCM_drag_end); - MCNameDelete(MCM_drag_enter); - MCNameDelete(MCM_drag_leave); - MCNameDelete(MCM_drag_move); - MCNameDelete(MCM_drag_start); - MCNameDelete(MCM_edit_script); - MCNameDelete(MCM_enter_in_field); - MCNameDelete(MCM_enter_key); - MCNameDelete(MCM_error_dialog); - MCNameDelete(MCM_escape_key); - MCNameDelete(MCM_eval); - MCNameDelete(MCM_exit_field); - MCNameDelete(MCM_focus_in); - MCNameDelete(MCM_focus_out); - MCNameDelete(MCM_function_key); - MCNameDelete(MCM_get_cached_urls); - MCNameDelete(MCM_get_url); - MCNameDelete(MCM_get_url_status); - MCNameDelete(MCM_gradient_edit_ended); - MCNameDelete(MCM_gradient_edit_started); - MCNameDelete(MCM_help); - MCNameDelete(MCM_hot_spot_clicked); - MCNameDelete(MCM_icon_menu_pick); - MCNameDelete(MCM_icon_menu_opening); - MCNameDelete(MCM_status_icon_menu_pick); - MCNameDelete(MCM_status_icon_menu_opening); - MCNameDelete(MCM_status_icon_click); - MCNameDelete(MCM_status_icon_double_click); - MCNameDelete(MCM_iconify_stack); - MCNameDelete(MCM_id_changed); - MCNameDelete(MCM_idle); - MCNameDelete(MCM_internal); - MCNameDelete(MCM_internal2); - MCNameDelete(MCM_key_down); - MCNameDelete(MCM_key_up); - MCNameDelete(MCM_keyboard_activated); - MCNameDelete(MCM_keyboard_deactivated); - MCNameDelete(MCM_library_stack); - MCNameDelete(MCM_link_clicked); - MCNameDelete(MCM_load_url); - MCNameDelete(MCM_main_stack_changed); - MCNameDelete(MCM_menu_pick); - MCNameDelete(MCM_message); - MCNameDelete(MCM_message_handled); - MCNameDelete(MCM_message_not_handled); - MCNameDelete(MCM_mouse_double_down); - MCNameDelete(MCM_mouse_double_up); - MCNameDelete(MCM_mouse_down); - MCNameDelete(MCM_mouse_down_in_backdrop); - MCNameDelete(MCM_mouse_enter); - MCNameDelete(MCM_mouse_leave); - MCNameDelete(MCM_mouse_move); - MCNameDelete(MCM_mouse_release); - MCNameDelete(MCM_mouse_still_down); - MCNameDelete(MCM_mouse_up); - MCNameDelete(MCM_mouse_up_in_backdrop); - MCNameDelete(MCM_mouse_within); - MCNameDelete(MCM_move_control); - MCNameDelete(MCM_move_stack); - MCNameDelete(MCM_move_stopped); - MCNameDelete(MCM_movie_touched); - MCNameDelete(MCM_name_changed); - MCNameDelete(MCM_new_background); - MCNameDelete(MCM_new_card); - MCNameDelete(MCM_new_stack); - MCNameDelete(MCM_new_tool); - MCNameDelete(MCM_node_changed); - MCNameDelete(MCM_object_selection_ended); - MCNameDelete(MCM_object_selection_started); - MCNameDelete(MCM_open_background); - MCNameDelete(MCM_open_card); - MCNameDelete(MCM_open_control); - MCNameDelete(MCM_open_field); - MCNameDelete(MCM_open_stack); - MCNameDelete(MCM_option_key_down); - MCNameDelete(MCM_paste_key); - MCNameDelete(MCM_play_paused); - MCNameDelete(MCM_play_rate_changed); - MCNameDelete(MCM_play_started); - MCNameDelete(MCM_play_stopped); - MCNameDelete(MCM_post_url); - MCNameDelete(MCM_preopen_background); - MCNameDelete(MCM_preopen_card); - MCNameDelete(MCM_preopen_control); - MCNameDelete(MCM_preopen_stack); - MCNameDelete(MCM_property_changed); - MCNameDelete(MCM_put_url); - MCNameDelete(MCM_qtdebugstr); - MCNameDelete(MCM_raw_key_down); - MCNameDelete(MCM_raw_key_up); - MCNameDelete(MCM_relaunch); - MCNameDelete(MCM_release_stack); - MCNameDelete(MCM_reload_stack); - MCNameDelete(MCM_resize_control); - MCNameDelete(MCM_resize_control_ended); - MCNameDelete(MCM_resize_control_started); - MCNameDelete(MCM_resize_stack); - MCNameDelete(MCM_resolution_error); - MCNameDelete(MCM_resume); - MCNameDelete(MCM_resume_stack); - MCNameDelete(MCM_return_in_field); - MCNameDelete(MCM_return_key); - MCNameDelete(MCM_save_stack_request); - MCNameDelete(MCM_script_error); - MCNameDelete(MCM_script_execution_error); - MCNameDelete(MCM_scrollbar_beginning); - MCNameDelete(MCM_scrollbar_drag); - MCNameDelete(MCM_scrollbar_end); - MCNameDelete(MCM_scrollbar_line_dec); - MCNameDelete(MCM_scrollbar_line_inc); - MCNameDelete(MCM_scrollbar_page_dec); - MCNameDelete(MCM_scrollbar_page_inc); - MCNameDelete(MCM_selected_object_changed); - MCNameDelete(MCM_selection_changed); - MCNameDelete(MCM_shell); - MCNameDelete(MCM_signal); - MCNameDelete(MCM_shut_down); - MCNameDelete(MCM_shut_down_request); - MCNameDelete(MCM_socket_error); - MCNameDelete(MCM_socket_closed); - MCNameDelete(MCM_socket_timeout); - MCNameDelete(MCM_start_up); - MCNameDelete(MCM_suspend); - MCNameDelete(MCM_suspend_stack); - MCNameDelete(MCM_tab_key); - MCNameDelete(MCM_text_changed); - MCNameDelete(MCM_trace); - MCNameDelete(MCM_trace_break); - MCNameDelete(MCM_trace_done); - MCNameDelete(MCM_trace_error); - MCNameDelete(MCM_undo_changed); - MCNameDelete(MCM_undo_key); - MCNameDelete(MCM_uniconify_stack); - MCNameDelete(MCM_unload_url); - MCNameDelete(MCM_update_screen); - MCNameDelete(MCM_update_var); - -#ifdef FEATURE_PLATFORM_URL - MCNameDelete(MCM_url_progress); -#endif - - MCNameDelete(MCM_delete_audioclip); - MCNameDelete(MCM_delete_videoclip); - MCNameDelete(MCM_new_audioclip); - MCNameDelete(MCM_new_videoclip); - -#ifdef _MOBILE - MCNameDelete(MCN_firstname); - MCNameDelete(MCN_lastname); - MCNameDelete(MCN_middlename); - MCNameDelete(MCN_prefix); - MCNameDelete(MCN_suffix); - MCNameDelete(MCN_nickname); - MCNameDelete(MCN_firstnamephonetic); - MCNameDelete(MCN_lastnamephonetic); - MCNameDelete(MCN_middlenamephonetic); - MCNameDelete(MCN_organization); - MCNameDelete(MCN_jobtitle); - MCNameDelete(MCN_department); - MCNameDelete(MCN_note); - - MCNameDelete(MCN_email); - MCNameDelete(MCN_phone); - MCNameDelete(MCN_address); - -// MCNameDelete(MCN_home); - MCNameDelete(MCN_work); - MCNameDelete(MCN_other); -// MCNameDelete(MCN_mobile); -// MCNameDelete(MCN_iphone); - MCNameDelete(MCN_main); - MCNameDelete(MCN_homefax); - MCNameDelete(MCN_workfax); - MCNameDelete(MCN_otherfax); - MCNameDelete(MCN_pager); - - MCNameDelete(MCN_street); - MCNameDelete(MCN_city); - MCNameDelete(MCN_state); - MCNameDelete(MCN_zip); - MCNameDelete(MCN_country); - MCNameDelete(MCN_countrycode); - - MCNameDelete(MCM_touch_start); - MCNameDelete(MCM_touch_move); - MCNameDelete(MCM_touch_end); - MCNameDelete(MCM_touch_release); - MCNameDelete(MCM_motion_start); - MCNameDelete(MCM_motion_end); - MCNameDelete(MCM_motion_release); - MCNameDelete(MCM_acceleration_changed); - MCNameDelete(MCM_orientation_changed); - MCNameDelete(MCM_location_changed); - MCNameDelete(MCM_location_error); - MCNameDelete(MCM_heading_changed); - MCNameDelete(MCM_heading_error); - MCNameDelete(MCM_purchase_updated); - MCNameDelete(MCM_rotation_rate_changed); - MCNameDelete(MCM_tracking_error); - MCNameDelete(MCM_local_notification_received); - MCNameDelete(MCM_push_notification_received); - MCNameDelete(MCM_push_notification_registered); - MCNameDelete(MCM_push_notification_registration_error); - MCNameDelete(MCM_url_wake_up); - MCNameDelete(MCM_launch_data_changed); - MCNameDelete(MCM_browser_started_loading); - MCNameDelete(MCM_browser_finished_loading); - MCNameDelete(MCM_browser_load_failed); - MCNameDelete(MCM_sound_finished_on_channel); - MCNameDelete(MCM_ad_loaded); - MCNameDelete(MCM_ad_clicked); - MCNameDelete(MCM_ad_resize_start); - MCNameDelete(MCM_ad_resize_end); - MCNameDelete(MCM_ad_expand_start); - MCNameDelete(MCM_ad_expand_end); - MCNameDelete(MCM_scroller_did_scroll); - MCNameDelete(MCM_scroller_begin_drag); - MCNameDelete(MCM_scroller_end_drag); - MCNameDelete(MCM_player_finished); - MCNameDelete(MCM_player_error); - MCNameDelete(MCM_player_property_available); - MCNameDelete(MCM_input_begin_editing); - MCNameDelete(MCM_input_end_editing); - MCNameDelete(MCM_input_return_key); - MCNameDelete(MCM_input_text_changed); - MCNameDelete(MCM_nfc_tag_received); -#endif - -#ifdef _IOS_MOBILE - MCNameDelete(MCM_browser_load_request); - MCNameDelete(MCM_browser_load_requested); - MCNameDelete(MCM_scroller_begin_decelerate); - MCNameDelete(MCM_scroller_end_decelerate); - MCNameDelete(MCM_scroller_scroll_to_top); - MCNameDelete(MCM_player_progress_changed); - MCNameDelete(MCM_player_enter_fullscreen); - MCNameDelete(MCM_player_leave_fullscreen); - MCNameDelete(MCM_player_state_changed); - MCNameDelete(MCM_player_movie_changed); - MCNameDelete(MCM_player_stopped); - MCNameDelete(MCM_reachability_changed); -#endif - - MCNameDelete(MCN_font_default); - MCNameDelete(MCN_font_usertext); - MCNameDelete(MCN_font_menutext); - MCNameDelete(MCN_font_content); - MCNameDelete(MCN_font_message); - MCNameDelete(MCN_font_tooltip); - MCNameDelete(MCN_font_system); + for(size_t i = 0; i < sizeof(kInitialNames) / sizeof(kInitialNames[0]); i++) + { + MCValueRelease(*kInitialNames[i].name_var); + } } diff --git a/engine/src/mode_development.cpp b/engine/src/mode_development.cpp index 021ea0c055c..a0548421c7c 100755 --- a/engine/src/mode_development.cpp +++ b/engine/src/mode_development.cpp @@ -425,14 +425,11 @@ void MCStack::mode_load(void) // a custom property 'ideOverride' with value true. if (props != NULL) { - MCAutoNameRef t_ide_override_name; - /* UNCHECKED */ t_ide_override_name . CreateWithCString("ideOverride"); - bool t_old_lock = MClockmessages; MClockmessages = true; MCExecValue t_value; MCExecContext ctxt(nil, nil, nil); - getcustomprop(ctxt, kMCEmptyName, t_ide_override_name, nil, t_value); + getcustomprop(ctxt, kMCEmptyName, MCNAME("ideOverride"), nil, t_value); MClockmessages = t_old_lock; bool t_treat_as_ide; diff --git a/engine/src/mode_installer.cpp b/engine/src/mode_installer.cpp index 32153624feb..a609245d574 100644 --- a/engine/src/mode_installer.cpp +++ b/engine/src/mode_installer.cpp @@ -675,9 +675,7 @@ class MCInternalPayloadExtract: public MCStatement p2 . setn_argument(p_data_offset + p_data_length); p3 . setn_argument(p_data_total); - MCAutoNameRef t_message_name; - /* UNCHECKED */ t_message_name . CreateWithCString("payloadProgress"); - context->target->message(t_message_name, &p1); + context->target->message(MCNAME("payloadProgress"), &p1); } return true; diff --git a/engine/src/object.cpp b/engine/src/object.cpp index 8d56f19963c..b1ea95e30f7 100644 --- a/engine/src/object.cpp +++ b/engine/src/object.cpp @@ -346,7 +346,7 @@ const char *MCObject::gettypestring() // Object names are always compared effectively. bool MCObject::hasname(MCNameRef p_other_name) { - return MCNameIsEqualTo(getname(), p_other_name, kMCCompareCaseless); + return MCNameIsEqualToCaseless(getname(), p_other_name); } void MCObject::setname(MCNameRef p_new_name) @@ -357,7 +357,7 @@ void MCObject::setname(MCNameRef p_new_name) void MCObject::setname_cstring(const char *p_new_name) { MCNewAutoNameRef t_name; - /* UNCHECKED */ MCNameCreateWithCString(p_new_name, &t_name); + /* UNCHECKED */ MCNameCreateWithNativeChars((const char_t*)p_new_name, strlen(p_new_name), &t_name); setname(*t_name); } @@ -783,7 +783,7 @@ Boolean MCObject::doubleup(uint2 which) void MCObject::timer(MCNameRef mptr, MCParameter *params) { - if (MCNameIsEqualTo(mptr, MCM_idle, kMCCompareCaseless)) + if (MCNameIsEqualToCaseless(mptr, MCM_idle)) { if (opened && hashandlers & HH_IDLE && getstack()->gettool(this) == T_BROWSE) @@ -820,7 +820,7 @@ void MCObject::timer(MCNameRef mptr, MCParameter *params) domess(*t_mptr_string); } - if (stat == ES_ERROR && !MCNameIsEqualTo(mptr, MCM_error_dialog, kMCCompareCaseless)) + if (stat == ES_ERROR && !MCNameIsEqualToCaseless(mptr, MCM_error_dialog)) senderror(); } } @@ -2122,10 +2122,6 @@ Exec_stat MCObject::message(MCNameRef mess, MCParameter *paramptr, Boolean chang if (MClockmessages || MCexitall || state & CS_NO_MESSAGES || !parent || (flags & F_DISABLED && t_stack->gettool(this) == T_BROWSE && !send && !p_is_debug_message)) return ES_NOT_HANDLED; - // AL-2013-01-14: [[ Bug 11343 ]] Moved check and time addition to MCCard::mdown methods. - //if (MCNameIsEqualTo(mess, MCM_mouse_down, kMCCompareCaseless) && hashandlers & HH_MOUSE_STILL_DOWN) - // MCscreen->addtimer(this, MCM_idle, MCidleRate); - MCscreen->flush(t_stack->getw()); // Object's cannot be deleted whilst they are executing script. However, @@ -4063,7 +4059,7 @@ IO_stat MCObject::extendedload(MCObjectInputStream& p_stream, uint32_t version, s_loaded_parent_script_reference = true; } - MCNameDelete(t_stack); + MCValueRelease(t_stack); } if (t_stat == IO_NORMAL && (t_flags & OBJECT_EXTRA_BITMAPEFFECTS) != 0) @@ -4769,7 +4765,7 @@ bool MCObject::mapfont(bool recursive) // If the font is explicitly requesting the default font for this // control type, use the themed font - if (MCNameIsEqualTo(t_textfont, MCN_font_default)) + if (MCNameIsEqualToCaseless(t_textfont, MCN_font_default)) { // Don't inherit the parent's themed font if (recursive) @@ -4889,7 +4885,7 @@ void MCObject::copyfontattrs(const MCObject& p_other) /* UNCHECKED */ MCMemoryNew(m_font_attrs); if ((m_font_flags & FF_HAS_TEXTFONT) != 0) - MCNameClone(p_other . m_font_attrs -> name, m_font_attrs -> name); + m_font_attrs -> name = MCValueRetain(m_font_attrs -> name); if ((m_font_flags & FF_HAS_TEXTSIZE) != 0) m_font_attrs -> size = p_other . m_font_attrs -> size; if ((m_font_flags & FF_HAS_TEXTSTYLE) != 0) @@ -4902,7 +4898,7 @@ void MCObject::clearfontattrs(void) if (m_font_attrs == nil) return; - MCNameDelete(m_font_attrs -> name); + MCValueRelease(m_font_attrs -> name); MCMemoryDelete(m_font_attrs); /* Allocated with MCMemoryNew() */ m_font_attrs = nil; @@ -4959,7 +4955,7 @@ void MCObject::setfontattrs(uint32_t p_which, MCNameRef p_textfont, uint2 p_text if (p_which == 0) { if (m_font_attrs != nil) - MCNameDelete(m_font_attrs -> name); + MCValueRelease(m_font_attrs -> name); delete m_font_attrs; m_font_attrs = nil; m_font_flags &= ~FF_HAS_ALL_FATTR; @@ -4971,10 +4967,10 @@ void MCObject::setfontattrs(uint32_t p_which, MCNameRef p_textfont, uint2 p_text if ((p_which & FF_HAS_TEXTFONT) != 0) { - MCNameDelete(m_font_attrs -> name); + MCValueRelease(m_font_attrs -> name); if (p_textfont != nil && !MCNameIsEmpty(p_textfont)) { - /* UNCHECKED */ MCNameClone(p_textfont, m_font_attrs -> name); + m_font_attrs -> name = MCValueRetain(p_textfont); m_font_flags |= FF_HAS_TEXTFONT; } else @@ -5017,9 +5013,9 @@ void MCObject::setfontattrs(uint32_t p_which, MCNameRef p_textfont, uint2 p_text // using a c-string for the name. void MCObject::setfontattrs(MCStringRef p_textfont, uint2 p_textsize, uint2 p_textstyle) { - MCAutoNameRef t_textfont_name; - /* UNCHECKED */ MCNameCreate(p_textfont, t_textfont_name); - setfontattrs(FF_HAS_ALL_FATTR, t_textfont_name, p_textsize, p_textstyle); + MCNewAutoNameRef t_textfont_name; + /* UNCHECKED */ MCNameCreate(p_textfont, &t_textfont_name); + setfontattrs(FF_HAS_ALL_FATTR, *t_textfont_name, p_textsize, p_textstyle); } // MW-2012-02-19: [[ SplitTextAttrs ]] This method returns true if any of the font diff --git a/engine/src/objectpropsets.cpp b/engine/src/objectpropsets.cpp index cadc0fcbb45..c87b3823119 100644 --- a/engine/src/objectpropsets.cpp +++ b/engine/src/objectpropsets.cpp @@ -64,14 +64,12 @@ bool MCObjectPropertySet::createwithname_nocopy(MCNameRef p_name, MCObjectProper bool MCObjectPropertySet::createwithname(MCNameRef p_name, MCObjectPropertySet*& r_set) { - MCNameRef t_new_name; - if (!MCNameClone(p_name, t_new_name)) - return false; + MCNameRef t_new_name = MCValueRetain(p_name); MCObjectPropertySet *t_new_set; if (!createwithname_nocopy(t_new_name, t_new_set)) { - MCNameDelete(t_new_name); + MCValueRelease(t_new_name); return false; } diff --git a/engine/src/objectpropsets.h b/engine/src/objectpropsets.h index 4e23ea45a74..69f11ac8874 100644 --- a/engine/src/objectpropsets.h +++ b/engine/src/objectpropsets.h @@ -30,7 +30,7 @@ class MCObjectPropertySet bool hasname(MCNameRef p_name) const { return m_name.IsSet() && - MCNameIsEqualTo(*m_name, p_name, kMCCompareCaseless); + MCNameIsEqualToCaseless(*m_name, p_name); } MCNameRef getname(void) const diff --git a/engine/src/opensslsocket.cpp b/engine/src/opensslsocket.cpp index d58da107469..f894e4b32c0 100644 --- a/engine/src/opensslsocket.cpp +++ b/engine/src/opensslsocket.cpp @@ -593,7 +593,7 @@ bool MCS_ntoa(MCStringRef p_hostname, MCObject *p_target, MCNameRef p_message, M MCAutoPointer t_host_cstring; /* UNCHECKED */ MCStringConvertToCString(*t_host, &t_host_cstring); - if (MCNameIsEqualTo(p_message, kMCEmptyName)) + if (MCNameIsEqualToCaseless(p_message, kMCEmptyName)) { t_success = MCSocketHostNameResolve(*t_host_cstring, NULL, SOCK_STREAM, true, ntoa_callback, *t_list); } @@ -909,9 +909,7 @@ MCDataRef MCS_read_socket(MCSocket *s, MCExecContext &ctxt, uint4 length, const if (s->datagram) { - MCNameDelete(s->message); - /* UNCHECKED */ MCNameClone(mptr, s -> message); - + MCValueAssign(s->message, mptr); s->object = ctxt . GetObject(); } else @@ -1385,14 +1383,14 @@ MCSocketread::MCSocketread(uint4 s, char *u, MCObject *o, MCNameRef m) timeout = curtime + MCsockettimeout; optr = o; if (m != nil) - /* UNCHECKED */ MCNameClone(m, message); - else + message = MCValueRetain(m); + else message = nil; } MCSocketread::~MCSocketread() { - MCNameDelete(message); + MCValueRelease(message); delete until; } @@ -1408,7 +1406,7 @@ MCSocketwrite::MCSocketwrite(MCStringRef d, MCObject *o, MCNameRef m, Boolean se optr = o; done = 0; if (m != nil) - /* UNCHECKED */ MCNameClone(m, message); + message = MCValueRetain(m); else message = nil; } @@ -1417,7 +1415,7 @@ MCSocketwrite::~MCSocketwrite() { if (message != NULL) { - MCNameDelete(message); + MCValueRelease(message); delete buffer; } } @@ -1430,7 +1428,7 @@ MCSocket::MCSocket(MCNameRef n, MCNameRef f, MCObject *o, MCNameRef m, Boolean d name = MCValueRetain(n); object = o; if (m != nil) - /* UNCHECKED */ MCNameClone(m, message); + message = MCValueRetain(m); else message = nil; datagram = d; @@ -1458,8 +1456,8 @@ MCSocket::MCSocket(MCNameRef n, MCNameRef f, MCObject *o, MCNameRef m, Boolean d MCSocket::~MCSocket() { - MCNameDelete(name); - MCNameDelete(message); + MCValueRelease(name); + MCValueRelease(message); deletereads(); deletewrites(); @@ -1822,7 +1820,7 @@ void MCSocket::writesome() #endif MCscreen->delaymessage(object, message, MCNameGetString(name)); added = True; - MCNameDelete(message); + MCValueRelease(message); message = NULL; } diff --git a/engine/src/osxflst.cpp b/engine/src/osxflst.cpp index bead6ce7dce..04347871327 100644 --- a/engine/src/osxflst.cpp +++ b/engine/src/osxflst.cpp @@ -126,7 +126,7 @@ void MCFontnode::calculatemetrics() MCFontnode::~MCFontnode() { - MCNameDelete(reqname); + MCValueRelease(reqname); // Don't delete the fontstruct for system fonts (it is still cached elsewhere) if ((reqstyle & FA_SYSTEM_FONT) == 0) @@ -141,7 +141,7 @@ MCFontStruct *MCFontnode::getfont(MCNameRef fname, uint2 size, uint2 style) { if (reqstyle & FA_SYSTEM_FONT) return NULL; - if (!MCNameIsEqualTo(fname, reqname)) + if (!MCNameIsEqualToCaseless(fname, reqname)) return NULL; if (size == 0) return font; diff --git a/engine/src/parentscript.cpp b/engine/src/parentscript.cpp index 2dd2311cce1..202f42799e8 100644 --- a/engine/src/parentscript.cpp +++ b/engine/src/parentscript.cpp @@ -329,7 +329,7 @@ MCParentScript::MCParentScript(void) MCParentScript::~MCParentScript(void) { - MCNameDelete(m_object_stack); + MCValueRelease(m_object_stack); } //// @@ -468,7 +468,7 @@ MCParentScriptUse *MCParentScript::Acquire(MCObject *p_referrer, uint32_t p_id, for(t_parent = s_table[t_index]; t_parent != NULL; t_parent = t_parent -> m_chain) if (t_parent -> m_hash == t_hash && t_parent -> m_object_id == p_id && - MCNameIsEqualTo(t_parent -> m_object_stack, p_stack, kMCCompareCaseless)) + MCNameIsEqualToCaseless(t_parent -> m_object_stack, p_stack)) break; // At this point we start a success variable since we are about to have to @@ -487,12 +487,9 @@ MCParentScriptUse *MCParentScript::Acquire(MCObject *p_referrer, uint32_t p_id, if (t_parent == NULL) t_success = false; - // Clone the stack string - if (t_success) - t_success = MCNameClone(p_stack, t_parent -> m_object_stack); - if (t_success) { + t_parent->m_object_stack = MCValueRetain(p_stack); t_parent -> m_hash = t_hash; t_parent -> m_object_id = p_id; } diff --git a/engine/src/player-legacy.cpp b/engine/src/player-legacy.cpp index 237281e491c..647f8f0e961 100755 --- a/engine/src/player-legacy.cpp +++ b/engine/src/player-legacy.cpp @@ -304,7 +304,7 @@ void MCPlayer::applyrect(const MCRectangle &nrect) void MCPlayer::timer(MCNameRef mptr, MCParameter *params) { - if (MCNameIsEqualTo(mptr, MCM_play_stopped, kMCCompareCaseless)) + if (MCNameIsEqualToCaseless(mptr, MCM_play_stopped)) { state |= CS_PAUSED; if (isbuffering()) //so the last frame gets to be drawn @@ -318,7 +318,7 @@ void MCPlayer::timer(MCNameRef mptr, MCParameter *params) return; //obj is already deleted, do not pass msg up. } } - else if (MCNameIsEqualTo(mptr, MCM_play_paused, kMCCompareCaseless)) + else if (MCNameIsEqualToCaseless(mptr, MCM_play_paused)) { state |= CS_PAUSED; if (isbuffering()) //so the last frame gets to be drawn diff --git a/engine/src/player-platform.cpp b/engine/src/player-platform.cpp index 1eafe076046..58d299b7776 100644 --- a/engine/src/player-platform.cpp +++ b/engine/src/player-platform.cpp @@ -1079,12 +1079,12 @@ MCRectangle MCPlayer::GetNativeViewRect(const MCRectangle &p_object_rect) void MCPlayer::timer(MCNameRef mptr, MCParameter *params) { - if (MCNameIsEqualTo(mptr, MCM_play_started, kMCCompareCaseless)) + if (MCNameIsEqualToCaseless(mptr, MCM_play_started)) { state &= ~CS_PAUSED; redrawcontroller(); } - else if (MCNameIsEqualTo(mptr, MCM_play_stopped, kMCCompareCaseless)) + else if (MCNameIsEqualToCaseless(mptr, MCM_play_stopped)) { state |= CS_PAUSED; redrawcontroller(); @@ -1097,14 +1097,14 @@ void MCPlayer::timer(MCNameRef mptr, MCParameter *params) return; //obj is already deleted, do not pass msg up. } } - else if (MCNameIsEqualTo(mptr, MCM_play_paused, kMCCompareCaseless)) + else if (MCNameIsEqualToCaseless(mptr, MCM_play_paused)) { state |= CS_PAUSED; redrawcontroller(); m_modify_selection_while_playing = false; } - else if (MCNameIsEqualTo(mptr, MCM_current_time_changed, kMCCompareCaseless)) + else if (MCNameIsEqualToCaseless(mptr, MCM_current_time_changed)) { // If params is nil then this did not originate from the player! if (params != nil) @@ -1115,7 +1115,7 @@ void MCPlayer::timer(MCNameRef mptr, MCParameter *params) params -> setn_argument(getmoviecurtime()); } } - else if (MCNameIsEqualTo(mptr, MCM_internal, kMCCompareCaseless)) + else if (MCNameIsEqualToCaseless(mptr, MCM_internal)) { handle_mstilldown(Button1); MCscreen -> addtimer(this, MCM_internal, MCblinkrate); @@ -2159,8 +2159,8 @@ void MCPlayer::SynchronizeUserCallbacks(void) // Free the existing callback table. for(uindex_t i = 0; i < m_callback_count; i++) { - MCNameDelete(m_callbacks[i] . message); - MCNameDelete(m_callbacks[i] . parameter); + MCValueRelease(m_callbacks[i] . message); + MCValueRelease(m_callbacks[i] . parameter); } MCMemoryDeleteArray(m_callbacks); m_callbacks = nil; diff --git a/engine/src/player-srv-stubs.cpp b/engine/src/player-srv-stubs.cpp index 8697b989f4c..2478e732907 100644 --- a/engine/src/player-srv-stubs.cpp +++ b/engine/src/player-srv-stubs.cpp @@ -256,7 +256,7 @@ void MCPlayer::applyrect(const MCRectangle &nrect) void MCPlayer::timer(MCNameRef mptr, MCParameter *params) { - if (MCNameIsEqualTo(mptr, MCM_play_stopped, kMCCompareCaseless)) + if (MCNameIsEqualToCaseless(mptr, MCM_play_stopped)) { state |= CS_PAUSED; if (isbuffering()) //so the last frame gets to be drawn @@ -270,7 +270,7 @@ void MCPlayer::timer(MCNameRef mptr, MCParameter *params) return; //obj is already deleted, do not pass msg up. } } - else if (MCNameIsEqualTo(mptr, MCM_play_paused, kMCCompareCaseless)) + else if (MCNameIsEqualToCaseless(mptr, MCM_play_paused)) { state |= CS_PAUSED; if (isbuffering()) //so the last frame gets to be drawn diff --git a/engine/src/property.cpp b/engine/src/property.cpp index bdc7e4aad8b..14a98c70dd6 100644 --- a/engine/src/property.cpp +++ b/engine/src/property.cpp @@ -450,7 +450,10 @@ bool lookup_property_override_name(uint16_t p_property, MCNameRef &r_name) { for (uint32_t i = 0; i < property_overrides_size; i++) if (property_overrides[i].property == p_property) - return MCNameCreateWithCString(property_overrides[i].lt.token, r_name); + { + r_name = MCNAME(property_overrides[i].lt.token); + return true; + } return false; } @@ -513,7 +516,7 @@ Parse_stat MCProperty::parse(MCScriptPoint &sp, Boolean the) else { which = P_CUSTOM; - /* UNCHECKED */ MCNameClone(sp . gettoken_nameref(), &customprop); + customprop = sp . gettoken_nameref(); if (sp.next(type) == PS_NORMAL && type == ST_LB) { if (sp.parseexp(False, True, &(&customindex)) != PS_NORMAL @@ -1181,8 +1184,7 @@ bool MCProperty::resolveprop(MCExecContext& ctxt, Properties& r_which, MCNameRef // simplify code. if (which == P_CUSTOM) { - if (!MCNameClone(*customprop, t_prop_name)) - return false; + t_prop_name = MCValueRetain(*customprop); } // At present, something like the 'pVar[pIndex] of me' is evaluated as 'the pVar of me' diff --git a/engine/src/rtf.cpp b/engine/src/rtf.cpp index d10dbf1551c..722d8e5688a 100644 --- a/engine/src/rtf.cpp +++ b/engine/src/rtf.cpp @@ -216,7 +216,7 @@ RTFReader::RTFReader(void) RTFReader::~RTFReader(void) { - MCNameDelete(m_attributes . text_link); + MCValueRelease(m_attributes . text_link); MCValueRelease(m_attributes . text_metadata); if (m_font_name != NULL) @@ -1192,7 +1192,8 @@ void RTFReader::ProcessField(void) if (t_type != nil && t_data != nil) { MCNameRef t_name; - /* UNCHECKED */ MCNameCreateWithCString(t_data, t_name); + /* UNCHECKED */ MCNameCreateWithNativeChars((const char_t *)t_data, strlen(t_data), t_name); + MCAutoStringRef t_string; /* UNCHECKED */ MCStringCreateWithCString(t_data, &t_string); if (MCU_strcasecmp(t_type, "HYPERLINK") == 0) @@ -1212,7 +1213,7 @@ void RTFReader::ProcessField(void) { m_state . SetParagraphMetadata(*t_string); } - MCNameDelete(t_name); + MCValueRelease(t_name); } free(m_field_inst); @@ -1589,7 +1590,7 @@ RTFStatus RTFReader::Flush(bool p_force) t_block . text_shift = 0; if (m_state . GetHyperlink() != kMCEmptyName) - MCNameClone(m_state . GetHyperlink(), t_block . text_link); + t_block.text_link = MCValueRetain(m_state . GetHyperlink()); else t_block . text_link = nil; @@ -1639,7 +1640,7 @@ RTFStatus RTFReader::Flush(bool p_force) if (t_changed) { MCValueRelease(m_attributes . text_metadata); - MCNameDelete(m_attributes . text_link); + MCValueRelease(m_attributes . text_link); memcpy(&m_attributes, &t_block, sizeof(MCTextBlock)); m_attributes_changed = false; } diff --git a/engine/src/rtf.h b/engine/src/rtf.h index 71e0ed3f741..7434a25144b 100644 --- a/engine/src/rtf.h +++ b/engine/src/rtf.h @@ -656,7 +656,7 @@ inline void RTFState::SetHyperlink(MCNameRef p_hyperlink) { if (m_entries == NULL) return; - MCNameClone(p_hyperlink, m_entries -> hyperlink); + m_entries->hyperlink = MCValueRetain(p_hyperlink); } inline MCNameRef RTFState::GetHyperlink(void) diff --git a/engine/src/rtfsupport.cpp b/engine/src/rtfsupport.cpp index a3a80c27688..d873d08c516 100644 --- a/engine/src/rtfsupport.cpp +++ b/engine/src/rtfsupport.cpp @@ -80,7 +80,7 @@ RTFStatus RTFState::Save(void) /* UNCHECKED */ MCStringCopy(m_entries -> metadata, t_new_entry -> metadata); /* UNCHECKED */ MCStringCopy(m_entries -> paragraph_metadata, t_new_entry -> paragraph_metadata); - MCNameClone(m_entries -> hyperlink, t_new_entry -> hyperlink); + t_new_entry->hyperlink = MCValueRetain(m_entries -> hyperlink); } else { @@ -110,7 +110,7 @@ RTFStatus RTFState::Save(void) t_new_entry -> metadata = MCValueRetain(kMCEmptyString); t_new_entry -> paragraph_metadata = MCValueRetain(kMCEmptyString); - MCNameClone(kMCEmptyName, t_new_entry -> hyperlink); + t_new_entry -> hyperlink = MCValueRetain(kMCEmptyName); } m_entries = t_new_entry; @@ -138,7 +138,7 @@ RTFStatus RTFState::Restore(void) MCValueRelease(t_entry -> metadata); MCValueRelease(t_entry -> paragraph_metadata); - MCNameDelete(t_entry -> hyperlink); + MCValueRelease(t_entry -> hyperlink); delete t_entry; } diff --git a/engine/src/scriptpt.cpp b/engine/src/scriptpt.cpp index 4c0fdecdcfc..ad0ac44c0c7 100644 --- a/engine/src/scriptpt.cpp +++ b/engine/src/scriptpt.cpp @@ -275,7 +275,7 @@ MCNameRef MCScriptPoint::gettoken_nameref(void) { MCAutoStringRef t_string_token; if (token_nameref != nil) - MCNameDelete(token_nameref); + MCValueRelease(token_nameref); /* UNCHECKED */ MCStringCreateWithBytes((const byte_t *)token . getstring(), (token . getlength() * 2), kMCStringEncodingUTF16, false, &t_string_token); /* UNCHECKED */ MCNameCreate(*t_string_token, token_nameref); } @@ -1801,8 +1801,7 @@ Parse_stat MCScriptPoint::parseexp(Boolean single, Boolean items, MCVarref *newvar; newfact = NULL; - MCAutoNameRef t_name; - /* UNCHECKED */ t_name . Clone(gettoken_nameref()); + MCNewAutoNameRef t_name = gettoken_nameref(); if (next(type) == PS_NORMAL) backup(); @@ -1810,7 +1809,7 @@ Parse_stat MCScriptPoint::parseexp(Boolean single, Boolean items, type = ST_ERR; // MW-2011-06-22: [[ SERVER ]] Update to use SP findvar method to take into account // execution outwith a handler. - if (type != ST_LP && findvar(t_name, &newvar) == PS_NORMAL) + if (type != ST_LP && findvar(*t_name, &newvar) == PS_NORMAL) { newvar->parsearray(*this); newfact = newvar; @@ -1819,7 +1818,7 @@ Parse_stat MCScriptPoint::parseexp(Boolean single, Boolean items, { // MW-2011-06-22: [[ SERVER ]] Update to use SP findvar method to take into account // execution outwith a handler. - if (findnewvar(t_name, kMCEmptyName, &newvar) != PS_NORMAL) + if (findnewvar(*t_name, kMCEmptyName, &newvar) != PS_NORMAL) { MCperror->add(PE_EXPRESSION_NOTFACT, *this); return PS_ERROR; @@ -1828,7 +1827,7 @@ Parse_stat MCScriptPoint::parseexp(Boolean single, Boolean items, newfact = newvar; } else if (type == ST_LP) - newfact = new (nothrow) MCFuncref(t_name); + newfact = new (nothrow) MCFuncref(*t_name); if (newfact == NULL) { if (MCexplicitvariables) @@ -1840,7 +1839,7 @@ Parse_stat MCScriptPoint::parseexp(Boolean single, Boolean items, { // MW-2011-06-22: [[ SERVER ]] Update to use SP findvar method to take into account // execution outwith a handler. - if (finduqlvar(t_name, &newvar) != PS_NORMAL) + if (finduqlvar(*t_name, &newvar) != PS_NORMAL) { MCperror->add(PE_EXPRESSION_NOTFACT, *this); return PS_ERROR; diff --git a/engine/src/scrolbar.cpp b/engine/src/scrolbar.cpp index b6f732772fd..aacf9710c4f 100644 --- a/engine/src/scrolbar.cpp +++ b/engine/src/scrolbar.cpp @@ -602,8 +602,8 @@ void MCScrollbar::applyrect(const MCRectangle &nrect) void MCScrollbar::timer(MCNameRef mptr, MCParameter *params) { - if (MCNameIsEqualTo(mptr, MCM_internal, kMCCompareCaseless) || - MCNameIsEqualTo(mptr, MCM_internal2, kMCCompareCaseless)) + if (MCNameIsEqualToCaseless(mptr, MCM_internal) || + MCNameIsEqualToCaseless(mptr, MCM_internal2)) { // MW-2009-06-16: [[ Bug ]] Previously this was only waiting for one // one event (anyevent == True) this meant that it was possible for @@ -625,7 +625,7 @@ void MCScrollbar::timer(MCNameRef mptr, MCParameter *params) if (mode != SM_CLEARED) { - uint2 delay = MCNameIsEqualTo(mptr, MCM_internal, kMCCompareCaseless) ? MCrepeatdelay : MCrepeatrate; + uint2 delay = MCNameIsEqualToCaseless(mptr, MCM_internal) ? MCrepeatdelay : MCrepeatrate; MCscreen->addtimer(this, MCM_internal2, delay); MCRectangle thumb; switch (mode) @@ -680,7 +680,7 @@ void MCScrollbar::timer(MCNameRef mptr, MCParameter *params) } } } - else if (MCNameIsEqualTo(mptr, MCM_internal3, kMCCompareCaseless)) + else if (MCNameIsEqualToCaseless(mptr, MCM_internal3)) { #ifdef _MAC_DESKTOP // MW-2012-09-17: [[ Bug 9212 ]] Mac progress bars do not animate. @@ -963,7 +963,7 @@ void MCScrollbar::update(real8 newpos, MCNameRef mess) { case ES_NOT_HANDLED: case ES_PASS: - if (!MCNameIsEqualTo(mess, MCM_scrollbar_drag, kMCCompareCaseless)) + if (!MCNameIsEqualToCaseless(mess, MCM_scrollbar_drag)) message_with_valueref_args(MCM_scrollbar_drag, *t_data); default: break; diff --git a/engine/src/stack.cpp b/engine/src/stack.cpp index 6b958dc1a3b..0240c298d02 100644 --- a/engine/src/stack.cpp +++ b/engine/src/stack.cpp @@ -273,7 +273,7 @@ MCStack::MCStack() stackfiles = NULL; linkatts = NULL; filename = MCValueRetain(kMCEmptyString); - /* UNCHECKED */ MCNameClone(kMCEmptyName, _menubar); + _menubar = MCValueRetain(kMCEmptyName); menuy = menuheight = 0; menuwindow = False; @@ -494,7 +494,7 @@ MCStack::MCStack(const MCStack &sref) else linkatts = NULL; filename = MCValueRetain(kMCEmptyString); - /* UNCHECKED */ MCNameClone(sref._menubar, _menubar); + _menubar = MCValueRetain(sref._menubar); menuy = menuheight = 0; f_extended_state = 0; @@ -631,7 +631,7 @@ MCStack::~MCStack() } MCValueRelease(filename); - MCNameDelete(_menubar); + MCValueRelease(_menubar); unloadexternals(); @@ -1200,7 +1200,7 @@ Boolean MCStack::doubleup(uint2 which) void MCStack::timer(MCNameRef mptr, MCParameter *params) { - if (MCNameIsEqualTo(mptr, MCM_internal, kMCCompareCaseless)) + if (MCNameIsEqualToCaseless(mptr, MCM_internal)) { if (scrollmode == SM_PAGEDEC || scrollmode == SM_LINEDEC) { @@ -1228,7 +1228,7 @@ void MCStack::timer(MCNameRef mptr, MCParameter *params) if (scrollmode == SM_LINEINC || scrollmode == SM_LINEDEC) MCscreen->addtimer(this, MCM_internal, MCrepeatrate); } - else if (MCNameIsEqualTo(mptr, MCM_idle, kMCCompareCaseless)) + else if (MCNameIsEqualToCaseless(mptr, MCM_idle)) { if (opened && hashandlers & HH_IDLE && state & CS_KFOCUSED && getstack()->gettool(this) == T_BROWSE) @@ -1585,7 +1585,7 @@ Exec_stat MCStack::handle(Handler_type htype, MCNameRef message, MCParameter *pa { if (!opened) { - if (window == NULL && !MCNameIsEqualTo(message, MCM_start_up, kMCCompareCaseless) + if (window == NULL && !MCNameIsEqualToCaseless(message, MCM_start_up) #ifdef _MACOSX && !(state & CS_DELETE_STACK)) #else diff --git a/engine/src/stack3.cpp b/engine/src/stack3.cpp index 2f15455b8f9..3d647d02d58 100644 --- a/engine/src/stack3.cpp +++ b/engine/src/stack3.cpp @@ -271,7 +271,7 @@ IO_stat MCStack::load_stack(IO_handle stream, uint32_t version) MCNameRef t_menubar; if ((stat = IO_read_nameref_new(t_menubar, stream, version >= kMCStackFileFormatVersion_7_0)) != IO_NORMAL) return checkloadstat(stat); - MCNameDelete(_menubar); + MCValueRelease(_menubar); _menubar = t_menubar; } @@ -799,7 +799,7 @@ Exec_stat MCStack::resubstack(MCStringRef p_data) // If t_val doesn't exist as a name, it can't exist as a substack name. // t_val is always a stringref (fetched from an MCSplitString array) MCNameRef t_name; - t_name = MCNameLookup((MCStringRef)t_val); + t_name = MCNameLookupCaseless((MCStringRef)t_val); if (t_name != nil) while (tsub -> hasname(t_name)) diff --git a/engine/src/statemnt.cpp b/engine/src/statemnt.cpp index 21ff8fc9bfc..21b37105efc 100644 --- a/engine/src/statemnt.cpp +++ b/engine/src/statemnt.cpp @@ -344,7 +344,7 @@ void MCStatement::compile(MCSyntaxFactoryRef ctxt) MCComref::MCComref(MCNameRef n) { - /* UNCHECKED */ MCNameClone(n, name); + name = MCValueRetain(n); handler = nil; params = NULL; resolved = false; @@ -359,7 +359,7 @@ MCComref::~MCComref() params = params->getnext(); delete tmp; } - MCNameDelete(name); + MCValueRelease(name); } Parse_stat MCComref::parse(MCScriptPoint &sp) diff --git a/engine/src/sysspec-url.cpp b/engine/src/sysspec-url.cpp index 8b9555ca418..e0a6becf427 100644 --- a/engine/src/sysspec-url.cpp +++ b/engine/src/sysspec-url.cpp @@ -411,8 +411,9 @@ MCUrlLoadEvent *MCUrlLoadEvent::CreateUrlLoadEvent(MCObjectHandle p_object, MCNa t_event->m_url = MCValueRetain(p_url); if (t_success) - t_success = MCNameClone(p_message, t_event->m_message); - if (p_status == kMCSystemUrlStatusError) + t_event->m_message = MCValueRetain(p_message); + + if (p_status == kMCSystemUrlStatusError) t_event -> m_error = MCValueRetain(p_error); if (t_success) @@ -425,7 +426,7 @@ MCUrlLoadEvent *MCUrlLoadEvent::CreateUrlLoadEvent(MCObjectHandle p_object, MCNa else { MCValueRelease(t_event->m_url); - MCNameDelete(t_event->m_message); + MCValueRelease(t_event->m_message); MCValueRelease(t_event->m_error); delete t_event; return nil; @@ -438,7 +439,7 @@ MCUrlLoadEvent *MCUrlLoadEvent::CreateUrlLoadEvent(MCObjectHandle p_object, MCNa void MCUrlLoadEvent::Destroy(void) { MCValueRelease(m_url); - MCNameDelete(m_message); + MCValueRelease(m_message); if (m_status == kMCSystemUrlStatusFinished) MCValueRelease(m_data); else if (m_status == kMCSystemUrlStatusError) @@ -525,7 +526,7 @@ void MCS_loadurl(MCObject *p_object, MCStringRef p_url, MCNameRef p_message) { MCValueRelease(t_state -> data); MCValueRelease(t_state -> url); - MCNameDelete(t_state -> message); + MCValueRelease(t_state -> message); MCurlresult -> clear(); MCresult->sets("error: load URL failed"); MCMemoryDestroy(t_state); diff --git a/engine/src/tooltip.cpp b/engine/src/tooltip.cpp index 9b9b44f9e7e..eff6baf1d5f 100644 --- a/engine/src/tooltip.cpp +++ b/engine/src/tooltip.cpp @@ -61,7 +61,7 @@ void MCTooltip::close(void) void MCTooltip::timer(MCNameRef mptr, MCParameter *params) { #ifndef _MOBILE - if (MCNameIsEqualTo(mptr, MCM_internal, kMCCompareCaseless)) + if (MCNameIsEqualToCaseless(mptr, MCM_internal)) opentip(); else close(); @@ -173,9 +173,9 @@ void MCTooltip::opentip() { // MW-2012-02-17: [[ LogFonts ]] Convert the tooltip font string to // a name and create the font. - MCAutoNameRef t_tt_font; - /* UNCHECKED */ MCNameCreate(MCttfont, t_tt_font); - /* UNCHECKED */ MCFontCreate(t_tt_font, MCFontStyleFromTextStyle(FA_DEFAULT_STYLE), MCttsize, m_font); + MCNewAutoNameRef t_tt_font; + /* UNCHECKED */ MCNameCreate(MCttfont, &t_tt_font); + /* UNCHECKED */ MCFontCreate(*t_tt_font, MCFontStyleFromTextStyle(FA_DEFAULT_STYLE), MCttsize, m_font); } rect.width = 0; diff --git a/engine/src/uidc.cpp b/engine/src/uidc.cpp index aadd6117b41..dfdb44e6031 100644 --- a/engine/src/uidc.cpp +++ b/engine/src/uidc.cpp @@ -1264,7 +1264,7 @@ void MCUIDC::cancelmessageobject(MCObject *optr, MCNameRef mptr, MCValueRef subo } if (t_msg.m_object.Get() == optr - && (mptr == NULL || MCNameIsEqualTo(*t_msg.m_message, mptr, kMCCompareCaseless)) + && (mptr == NULL || MCNameIsEqualToCaseless(*t_msg.m_message, mptr)) && (subobject == NULL || (t_msg.m_params != nil && t_msg.m_params -> getvalueref_argument() == subobject))) cancelmessageindex(i - 1, true); @@ -1359,7 +1359,7 @@ Boolean MCUIDC::handlepending(real8& curtime, real8& eventtime, Boolean dispatch if (t_msg.m_time > curtime) break; - if (!dispatch && t_msg.m_id == 0 && MCNameIsEqualTo(*t_msg.m_message, MCM_idle, kMCCompareCaseless)) + if (!dispatch && t_msg.m_id == 0 && MCNameIsEqualToCaseless(*t_msg.m_message, MCM_idle)) { doshiftmessage(i, curtime + MCidleRate / 1000.0); continue; diff --git a/engine/src/util.cpp b/engine/src/util.cpp index fc163689423..f93a3d8de7e 100755 --- a/engine/src/util.cpp +++ b/engine/src/util.cpp @@ -1161,7 +1161,7 @@ bool MCU_matchname(MCNameRef test, Chunk_term type, MCNameRef name) if (name == nil || MCNameIsEmpty(name) || MCNameIsEmpty(test)) return false; - if (MCNameIsEqualTo(name, test, kMCCompareCaseless)) + if (MCNameIsEqualToCaseless(name, test)) return true; MCAssert(type - CT_STACK < (sizeof(nametable) / sizeof(nametable[0]))); @@ -2449,7 +2449,7 @@ MCNameRef MCU_charsettolanguage(uint1 charset) uint1 MCU_languagetocharset(MCNameRef p_language) { for (uinteger_t i = 0; i < ELEMENTS(langtocharsets); i++) - if (MCNameIsEqualTo(p_language, *langtocharsets[i].langname)) + if (MCNameIsEqualToCaseless(p_language, *langtocharsets[i].langname)) return langtocharsets[i].charset; return 0; diff --git a/engine/src/variable.cpp b/engine/src/variable.cpp index cd88152cdaf..800d3919abe 100644 --- a/engine/src/variable.cpp +++ b/engine/src/variable.cpp @@ -236,7 +236,7 @@ void MCVariable::clearuql(void) // SN-2014-04-09 [[ Bug 12160 ]] Put after/before on an uninitialised, by-reference parameter inserts the variable's name in it // The content of a UQL value was not cleared when needed - if (value . type == kMCExecValueTypeNameRef && MCNameIsEqualTo(value . nameref_value, *name)) + if (value . type == kMCExecValueTypeNameRef && MCNameIsEqualToCaseless(value . nameref_value, *name)) clear(); is_uql = false; @@ -750,10 +750,11 @@ bool MCVariable::remove(MCExecContext& ctxt, MCSpan p_path) if (is_env) { - if (!isdigit(MCNameGetCharAtIndex(*name, 1)) && MCNameGetCharAtIndex(*name, 1) != '#') + MCStringRef t_name_string = MCNameGetString(*name); + if (!isdigit(MCStringGetNativeCharAtIndex(t_name_string, 1)) && MCStringGetNativeCharAtIndex(t_name_string, 1) != '#') { MCAutoStringRef t_env; - /* UNCHECKED */ MCStringCopySubstring(MCNameGetString(*name), MCRangeMake(1, MCStringGetLength(MCNameGetString(*name))), &t_env); + /* UNCHECKED */ MCStringCopySubstring(MCNameGetString(*name), MCRangeMake(1, MCStringGetLength(t_name_string)), &t_env); MCS_unsetenv(*t_env); } } @@ -897,10 +898,13 @@ bool MCVariable::converttomutabledata(MCExecContext& ctxt) MCVariable *MCVariable::lookupglobal_cstring(const char *p_name) { + MCAutoStringRef t_string; + /* UNCHECKED */ MCStringCreateWithCString(p_name, &t_string); + // If we can't find an existing name, then there can be no global with // name 'p_name'. MCNameRef t_name; - t_name = MCNameLookupWithCString(p_name, kMCCompareCaseless); + t_name = MCNameLookupCaseless(*t_string); if (t_name == nil) return nil; @@ -934,21 +938,19 @@ bool MCVariable::ensureglobal(MCNameRef p_name, MCVariable*& r_var) if (!createwithname(p_name, t_new_global)) return false; - if (MCNameGetCharAtIndex(p_name, 0) == '$') - { - MCAutoStringRef t_env; - /* UNCHECKED */ MCStringCopySubstring( - MCNameGetString(p_name), - MCRangeMake(1, MCStringGetLength(MCNameGetString(p_name))), - &t_env - ); - - MCAutoStringRef t_value; - if (MCS_getenv(*t_env, &t_value)) - t_new_global -> setvalueref(*t_value); + if (MCStringGetNativeCharAtIndex(MCNameGetString(p_name), 0) == '$') + { + MCAutoStringRef t_env; + /* UNCHECKED */ MCStringCopySubstring(MCNameGetString(p_name), + MCRangeMake(1, MCStringGetLength(MCNameGetString(p_name))), + &t_env); + + MCAutoStringRef t_value; + if (MCS_getenv(*t_env, &t_value)) + t_new_global -> setvalueref(*t_value); - t_new_global -> is_env = true; - } + t_new_global -> is_env = true; + } t_new_global -> is_global = true; @@ -1034,7 +1036,8 @@ void MCVariable::synchronize(MCExecContext& ctxt, bool p_notify) MCAutoStringRef t_stringref_value; if (is_env) { - if (!isdigit(MCNameGetCharAtIndex(*name, 1)) && MCNameGetCharAtIndex(*name, 1) != '#') + MCStringRef t_name_string = MCNameGetString(*name); + if (!isdigit(MCStringGetNativeCharAtIndex(t_name_string, 1)) && MCStringGetNativeCharAtIndex(t_name_string, 1) != '#') { MCExecTypeCopy(value, t_value); MCExecTypeConvertAndReleaseAlways(ctxt, t_value . type, &t_value, kMCExecValueTypeStringRef, &(&t_stringref_value)); diff --git a/engine/src/variable.h b/engine/src/variable.h index 8248f9dcc26..c64a11c4c87 100644 --- a/engine/src/variable.h +++ b/engine/src/variable.h @@ -225,7 +225,7 @@ class MCVariable bool hasname(MCNameRef other_name) { - return MCNameIsEqualTo(*name, other_name, kMCCompareCaseless); + return MCNameIsEqualToCaseless(*name, other_name); } ////////// diff --git a/engine/src/w32flst.cpp b/engine/src/w32flst.cpp index 9ad5d22e5b5..e449a5f93ff 100755 --- a/engine/src/w32flst.cpp +++ b/engine/src/w32flst.cpp @@ -202,17 +202,17 @@ MCFontnode::MCFontnode(MCNameRef fname, uint2 &size, uint2 style, Boolean printe memset(&logfont, 0, sizeof(LOGFONTW)); // Is the font name one of the special UI font names? - if (MCNameIsEqualTo(fname, MCN_font_usertext)) + if (MCNameIsEqualToCaseless(fname, MCN_font_usertext)) set_facename_for_message_font(logfont); - else if (MCNameIsEqualTo(fname, MCN_font_menutext)) + else if (MCNameIsEqualToCaseless(fname, MCN_font_menutext)) set_facename_for_menu_font(logfont); - else if (MCNameIsEqualTo(fname, MCN_font_content)) + else if (MCNameIsEqualToCaseless(fname, MCN_font_content)) set_facename_for_message_font(logfont); - else if (MCNameIsEqualTo(fname, MCN_font_message)) + else if (MCNameIsEqualToCaseless(fname, MCN_font_message)) set_facename_for_message_font(logfont); - else if (MCNameIsEqualTo(fname, MCN_font_tooltip)) + else if (MCNameIsEqualToCaseless(fname, MCN_font_tooltip)) set_facename_for_status_font(logfont); - else if (MCNameIsEqualTo(fname, MCN_font_system)) + else if (MCNameIsEqualToCaseless(fname, MCN_font_system)) set_facename_for_message_font(logfont); else { @@ -308,7 +308,7 @@ MCFontStruct *MCFontnode::getfont(MCNameRef fname, uint2 size, uint2 style, Boolean printer) { // MW-2012-05-03: [[ Values* ]] Match the font name caselessly. - if (!MCNameIsEqualTo(fname, *reqname) || printer != reqprinter) + if (!MCNameIsEqualToCaseless(fname, *reqname) || printer != reqprinter) return NULL; if (size == 0) return font; diff --git a/engine/src/widget.cpp b/engine/src/widget.cpp index d25f3fd20f8..af2f8cfdad1 100644 --- a/engine/src/widget.cpp +++ b/engine/src/widget.cpp @@ -358,7 +358,7 @@ static void lookup_name_for_prop(Properties p_which, MCNameRef& r_name) for(uindex_t i = 0; i < factor_table_size; i++) if (factor_table[i] . type == TT_PROPERTY && factor_table[i] . which == p_which) { - /* UNCHECKED */ MCNameCreateWithCString(factor_table[i] . token, r_name); + r_name = MCNAME(factor_table[i] . token); return; } diff --git a/libfoundation/include/foundation.h b/libfoundation/include/foundation.h index 540b94cda65..8af9d891876 100644 --- a/libfoundation/include/foundation.h +++ b/libfoundation/include/foundation.h @@ -2030,54 +2030,6 @@ MC_DLLEXPORT extern MCNumberRef kMCMinusOne; #define DBL_INT_MAX (1LL << DBL_MANT_DIG) /* the maximum integer faithfully representable by a double */ #define DBL_INT_MIN (-DBL_INT_MAX) /* the minimum integer faithfully representable by a double */ - -//////////////////////////////////////////////////////////////////////////////// -// -// NAME DEFINITIONS -// - -// Like MCSTR but for NameRefs -MC_DLLEXPORT MCNameRef MCNAME(const char *); - -// Create a name using the given string. -MC_DLLEXPORT bool MCNameCreate(MCStringRef string, MCNameRef& r_name); -// Create a name using chars. -MC_DLLEXPORT bool MCNameCreateWithChars(const unichar_t *chars, uindex_t count, MCNameRef& r_name); -// Create a name using native chars. -MC_DLLEXPORT bool MCNameCreateWithNativeChars(const char_t *chars, uindex_t count, MCNameRef& r_name); - -// Create a name using the given string, releasing the original. -MC_DLLEXPORT bool MCNameCreateAndRelease(MCStringRef string, MCNameRef& r_name); - -// Looks for an existing name matching the given string. -MC_DLLEXPORT MCNameRef MCNameLookup(MCStringRef string); - -// Returns a unsigned integer which can be used to order a table for a binary -// search. -MC_DLLEXPORT uintptr_t MCNameGetCaselessSearchKey(MCNameRef name); - -// Returns the string content of the name. -MC_DLLEXPORT MCStringRef MCNameGetString(MCNameRef name); - -// Returns true if the given name is the empty name. -MC_DLLEXPORT bool MCNameIsEmpty(MCNameRef name); - -} - -// Returns true if the names are equal (caselessly). Note that MCNameIsEqualTo -// is *not* the same as MCValueIsEqualTo as it is a comparison up to case (of -// the name's string) rather than exact. -bool MCNameIsEqualTo(MCNameRef left, MCNameRef right); -bool MCNameIsEqualTo(MCNameRef self, MCNameRef p_other_name, bool p_case_sensitive, bool p_form_sensitive); - -extern "C" { - -// The empty name object; -MC_DLLEXPORT extern MCNameRef kMCEmptyName; - -MC_DLLEXPORT extern MCNameRef kMCTrueName; -MC_DLLEXPORT extern MCNameRef kMCFalseName; - //////////////////////////////////////////////////////////////////////////////// // // STRING DEFINITIONS @@ -2766,6 +2718,49 @@ MCStringNormalizeLineEndings(MCStringRef p_input, MCStringRef& r_output, MCStringLineEndingStyle* r_original_style); +//////////////////////////////////////////////////////////////////////////////// +// +// NAME DEFINITIONS +// + +// Like MCSTR but for NameRefs +MC_DLLEXPORT MCNameRef MCNAME(const char *); + +// Create a name using the given string. +MC_DLLEXPORT bool MCNameCreate(MCStringRef string, MCNameRef& r_name); +// Create a name using chars. +MC_DLLEXPORT bool MCNameCreateWithChars(const unichar_t *chars, uindex_t count, MCNameRef& r_name); +// Create a name using native chars. +MC_DLLEXPORT bool MCNameCreateWithNativeChars(const char_t *chars, uindex_t count, MCNameRef& r_name); + +// Create a name using the given string, releasing the original. +MC_DLLEXPORT bool MCNameCreateAndRelease(MCStringRef string, MCNameRef& r_name); + +// Looks for an existing name matching the given string. +MC_DLLEXPORT MCNameRef MCNameLookupCaseless(MCStringRef string); + +// Returns a unsigned integer which can be used to order a table for a binary +// search. +MC_DLLEXPORT uintptr_t MCNameGetCaselessSearchKey(MCNameRef name); + +// Returns the string content of the name. +MC_DLLEXPORT MCStringRef MCNameGetString(MCNameRef name); + +// Returns true if the given name is the empty name. +MC_DLLEXPORT bool MCNameIsEmpty(MCNameRef name); + +// Returns true if the names are equal under the options specified by options. +MC_DLLEXPORT bool MCNameIsEqualTo(MCNameRef left, MCNameRef right, MCStringOptions p_options); + +// Returns true if the names are equal caselessly. +MC_DLLEXPORT bool MCNameIsEqualToCaseless(MCNameRef left, MCNameRef right); + +// The empty name object; +MC_DLLEXPORT extern MCNameRef kMCEmptyName; + +MC_DLLEXPORT extern MCNameRef kMCTrueName; +MC_DLLEXPORT extern MCNameRef kMCFalseName; + //////////////////////////////////////////////////////////////////////////////// // // DATA DEFINITIONS @@ -2855,13 +2850,9 @@ MC_DLLEXPORT extern MCArrayRef kMCEmptyArray; // Create an immutable array containing the given keys and values. MC_DLLEXPORT bool MCArrayCreate(bool case_sensitive, const MCNameRef *keys, const MCValueRef *values, uindex_t length, MCArrayRef& r_array); -// Create an immutable array containing the given keys and values with the requested string comparison options. -MC_DLLEXPORT bool MCArrayCreateWithOptions(bool p_case_sensitive, bool p_form_sensitive, const MCNameRef *keys, const MCValueRef *values, uindex_t length, MCArrayRef& r_array); // Create an empty mutable array. MC_DLLEXPORT bool MCArrayCreateMutable(MCArrayRef& r_array); -// Create an empty mutable array with the requested string comparison options. -MC_DLLEXPORT bool MCArrayCreateMutableWithOptions(MCArrayRef& r_array, bool p_case_sensitive, bool p_form_sensitive); // Make an immutable copy of the given array. If the 'copy and release' form is // used then the original array is released (has its reference count reduced by @@ -2881,11 +2872,6 @@ MC_DLLEXPORT bool MCArrayIsMutable(MCArrayRef array); // Returns the number of elements in the array. MC_DLLEXPORT uindex_t MCArrayGetCount(MCArrayRef array); -// Returns whether the keys of the array have been predesignated case sensitive or not. -MC_DLLEXPORT bool MCArrayIsCaseSensitive(MCArrayRef array); -// Returns whether the keys of the array have been predesignated form sensitive or not. -MC_DLLEXPORT bool MCArrayIsFormSensitive(MCArrayRef array); - // Fetch the value from the array with the given key. The returned value is // not retained. If being stored elsewhere ValueCopy should be used to make an // immutable copy first. If 'false' is returned it means the key was not found diff --git a/libfoundation/src/foundation-array.cpp b/libfoundation/src/foundation-array.cpp index 056a5eed1ab..e235547f84b 100644 --- a/libfoundation/src/foundation-array.cpp +++ b/libfoundation/src/foundation-array.cpp @@ -93,42 +93,6 @@ bool MCArrayCreate(bool p_case_sensitive, const MCNameRef *p_keys, const MCValue return false; } -MC_DLLEXPORT_DEF -bool MCArrayCreateWithOptions(bool p_case_sensitive, bool p_form_sensitive, const MCNameRef *p_keys, const MCValueRef *p_values, uindex_t p_length, MCArrayRef& r_array) -{ - if (p_length == 0) - { - if (nil != kMCEmptyArray) - { - r_array = MCValueRetain(kMCEmptyArray); - return true; - } - } - else - { - MCAssert(nil != p_keys); - MCAssert(nil != p_values); - } - - bool t_success; - t_success = true; - - MCArrayRef t_array; - t_array = nil; - if (t_success) - t_success = MCArrayCreateMutableWithOptions(t_array, p_case_sensitive, p_form_sensitive); - - if (t_success) - for(uindex_t i = 0; i < p_length && t_success; i++) - t_success = MCArrayStoreValue(t_array, p_case_sensitive, p_keys[i], p_values[i]); - - if (t_success) - return MCArrayCopyAndRelease(t_array, r_array); - - MCValueRelease(t_array); - return false; -} - MC_DLLEXPORT_DEF bool MCArrayCreateMutable(MCArrayRef& r_array) { @@ -140,23 +104,6 @@ bool MCArrayCreateMutable(MCArrayRef& r_array) return true; } -MC_DLLEXPORT_DEF -bool MCArrayCreateMutableWithOptions(MCArrayRef& r_array, bool p_case_sensitive, bool p_form_sensitive) -{ - if (!__MCValueCreate(kMCValueTypeCodeArray, r_array)) - return false; - - r_array -> flags |= kMCArrayFlagIsMutable; - - if (p_case_sensitive) - r_array -> flags |= kMCArrayFlagIsCaseSensitive; - - if (p_form_sensitive) - r_array -> flags |= kMCArrayFlagIsFormSensitive; - - return true; -} - MC_DLLEXPORT_DEF bool MCArrayCopy(MCArrayRef self, MCArrayRef& r_new_array) { @@ -370,22 +317,6 @@ uindex_t MCArrayGetCount(MCArrayRef self) return self -> contents -> key_value_count; } -MC_DLLEXPORT_DEF -bool MCArrayIsCaseSensitive(MCArrayRef self) -{ - __MCAssertIsArray(self); - - return (self -> flags & kMCArrayFlagIsCaseSensitive) != 0; -} - -MC_DLLEXPORT_DEF -bool MCArrayIsFormSensitive(MCArrayRef self) -{ - __MCAssertIsArray(self); - - return (self -> flags & kMCArrayFlagIsFormSensitive) != 0; -} - //////////////////////////////////////////////////////////////////////////////// MC_DLLEXPORT_DEF @@ -999,7 +930,7 @@ static bool __MCArrayFindKeyValueSlot(__MCArray *self, bool p_case_sensitive, MC } else { - if (MCNameIsEqualTo(t_entry -> key, p_key, p_case_sensitive, MCArrayIsFormSensitive(self))) + if (MCNameIsEqualTo(t_entry -> key, p_key, !p_case_sensitive ? kMCStringOptionCompareCaseless : kMCStringOptionCompareExact)) { r_slot = t_probe; return true; diff --git a/libfoundation/src/foundation-name.cpp b/libfoundation/src/foundation-name.cpp index 8a9c368ec48..7d127097f68 100644 --- a/libfoundation/src/foundation-name.cpp +++ b/libfoundation/src/foundation-name.cpp @@ -206,7 +206,7 @@ bool MCNameCreateAndRelease(MCStringRef p_string, MCNameRef& r_name) } MC_DLLEXPORT_DEF -MCNameRef MCNameLookup(MCStringRef p_string) +MCNameRef MCNameLookupCaseless(MCStringRef p_string) { // Compute the hash of the characters, up to case. hash_t t_hash; @@ -259,7 +259,8 @@ bool MCNameIsEmpty(MCNameRef self) return self == kMCEmptyName; } -bool MCNameIsEqualTo(MCNameRef self, MCNameRef p_other_name) +MC_DLLEXPORT_DEF +bool MCNameIsEqualToCaseless(MCNameRef self, MCNameRef p_other_name) { __MCAssertIsName(self); __MCAssertIsName(p_other_name); @@ -268,7 +269,8 @@ bool MCNameIsEqualTo(MCNameRef self, MCNameRef p_other_name) self -> key == p_other_name -> key; } -bool MCNameIsEqualTo(MCNameRef self, MCNameRef p_other_name, bool p_case_sensitive, bool p_form_sensitive) +MC_DLLEXPORT_DEF +bool MCNameIsEqualTo(MCNameRef self, MCNameRef p_other_name, MCStringOptions p_options) { __MCAssertIsName(self); __MCAssertIsName(p_other_name); @@ -276,14 +278,13 @@ bool MCNameIsEqualTo(MCNameRef self, MCNameRef p_other_name, bool p_case_sensiti if (self == p_other_name) return true; - if (p_case_sensitive && p_form_sensitive) + if (p_options == kMCStringOptionCompareExact) return false; - else if (!p_case_sensitive && !p_form_sensitive) + + if (p_options == kMCStringOptionCompareCaseless) return self -> key == p_other_name -> key; - else if (p_case_sensitive) - return MCStringIsEqualTo(self -> string, p_other_name -> string, kMCStringOptionCompareNonliteral); - else - return MCStringIsEqualTo(self -> string, p_other_name -> string, kMCStringOptionCompareFolded); + + return MCStringIsEqualTo(self -> string, p_other_name -> string, p_options); } //////////////////////////////////////////////////////////////////////////////// diff --git a/libfoundation/src/foundation-private.h b/libfoundation/src/foundation-private.h index e723681f241..986108cb322 100755 --- a/libfoundation/src/foundation-private.h +++ b/libfoundation/src/foundation-private.h @@ -308,10 +308,6 @@ enum // If set then the array is indirect (i.e. contents is within another // immutable array). kMCArrayFlagIsIndirect = 1 << 7, - // If set then the array keys are case sensitive. - kMCArrayFlagIsCaseSensitive = 1 << 8, - // If set the the array keys are form sensitive. - kMCArrayFlagIsFormSensitive = 1 << 9, }; struct __MCArrayKeyValue diff --git a/libfoundation/src/foundation-record.cpp b/libfoundation/src/foundation-record.cpp index 1f15a16d605..4f7a9d7505f 100644 --- a/libfoundation/src/foundation-record.cpp +++ b/libfoundation/src/foundation-record.cpp @@ -211,7 +211,7 @@ static bool __fetch_value(MCTypeInfoRef p_typeinfo, MCRecordRef self, MCNameRef t_resolved_typeinfo = __MCTypeInfoResolve(self -> typeinfo); for(uindex_t i = 0; i < t_resolved_typeinfo -> record . field_count; i++) - if (MCNameIsEqualTo(p_field, t_resolved_typeinfo -> record . fields[i] . name)) + if (MCNameIsEqualToCaseless(p_field, t_resolved_typeinfo -> record . fields[i] . name)) { r_value = self -> fields[i]; return true; @@ -234,7 +234,7 @@ static bool __store_value(MCTypeInfoRef p_typeinfo, MCRecordRef self, MCNameRef t_resolved_typeinfo = __MCTypeInfoResolve(self -> typeinfo); for(uindex_t i = 0; i < t_resolved_typeinfo -> record . field_count; i++) - if (MCNameIsEqualTo(p_field, t_resolved_typeinfo -> record . fields[i] . name)) + if (MCNameIsEqualToCaseless(p_field, t_resolved_typeinfo -> record . fields[i] . name)) { if (!MCTypeInfoConforms(MCValueGetTypeInfo(p_value), t_resolved_typeinfo -> record . fields[i] . type)) return MCErrorThrowGeneric(nil); diff --git a/libfoundation/src/foundation-typeinfo.cpp b/libfoundation/src/foundation-typeinfo.cpp index 128fa6ebaf4..696bb34c8f6 100644 --- a/libfoundation/src/foundation-typeinfo.cpp +++ b/libfoundation/src/foundation-typeinfo.cpp @@ -712,7 +712,7 @@ bool MCRecordTypeInfoCreate(const MCRecordTypeFieldInfo *p_fields, index_t p_fie * in debug builds and will only happen once per type. */ for (index_t j = 0; j < i; ++j) { - MCAssert(!MCNameIsEqualTo(p_fields[i] . name, p_fields[j] . name)); + MCAssert(!MCNameIsEqualToCaseless(p_fields[i] . name, p_fields[j] . name)); } self -> record . fields[i] . name = MCValueRetain(p_fields[i] . name); self -> record . fields[i] . type = MCValueRetain(p_fields[i] . type); @@ -1305,14 +1305,14 @@ bool __MCTypeInfoIsEqualTo(__MCTypeInfo *self, __MCTypeInfo *other_self) t_code = __MCTypeInfoGetExtendedTypeCode(self); if (t_code == kMCTypeInfoTypeIsAlias) - return MCNameIsEqualTo(self -> alias . name, other_self -> alias . name) && + return MCNameIsEqualToCaseless(self -> alias . name, other_self -> alias . name) && self -> alias . typeinfo == other_self -> alias . typeinfo; if (t_code == kMCTypeInfoTypeIsNamed) { if (self -> named . name == kMCEmptyName || other_self -> named . name == kMCEmptyName) return false; - return MCNameIsEqualTo(self -> named . name, other_self -> named . name); + return MCNameIsEqualToCaseless(self -> named . name, other_self -> named . name); } if (t_code == kMCTypeInfoTypeIsOptional) diff --git a/libscript/src/module-array.cpp b/libscript/src/module-array.cpp index c01cc1f26cc..6b43cd86042 100644 --- a/libscript/src/module-array.cpp +++ b/libscript/src/module-array.cpp @@ -17,29 +17,6 @@ #include #include -static bool create_key_for_array(MCStringRef p_string, MCArrayRef p_target, MCNameRef& r_key) -{ - MCAutoStringRef t_key_string; - - bool t_success; - t_success = true; - - /* - if (MCArrayIsFormSensitive(p_target) && !MCStringIsNative(p_string)) - { - t_success = MCStringCreateWithBytes((const byte_t *)MCStringGetCharPtr(p_string), MCStringGetLength(p_string) * 2, kMCStringEncodingNative, false, &t_key_string); - } - else - */ - t_key_string = p_string; - - - if (t_success) - t_success = MCNameCreate(*t_key_string, r_key); - - return t_success; -} - static bool is_not_among_the_elements_of(void *context, MCArrayRef p_target, MCNameRef p_key, MCValueRef p_value) { MCValueRef t_needle = (MCValueRef)context; @@ -91,13 +68,13 @@ extern "C" MC_DLLEXPORT_DEF void MCArrayEvalIsAmongTheElementsOf(MCValueRef p_ne extern "C" MC_DLLEXPORT_DEF void MCArrayEvalIsAmongTheKeysOfCaseless(MCStringRef p_needle, bool p_is_not, MCArrayRef p_target, bool& r_output) { MCNewAutoNameRef t_key; - if (!create_key_for_array(p_needle, p_target, &t_key)) + if (!MCNameCreate(p_needle, &t_key)) return; MCValueRef t_value; t_value = nil; - r_output = MCArrayFetchValue(p_target, MCArrayIsCaseSensitive(p_target), *t_key, t_value); + r_output = MCArrayFetchValue(p_target, false, *t_key, t_value); if (p_is_not) r_output = !r_output; @@ -106,13 +83,12 @@ extern "C" MC_DLLEXPORT_DEF void MCArrayEvalIsAmongTheKeysOfCaseless(MCStringRef extern "C" MC_DLLEXPORT_DEF void MCArrayFetchElementOfCaseless(MCArrayRef p_target, MCStringRef p_key, MCValueRef& r_output) { MCNewAutoNameRef t_key; - - if (!create_key_for_array(p_key, p_target, &t_key)) + if (!MCNameCreate(p_key, &t_key)) return; MCValueRef t_value; t_value = nil; - if (!MCArrayFetchValue(p_target, MCArrayIsCaseSensitive(p_target), *t_key, t_value)) + if (!MCArrayFetchValue(p_target, false, *t_key, t_value)) { MCErrorCreateAndThrow(kMCGenericErrorTypeInfo, "reason", MCSTR("array key does not exist"), nil); return; @@ -123,15 +99,15 @@ extern "C" MC_DLLEXPORT_DEF void MCArrayFetchElementOfCaseless(MCArrayRef p_targ extern "C" MC_DLLEXPORT_DEF void MCArrayStoreElementOfCaseless(MCValueRef p_value, MCArrayRef& x_target, MCStringRef p_key) { - MCNewAutoNameRef t_key; MCAutoArrayRef t_array; MCArrayMutableCopy(x_target, &t_array); MCValueRef t_value; t_value = p_value != nil ? p_value : kMCNull; - if (!create_key_for_array(p_key, x_target, &t_key) || - !MCArrayStoreValue(*t_array, MCArrayIsCaseSensitive(*t_array), *t_key, t_value)) + MCNewAutoNameRef t_key; + if (!MCNameCreate(p_key, &t_key) || + !MCArrayStoreValue(*t_array, false, *t_key, t_value)) return; MCAutoArrayRef t_new_array; @@ -143,12 +119,12 @@ extern "C" MC_DLLEXPORT_DEF void MCArrayStoreElementOfCaseless(MCValueRef p_valu extern "C" MC_DLLEXPORT_DEF void MCArrayDeleteElementOfCaseless(MCArrayRef& x_target, MCStringRef p_key) { - MCNewAutoNameRef t_key; MCAutoArrayRef t_array; MCArrayMutableCopy(x_target, &t_array); - if (!create_key_for_array(p_key, x_target, &t_key) || - !MCArrayRemoveValue(*t_array, MCArrayIsCaseSensitive(*t_array), *t_key)) + MCNewAutoNameRef t_key; + if (!MCNameCreate(p_key, &t_key) || + !MCArrayRemoveValue(*t_array, false, *t_key)) return; MCAutoArrayRef t_new_array; diff --git a/libscript/src/script-builder.cpp b/libscript/src/script-builder.cpp index 34eec9f90ad..51dfb8f7022 100644 --- a/libscript/src/script-builder.cpp +++ b/libscript/src/script-builder.cpp @@ -487,7 +487,7 @@ void MCScriptAddDependencyToModule(MCScriptModuleBuilderRef self, MCNameRef p_de return; for(uindex_t i = 0; i < self -> module . dependency_count; i++) - if (MCNameIsEqualTo(p_dependency, self -> module . dependencies[i] . name)) + if (MCNameIsEqualToCaseless(p_dependency, self -> module . dependencies[i] . name)) { r_index = i; return; @@ -556,7 +556,7 @@ void MCScriptAddImportToModule(MCScriptModuleBuilderRef self, uindex_t p_index, } for(uindex_t i = 0; i < self -> module . imported_definition_count; i++) - if (MCNameIsEqualTo(p_name, self -> module . imported_definitions[i] . name) && + if (MCNameIsEqualToCaseless(p_name, self -> module . imported_definitions[i] . name) && p_kind == self -> module . imported_definitions[i] . kind && p_index == self -> module . imported_definitions[i] . module) { @@ -1060,7 +1060,7 @@ void MCScriptEndRecordTypeInModule(MCScriptModuleBuilderRef self, uindex_t& r_ne bool t_equal; t_equal = true; for(uindex_t j = 0; j < t_type -> field_count; j++) - if (!MCNameIsEqualTo(t_type -> fields[j] . name, t_other_type -> fields[j] . name) || + if (!MCNameIsEqualToCaseless(t_type -> fields[j] . name, t_other_type -> fields[j] . name) || t_type -> fields[j] . type != t_other_type -> fields[j] . type) { t_equal = false; @@ -1846,7 +1846,7 @@ void MCScriptEmitPositionForBytecodeInModule(MCScriptModuleBuilderRef self, MCNa self -> current_line = p_line; for(uindex_t i = 0; i < self -> module . source_file_count; i++) - if (MCNameIsEqualTo(p_file, self -> module . source_files[i])) + if (MCNameIsEqualToCaseless(p_file, self -> module . source_files[i])) { self -> current_file = i; return; diff --git a/libscript/src/script-module.cpp b/libscript/src/script-module.cpp index fc6bdcff744..694d03c2249 100644 --- a/libscript/src/script-module.cpp +++ b/libscript/src/script-module.cpp @@ -442,7 +442,7 @@ bool MCScriptCreateModuleFromStream(MCStreamRef stream, MCScriptModuleRef& r_mod // If there is already a module with the same name in memory, there's nothing we can do. for(MCScriptModule *t_other_module = s_modules; t_other_module != nil; t_other_module = t_other_module -> next_module) - if (MCNameIsEqualTo(t_other_module -> name, t_module -> name)) + if (MCNameIsEqualToCaseless(t_other_module -> name, t_module -> name)) { MCScriptDestroyObject(t_module); return MCErrorThrowGeneric(MCSTR("module already loaded")); @@ -528,7 +528,7 @@ MCScriptConfigureBuiltinModule(MCScriptModuleRef p_module, bool MCScriptLookupModule(MCNameRef p_name, MCScriptModuleRef& r_module) { for(MCScriptModule *t_module = s_modules; t_module != nil; t_module = t_module -> next_module) - if (MCNameIsEqualTo(p_name, t_module -> name)) + if (MCNameIsEqualToCaseless(p_name, t_module -> name)) { r_module = t_module; return true; @@ -1101,7 +1101,7 @@ __MCScriptLookupDefinitionInModule(MCScriptModuleRef self, continue; } - if (!MCNameIsEqualTo(p_name, + if (!MCNameIsEqualToCaseless(p_name, self->exported_definitions[i].name)) { continue; @@ -1345,7 +1345,7 @@ static void def_to_name(MCScriptModuleRef self, uindex_t p_index, MCStringRef& r else t_name = self -> definition_names[p_index]; - if (!MCNameIsEqualTo(t_name, MCNAME("undefined"))) + if (!MCNameIsEqualToCaseless(t_name, MCNAME("undefined"))) MCStringFormat(r_string, "%@", t_name); else MCStringFormat(r_string, "nothing"); @@ -1404,7 +1404,7 @@ bool MCScriptWriteInterfaceOfModule(MCScriptModuleRef self, MCStreamRef stream) __enterln(stream, "import module %@", self -> name); for(uindex_t i = 0; i < self -> dependency_count; i++) { - if (MCNameIsEqualTo(self -> dependencies[i] . name, MCNAME("__builtin__"))) + if (MCNameIsEqualToCaseless(self -> dependencies[i] . name, MCNAME("__builtin__"))) continue; __writeln(stream, "use %@", self -> dependencies[i] . name); diff --git a/libscript/stdscript-sources.gypi b/libscript/stdscript-sources.gypi index 0f4102b56d6..e6d623cb5a3 100644 --- a/libscript/stdscript-sources.gypi +++ b/libscript/stdscript-sources.gypi @@ -21,7 +21,6 @@ #'src/line.lcb', 'src/list.lcb', 'src/logic.lcb', - #'src/map.lcb', 'src/math.lcb', 'src/math-foundation.lcb', #'src/segmentchunk.lcb', @@ -58,7 +57,6 @@ 'src/module-java.cpp', 'src/module-list.cpp', 'src/module-logic.cpp', - 'src/module-map.cpp', 'src/module-math_foundation.cpp', 'src/module-math.cpp', 'src/module-sort.cpp',