diff options
author | 2016-07-23 12:49:33 -0400 | |
---|---|---|
committer | 2016-07-23 12:49:33 -0400 | |
commit | 4aa0ab1724e8fe19775d6be982ec312604a2a6b3 (patch) | |
tree | 14f54f2739422cb8640c7b51ffd2af8bc7271114 /src/frontend/mame/clifront.cpp | |
parent | 4423c242a693c37fbb4edc50f17c02cdf98abd88 (diff) |
Moved src/emu/hash.[cpp|h] into src/lib/util, and namespaced that code (and hashing.[cpp|h]) into util::
Diffstat (limited to 'src/frontend/mame/clifront.cpp')
-rw-r--r-- | src/frontend/mame/clifront.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/frontend/mame/clifront.cpp b/src/frontend/mame/clifront.cpp index 5f73c8ddea0..0dfaa4c97dd 100644 --- a/src/frontend/mame/clifront.cpp +++ b/src/frontend/mame/clifront.cpp @@ -129,7 +129,7 @@ public: void identify(const char *name); void identify_file(const char *name); void identify_data(const char *name, const UINT8 *data, int length); - int find_by_hash(const hash_collection &hashes, int length); + int find_by_hash(const util::hash_collection &hashes, int length); private: // internal state @@ -260,8 +260,8 @@ void media_identifier::identify_file(const char *name) } // otherwise, get the hash collection for this CHD - hash_collection hashes; - if (chd.sha1() != sha1_t::null) + util::hash_collection hashes; + if (chd.sha1() != util::sha1_t::null) hashes.add_sha1(chd.sha1()); // determine whether this file exists @@ -309,8 +309,8 @@ void media_identifier::identify_data(const char *name, const UINT8 *data, int le } // compute the hash of the data - hash_collection hashes; - hashes.compute(data, length, hash_collection::HASH_TYPES_CRC_SHA1); + util::hash_collection hashes; + hashes.compute(data, length, util::hash_collection::HASH_TYPES_CRC_SHA1); // output the name m_total++; @@ -334,7 +334,7 @@ void media_identifier::identify_data(const char *name, const UINT8 *data, int le // of drivers by hash //------------------------------------------------- -int media_identifier::find_by_hash(const hash_collection &hashes, int length) +int media_identifier::find_by_hash(const util::hash_collection &hashes, int length) { int found = 0; std::unordered_set<std::string> listnames; @@ -352,10 +352,10 @@ int media_identifier::find_by_hash(const hash_collection &hashes, int length) for (const rom_entry *region = rom_first_region(device); region != nullptr; region = rom_next_region(region)) for (const rom_entry *rom = rom_first_file(region); rom != nullptr; rom = rom_next_file(rom)) { - hash_collection romhashes(ROM_GETHASHDATA(rom)); - if (!romhashes.flag(hash_collection::FLAG_NO_DUMP) && hashes == romhashes) + util::hash_collection romhashes(ROM_GETHASHDATA(rom)); + if (!romhashes.flag(util::hash_collection::FLAG_NO_DUMP) && hashes == romhashes) { - bool baddump = romhashes.flag(hash_collection::FLAG_BAD_DUMP); + bool baddump = romhashes.flag(util::hash_collection::FLAG_BAD_DUMP); // output information about the match if (found) @@ -377,10 +377,10 @@ int media_identifier::find_by_hash(const hash_collection &hashes, int length) for (const rom_entry *region = part.romdata(); region != nullptr; region = rom_next_region(region)) for (const rom_entry *rom = rom_first_file(region); rom != nullptr; rom = rom_next_file(rom)) { - hash_collection romhashes(ROM_GETHASHDATA(rom)); + util::hash_collection romhashes(ROM_GETHASHDATA(rom)); if (hashes == romhashes) { - bool baddump = romhashes.flag(hash_collection::FLAG_BAD_DUMP); + bool baddump = romhashes.flag(util::hash_collection::FLAG_BAD_DUMP); // output information about the match if (found) @@ -821,7 +821,7 @@ void cli_frontend::listcrc(const char *gamename) { // if we have a CRC, display it UINT32 crc; - if (hash_collection(ROM_GETHASHDATA(rom)).crc(crc)) + if (util::hash_collection(ROM_GETHASHDATA(rom)).crc(crc)) osd_printf_info("%08x %-16s \t %-8s \t %s\n", crc, ROM_GETNAME(rom), device.shortname(), device.name()); } } @@ -872,10 +872,10 @@ void cli_frontend::listroms(const char *gamename) osd_printf_info(" "); // output the hash data - hash_collection hashes(ROM_GETHASHDATA(rom)); - if (!hashes.flag(hash_collection::FLAG_NO_DUMP)) + util::hash_collection hashes(ROM_GETHASHDATA(rom)); + if (!hashes.flag(util::hash_collection::FLAG_NO_DUMP)) { - if (hashes.flag(hash_collection::FLAG_BAD_DUMP)) + if (hashes.flag(util::hash_collection::FLAG_BAD_DUMP)) osd_printf_info(" BAD"); osd_printf_info(" %s", hashes.macro_string().c_str()); } @@ -1436,8 +1436,8 @@ void cli_frontend::output_single_softlist(FILE *out, software_list_device &swlis fprintf( out, "\t\t\t\t\t<disk name=\"%s\"", xml_normalize_string(ROM_GETNAME(rom)) ); /* dump checksum information only if there is a known dump */ - hash_collection hashes(ROM_GETHASHDATA(rom)); - if ( !hashes.flag(hash_collection::FLAG_NO_DUMP) ) + util::hash_collection hashes(ROM_GETHASHDATA(rom)); + if ( !hashes.flag(util::hash_collection::FLAG_NO_DUMP) ) fprintf( out, " %s", hashes.attribute_string().c_str() ); else fprintf( out, " status=\"nodump\"" ); |