From 5d004af6c92344b8a8f007b695f0203e6414e168 Mon Sep 17 00:00:00 2001 From: Nigel Barnes Date: Sun, 15 Nov 2015 02:38:06 +0000 Subject: bbc: preliminary support for FSD format. --- scripts/src/lib.lua | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts/src/lib.lua') diff --git a/scripts/src/lib.lua b/scripts/src/lib.lua index 2aa11eb0fd2..a567514f9c0 100644 --- a/scripts/src/lib.lua +++ b/scripts/src/lib.lua @@ -261,6 +261,8 @@ project "formats" MAME_DIR .. "src/lib/formats/fmsx_cas.h", MAME_DIR .. "src/lib/formats/fmtowns_dsk.cpp", MAME_DIR .. "src/lib/formats/fmtowns_dsk.h", + MAME_DIR .. "src/lib/formats/fsd_dsk.cpp", + MAME_DIR .. "src/lib/formats/fsd_dsk.h", MAME_DIR .. "src/lib/formats/g64_dsk.cpp", MAME_DIR .. "src/lib/formats/g64_dsk.h", MAME_DIR .. "src/lib/formats/gtp_cas.cpp", -- cgit v1.2.3-70-g09d2 From 6a765a95ecbd957fc95687e5a63b546cd6ae5b97 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 6 Dec 2015 17:07:50 +0100 Subject: Added addprojectflags function and added -Wsuggest-override for all that are not 3rdparty projects. It is place where all additional checks we should put --- scripts/genie.lua | 9 +++++++++ scripts/src/devices.lua | 4 ++++ scripts/src/emu.lua | 2 ++ scripts/src/lib.lua | 4 ++++ scripts/src/main.lua | 1 + scripts/src/netlist.lua | 2 ++ scripts/src/osd/osdmini.lua | 4 ++++ scripts/src/osd/sdl.lua | 8 ++++++++ scripts/src/osd/windows.lua | 6 ++++++ scripts/target/mame/arcade.lua | 1 + scripts/target/mame/dummy.lua | 1 + scripts/target/mame/mess.lua | 1 + scripts/target/mame/tiny.lua | 1 + 13 files changed, 44 insertions(+) (limited to 'scripts/src/lib.lua') diff --git a/scripts/genie.lua b/scripts/genie.lua index eadf2821e50..c9e2aeac3fc 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -53,6 +53,15 @@ function layoutbuildtask(_folder, _name) { MAME_DIR .. "scripts/build/file2str.py" }, {"@echo Converting src/".._folder.."/".._name..".lay...", PYTHON .. " $(1) $(<) $(@) layout_".._name }}; end +function addprojectflags() + local version = str_to_version(_OPTIONS["gcc_version"]) + if _OPTIONS["gcc"]~=nil and string.find(_OPTIONS["gcc"], "gcc") and (version >= 50100) then + buildoptions_cpp { + "-Wsuggest-override", + } + end +end + CPUS = {} SOUNDS = {} MACHINES = {} diff --git a/scripts/src/devices.lua b/scripts/src/devices.lua index 70774a74ebc..05e8810f2df 100644 --- a/scripts/src/devices.lua +++ b/scripts/src/devices.lua @@ -23,6 +23,8 @@ function devicesProject(_target, _subtarget) "ArchiveSplit", } + addprojectflags() + includedirs { MAME_DIR .. "src/osd", MAME_DIR .. "src/emu", @@ -59,6 +61,7 @@ if (_OPTIONS["SOURCES"] == nil) then uuid ("5d782c89-cf7e-4cfe-8f9f-0d4bfc16c91d") kind (LIBTYPE) targetsubdir(_target .."_" .. _subtarget) + addprojectflags() options { "ArchiveSplit", } @@ -96,6 +99,7 @@ if #disasm_files > 0 then uuid ("f2d28b0a-6da5-4f78-b629-d834aa00429d") kind (LIBTYPE) targetsubdir(_target .."_" .. _subtarget) + addprojectflags() includedirs { MAME_DIR .. "src/osd", diff --git a/scripts/src/emu.lua b/scripts/src/emu.lua index d377a6ebacf..7b19e397c93 100644 --- a/scripts/src/emu.lua +++ b/scripts/src/emu.lua @@ -14,6 +14,8 @@ targetsubdir(_OPTIONS["target"] .."_" .. _OPTIONS["subtarget"]) uuid ("e6fa15e4-a354-4526-acef-13c8e80fcacf") kind (LIBTYPE) +addprojectflags() + includedirs { MAME_DIR .. "src/osd", MAME_DIR .. "src/emu", diff --git a/scripts/src/lib.lua b/scripts/src/lib.lua index a567514f9c0..8c9162ccd65 100644 --- a/scripts/src/lib.lua +++ b/scripts/src/lib.lua @@ -13,6 +13,8 @@ project "utils" uuid "22489ad0-4cb2-4d91-ad81-24b0d80ca30a" kind (LIBTYPE) + addprojectflags() + includedirs { MAME_DIR .. "src/osd", MAME_DIR .. "src/lib/util", @@ -105,6 +107,8 @@ project "formats" uuid "f69636b1-fcce-45ce-b09a-113e371a2d7a" kind (LIBTYPE) + addprojectflags() + options { "ArchiveSplit", } diff --git a/scripts/src/main.lua b/scripts/src/main.lua index 2d233eba87a..619833ccf57 100644 --- a/scripts/src/main.lua +++ b/scripts/src/main.lua @@ -26,6 +26,7 @@ end uuid (os.uuid(_target .."_" .. _subtarget)) kind "ConsoleApp" + addprojectflags() flags { "NoManifest", "Symbols", -- always include minimum symbols for executables diff --git a/scripts/src/netlist.lua b/scripts/src/netlist.lua index 4b6b87c0eae..7b2dff521a5 100644 --- a/scripts/src/netlist.lua +++ b/scripts/src/netlist.lua @@ -13,6 +13,8 @@ project "netlist" uuid "665ef8ac-2a4c-4c3e-a05f-fd1e5db11de9" kind (LIBTYPE) + addprojectflags() + includedirs { MAME_DIR .. "src/lib/netlist", MAME_DIR .. "src/osd", diff --git a/scripts/src/osd/osdmini.lua b/scripts/src/osd/osdmini.lua index 43ff9c4c40b..6e47295de39 100644 --- a/scripts/src/osd/osdmini.lua +++ b/scripts/src/osd/osdmini.lua @@ -21,6 +21,8 @@ project ("osd_" .. _OPTIONS["osd"]) "SingleOutputDir", } + addprojectflags() + dofile("osdmini_cfg.lua") includedirs { @@ -68,6 +70,8 @@ project ("ocore_" .. _OPTIONS["osd"]) "SingleOutputDir", } + addprojectflags() + dofile("osdmini_cfg.lua") includedirs { diff --git a/scripts/src/osd/sdl.lua b/scripts/src/osd/sdl.lua index 4cb31f38083..2753f252e14 100644 --- a/scripts/src/osd/sdl.lua +++ b/scripts/src/osd/sdl.lua @@ -313,6 +313,8 @@ project ("osd_" .. _OPTIONS["osd"]) uuid (os.uuid("osd_" .. _OPTIONS["osd"])) kind (LIBTYPE) + addprojectflags() + dofile("sdl_cfg.lua") osdmodulesbuild() @@ -416,6 +418,8 @@ project ("ocore_" .. _OPTIONS["osd"]) "SingleOutputDir", } + addprojectflags() + dofile("sdl_cfg.lua") includedirs { @@ -475,6 +479,8 @@ if _OPTIONS["with-tools"] then flags { "Symbols", -- always include minimum symbols for executables } + + addprojectflags() dofile("sdl_cfg.lua") @@ -537,6 +543,8 @@ if _OPTIONS["targetos"] == "macosx" and _OPTIONS["with-tools"] then "Symbols", -- always include minimum symbols for executables } + addprojectflags() + dofile("sdl_cfg.lua") if _OPTIONS["SEPARATE_BIN"]~="1" then diff --git a/scripts/src/osd/windows.lua b/scripts/src/osd/windows.lua index 32b15ef0431..a855e6c6636 100644 --- a/scripts/src/osd/windows.lua +++ b/scripts/src/osd/windows.lua @@ -107,6 +107,8 @@ project ("osd_" .. _OPTIONS["osd"]) dofile("windows_cfg.lua") osdmodulesbuild() + addprojectflags() + defines { "DIRECT3D_VERSION=0x0900", } @@ -197,6 +199,8 @@ project ("ocore_" .. _OPTIONS["osd"]) "SingleOutputDir", } + addprojectflags() + dofile("windows_cfg.lua") includedirs { @@ -264,6 +268,8 @@ if _OPTIONS["with-tools"] then uuid ("061293ca-7290-44ac-b2b5-5913ae8dc9c0") kind "ConsoleApp" + addprojectflags() + flags { "Symbols", -- always include minimum symbols for executables } diff --git a/scripts/target/mame/arcade.lua b/scripts/target/mame/arcade.lua index 0324aa32895..5d65732f54a 100644 --- a/scripts/target/mame/arcade.lua +++ b/scripts/target/mame/arcade.lua @@ -765,6 +765,7 @@ function createMAMEProjects(_target, _subtarget, _name) targetsubdir(_target .."_" .. _subtarget) kind (LIBTYPE) uuid (os.uuid("drv-" .. _target .."_" .. _subtarget .. "_" .._name)) + addprojectflags() includedirs { MAME_DIR .. "src/osd", diff --git a/scripts/target/mame/dummy.lua b/scripts/target/mame/dummy.lua index 857548f7382..9d7a986f714 100644 --- a/scripts/target/mame/dummy.lua +++ b/scripts/target/mame/dummy.lua @@ -17,6 +17,7 @@ function createProjects_mame_dummy(_target, _subtarget) targetsubdir(_target .."_" .. _subtarget) kind (LIBTYPE) uuid (os.uuid("drv-mame_dummy")) + addprojectflags() includedirs { MAME_DIR .. "src/osd", diff --git a/scripts/target/mame/mess.lua b/scripts/target/mame/mess.lua index 5b16be78d7e..60ecf006397 100644 --- a/scripts/target/mame/mess.lua +++ b/scripts/target/mame/mess.lua @@ -882,6 +882,7 @@ function createMESSProjects(_target, _subtarget, _name) targetsubdir(_target .."_" .. _subtarget) kind (LIBTYPE) uuid (os.uuid("drv-" .. _target .."_" .. _subtarget .. "_" .._name)) + addprojectflags() includedirs { MAME_DIR .. "src/osd", diff --git a/scripts/target/mame/tiny.lua b/scripts/target/mame/tiny.lua index 3faebd75261..6aba11b51e7 100644 --- a/scripts/target/mame/tiny.lua +++ b/scripts/target/mame/tiny.lua @@ -80,6 +80,7 @@ function createProjects_mame_tiny(_target, _subtarget) targetsubdir(_target .."_" .. _subtarget) kind (LIBTYPE) uuid (os.uuid("drv-mame-tiny")) + addprojectflags() includedirs { MAME_DIR .. "src/osd", -- cgit v1.2.3-70-g09d2 From 9a2ed1703acb949dad20b92d9db93f6e9a5e3e32 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Fri, 11 Dec 2015 13:59:37 +0100 Subject: tagged_list without tagmap_t (nw) --- scripts/src/lib.lua | 1 - src/emu/machine.cpp | 32 ------ src/emu/video.cpp | 9 -- src/lib/util/tagmap.cpp | 20 ---- src/lib/util/tagmap.h | 261 ++---------------------------------------------- 5 files changed, 7 insertions(+), 316 deletions(-) delete mode 100644 src/lib/util/tagmap.cpp (limited to 'scripts/src/lib.lua') diff --git a/scripts/src/lib.lua b/scripts/src/lib.lua index 8c9162ccd65..833504a92f7 100644 --- a/scripts/src/lib.lua +++ b/scripts/src/lib.lua @@ -86,7 +86,6 @@ project "utils" MAME_DIR .. "src/lib/util/pool.h", MAME_DIR .. "src/lib/util/sha1.cpp", MAME_DIR .. "src/lib/util/sha1.h", - MAME_DIR .. "src/lib/util/tagmap.cpp", MAME_DIR .. "src/lib/util/tagmap.h", MAME_DIR .. "src/lib/util/unicode.cpp", MAME_DIR .. "src/lib/util/unicode.h", diff --git a/src/emu/machine.cpp b/src/emu/machine.cpp index 16b11f5a970..c2f0a2c85e3 100644 --- a/src/emu/machine.cpp +++ b/src/emu/machine.cpp @@ -354,11 +354,6 @@ int running_machine::run(bool firstrun) // perform a soft reset -- this takes us to the running phase soft_reset(); -#ifdef MAME_DEBUG - g_tagmap_finds = 0; - if (strcmp(config().m_gamedrv.name, "___empty") != 0) - g_tagmap_counter_enabled = true; -#endif // handle initial load if (m_saveload_schedule != SLS_NONE) handle_saveload(); @@ -392,15 +387,6 @@ int running_machine::run(bool firstrun) // and out via the exit phase m_current_phase = MACHINE_PHASE_EXIT; -#ifdef MAME_DEBUG - if (g_tagmap_counter_enabled) - { - g_tagmap_counter_enabled = false; - if (*(options().command()) == 0) - osd_printf_info("%d tagmap lookups\n", g_tagmap_finds); - } -#endif - // save the NVRAM and configuration sound().ui_mute(true); nvram_save(); @@ -443,15 +429,6 @@ int running_machine::run(bool firstrun) // in case we got here via exception m_current_phase = MACHINE_PHASE_EXIT; -#ifdef MAME_DEBUG - if (g_tagmap_counter_enabled) - { - g_tagmap_counter_enabled = false; - if (*(options().command()) == 0) - osd_printf_info("%d tagmap lookups\n", g_tagmap_finds); - } -#endif - // call all exit callbacks registered call_notifiers(MACHINE_NOTIFY_EXIT); zip_file_cache_clear(); @@ -473,15 +450,6 @@ void running_machine::schedule_exit() // if we're executing, abort out immediately m_scheduler.eat_all_cycles(); -#ifdef MAME_DEBUG - if (g_tagmap_counter_enabled) - { - g_tagmap_counter_enabled = false; - if (*(options().command()) == 0) - osd_printf_info("%d tagmap lookups\n", g_tagmap_finds); - } -#endif - // if we're autosaving on exit, schedule a save as well if (options().autosave() && (m_system.flags & MACHINE_SUPPORTS_SAVE) && this->time() > attotime::zero) schedule_save("auto"); diff --git a/src/emu/video.cpp b/src/emu/video.cpp index ea50e8a662b..1d7c9096b3a 100644 --- a/src/emu/video.cpp +++ b/src/emu/video.cpp @@ -1037,15 +1037,6 @@ void video_manager::recompute_speed(const attotime &emutime) // if we're past the "time-to-execute" requested, signal an exit if (m_seconds_to_run != 0 && emutime.seconds() >= m_seconds_to_run) { -#ifdef MAME_DEBUG - if (g_tagmap_counter_enabled) - { - g_tagmap_counter_enabled = false; - if (*(machine().options().command()) == 0) - osd_printf_info("%d tagmap lookups\n", g_tagmap_finds); - } -#endif - if (machine().first_screen() != nullptr) { // create a final screenshot diff --git a/src/lib/util/tagmap.cpp b/src/lib/util/tagmap.cpp deleted file mode 100644 index 7995b578314..00000000000 --- a/src/lib/util/tagmap.cpp +++ /dev/null @@ -1,20 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Aaron Giles -/*************************************************************************** - - tagmap.c - - tagmap counter - -***************************************************************************/ - -#include - -#include "tagmap.h" - -#ifdef MAME_DEBUG -/** @brief The tagmap finds. */ -INT32 g_tagmap_finds = 0; -/** @brief true to enable, false to disable the tagmap counter. */ -bool g_tagmap_counter_enabled = false; -#endif diff --git a/src/lib/util/tagmap.h b/src/lib/util/tagmap.h index 23bcdd30470..aa456c8ff5e 100644 --- a/src/lib/util/tagmap.h +++ b/src/lib/util/tagmap.h @@ -17,11 +17,7 @@ #include "coretmpl.h" #include #include -#ifdef MAME_DEBUG -#include "eminline.h" -#endif - - +#include //************************************************************************** // CONSTANTS @@ -33,169 +29,6 @@ enum tagmap_error TMERR_DUPLICATE }; - -#ifdef MAME_DEBUG -extern INT32 g_tagmap_finds; -extern bool g_tagmap_counter_enabled; -#endif - -//************************************************************************** -// TYPE DEFINITIONS -//************************************************************************** - -// generally used for small tables, though the hash size can be increased -// as necessary; good primes are: 53, 97, 193, 389, 769, 1543, 3079, 6151, etc -template -class tagmap_t -{ -private: - // disable copying/assignment - tagmap_t(const tagmap_t &); - tagmap_t &operator=(const tagmap_t &); - -public: - // an entry in the table - class entry_t - { - friend class tagmap_t<_ElementType, _HashSize>; - - public: - // construction/destruction - entry_t(const char *tag, UINT32 fullhash, _ElementType object) - : m_next(nullptr), - m_fullhash(fullhash), - m_tag(tag), - m_object(std::move(object)) { } - - // accessors - const std::string &tag() const { return m_tag; } - _ElementType object() const { return m_object; } - - // setters - void set_object(_ElementType object) { m_object = object; } - - private: - // internal helpers - entry_t *next() const { return m_next; } - UINT32 fullhash() const { return m_fullhash; } - - // internal state - entry_t * m_next; - UINT32 m_fullhash; - std::string m_tag; - _ElementType m_object; - }; - - // construction/destruction - tagmap_t() { memset(m_table, 0, sizeof(m_table)); } - ~tagmap_t() { reset(); } - - // core hashing function - UINT32 hash(const char *string) const - { - UINT32 result = *string++; - for (UINT8 c = *string++; c != 0; c = *string++) - result = (result*33) ^ c; - return result; - } - - // empty the list - void reset() - { - for (auto & elem : m_table) - while (elem != nullptr) - remove_common(&elem); - } - - // add/remove - tagmap_error add(const char *tag, _ElementType object, bool replace_if_duplicate = false) { return add_common(tag, object, replace_if_duplicate, false); } - tagmap_error add_unique_hash(const char *tag, _ElementType object, bool replace_if_duplicate = false) { return add_common(tag, object, replace_if_duplicate, true); } - - // remove by tag - void remove(const char *tag) - { - UINT32 fullhash = hash(tag); - for (entry_t **entryptr = &m_table[fullhash % ARRAY_LENGTH(m_table)]; *entryptr != nullptr; entryptr = &(*entryptr)->m_next) - if ((*entryptr)->fullhash() == fullhash && (*entryptr)->tag() == tag) - return remove_common(entryptr); - } - - // remove by object - void remove(_ElementType object) - { - for (auto & elem : m_table) - for (entry_t **entryptr = &elem; *entryptr != nullptr; entryptr = &(*entryptr)->m_next) - if ((*entryptr)->object() == object) - return remove_common(entryptr); - } - - // find by tag - _ElementType find(const char *tag) const { return find(tag, hash(tag)); } - - // find by tag with precomputed hash - _ElementType find(const char *tag, UINT32 fullhash) const - { -#ifdef MAME_DEBUG - if (g_tagmap_counter_enabled) - atomic_increment32(&g_tagmap_finds); -#endif - for (entry_t *entry = m_table[fullhash % ARRAY_LENGTH(m_table)]; entry != nullptr; entry = entry->next()) - if (entry->fullhash() == fullhash && entry->tag() == tag) - return entry->object(); - return _ElementType(NULL); - } - - // find by tag without checking anything but the hash - _ElementType find_hash_only(const char *tag) const - { -#ifdef MAME_DEBUG - if (g_tagmap_counter_enabled) - atomic_increment32(&g_tagmap_finds); -#endif - UINT32 fullhash = hash(tag); - for (entry_t *entry = m_table[fullhash % ARRAY_LENGTH(m_table)]; entry != nullptr; entry = entry->next()) - if (entry->fullhash() == fullhash) - return entry->object(); - return nullptr; - } - - // return first object in the table - entry_t *first() const { return next(NULL); } - - // return next object in the table - entry_t *next(entry_t *after) const - { - // if there's another item in this hash bucket, just return it - if (after != NULL && after->next() != NULL) - return after->next(); - - // otherwise scan forward for the next bucket with an entry - UINT32 firstindex = (after != NULL) ? (after->fullhash() % ARRAY_LENGTH(m_table) + 1) : 0; - for (UINT32 hashindex = firstindex; hashindex < ARRAY_LENGTH(m_table); hashindex++) - if (m_table[hashindex] != NULL) - return m_table[hashindex]; - - // all out - return NULL; - } - -private: - // internal helpers - tagmap_error add_common(const char *tag, _ElementType object, bool replace_if_duplicate, bool unique_hash); - - // remove an entry given a pointer to its pointer - void remove_common(entry_t **entryptr) - { - entry_t *entry = *entryptr; - *entryptr = entry->next(); - global_free(entry); - } - - // internal state - entry_t * m_table[_HashSize]; -}; - - // ======================> tagged_list class add_exception @@ -225,12 +58,12 @@ public: int count() const { return m_list.count(); } // remove (free) all objects in the list, leaving an empty list - void reset() { m_list.reset(); m_map.reset(); } + void reset() { m_list.reset(); m_map.clear(); } // add the given object to the head of the list _ElementType &prepend(const char *tag, _ElementType &object) { - if (m_map.add_unique_hash(tag, &object, false) != TMERR_NONE) + if (!m_map.insert(std::make_pair(tag, &object)).second) throw add_exception(tag); return m_list.prepend(object); } @@ -238,100 +71,20 @@ public: // add the given object to the tail of the list _ElementType &append(const char *tag, _ElementType &object) { - if (m_map.add_unique_hash(tag, &object, false) != TMERR_NONE) + if (!m_map.insert(std::make_pair(tag, &object)).second) throw add_exception(tag); return m_list.append(object); } - // insert the given object after a particular object (NULL means prepend) - _ElementType &insert_after(const char *tag, _ElementType &object, _ElementType *insert_after) - { - if (m_map.add_unique_hash(tag, &object, false) != TMERR_NONE) - throw add_exception(tag); - return m_list.insert_after(object, insert_after); - } - - // replace an item in the list at the same location, and remove it - _ElementType &replace_and_remove(const char *tag, _ElementType &object, _ElementType &toreplace) - { - m_map.remove(&toreplace); - m_list.replace_and_remove(object, toreplace); - if (m_map.add_unique_hash(tag, &object, false) != TMERR_NONE) - throw add_exception(tag); - return object; - } - - // detach the given item from the list, but don't free its memory - _ElementType &detach(_ElementType &object) - { - m_map.remove(&object); - return m_list.detach(object); - } - - // remove the given object and free its memory - void remove(_ElementType &object) - { - m_map.remove(&object); - return m_list.remove(object); - } - - // find an object by index in the list - _ElementType *find(int index) const - { - return m_list.find(index); - } - - // return the index of the given object in the list - int indexof(const _ElementType &object) const - { - return m_list.indexof(object); - } - // operations by tag - _ElementType &replace_and_remove(const char *tag, _ElementType &object) { _ElementType *existing = find(tag); return (existing == NULL) ? append(tag, object) : replace_and_remove(tag, object, *existing); } - void remove(const char *tag) { _ElementType *object = find(tag); if (object != nullptr) remove(*object); } - _ElementType *find(const char *tag) const { return m_map.find_hash_only(tag); } - int indexof(const char *tag) const { _ElementType *object = find(tag); return (object != NULL) ? m_list.indexof(*object) : NULL; } + void remove(const char *tag) { auto search = m_map.find(tag); if (search != m_map.end()) m_list.remove(*search->second); } + _ElementType *find(const char *tag) const { auto search = m_map.find(tag); return (search == m_map.end()) ? nullptr : search->second; } private: // internal state simple_list<_ElementType> m_list; - tagmap_t<_ElementType *> m_map; + std::unordered_map m_map; }; - -//************************************************************************** -// IMPLEMENTATION -//************************************************************************** - -//------------------------------------------------- -// add_common - core implementation of a tagmap -// addition -//------------------------------------------------- - -template -tagmap_error tagmap_t<_ElementType, _HashSize>::add_common(const char *tag, _ElementType object, bool replace_if_duplicate, bool unique_hash) -{ - UINT32 fullhash = hash(tag); - UINT32 hashindex = fullhash % ARRAY_LENGTH(m_table); - - // first make sure we don't have a duplicate - for (entry_t *entry = m_table[hashindex]; entry != nullptr; entry = entry->next()) - if (entry->fullhash() == fullhash) - if (unique_hash || entry->tag() == tag) - { - if (replace_if_duplicate) - entry->set_object(object); - return TMERR_DUPLICATE; - } - - // now allocate a new entry and add to the head of the list - auto entry = global_alloc(entry_t(tag, fullhash, object)); - entry->m_next = m_table[hashindex]; - m_table[hashindex] = entry; - return TMERR_NONE; -} - - #endif /* __TAGMAP_H__ */ -- cgit v1.2.3-70-g09d2