本文整理汇总了C++中hash_collection::flag方法的典型用法代码示例。如果您正苦于以下问题:C++ hash_collection::flag方法的具体用法?C++ hash_collection::flag怎么用?C++ hash_collection::flag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hash_collection
的用法示例。
在下文中一共展示了hash_collection::flag方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: verify_length_and_hash
static int verify_length_and_hash(emu_file *file, const char *name, UINT32 explength, const hash_collection &hashes)
{
int retVal = 0;
if (file==NULL) return 0;
/* verify length */
UINT32 actlength = file->size();
if (explength != actlength)
{
mame_printf_error("%s WRONG LENGTH (expected: %d found: %d)\n", name, explength, actlength);
retVal++;
}
/* If there is no good dump known, write it */
astring tempstr;
hash_collection &acthashes = file->hashes(hashes.hash_types(tempstr));
if (hashes.flag(hash_collection::FLAG_NO_DUMP))
{
mame_printf_error("%s NO GOOD DUMP KNOWN\n", name);
}
/* verify checksums */
else if (hashes != acthashes)
{
/* otherwise, it's just bad */
mame_printf_error("%s WRONG CHECKSUMS:\n", name);
dump_wrong_and_correct_checksums(hashes, acthashes);
retVal++;
}
/* If it matches, but it is actually a bad dump, write it */
else if (hashes.flag(hash_collection::FLAG_BAD_DUMP))
{
mame_printf_error("%s NEEDS REDUMP\n",name);
}
return retVal;
}
示例2: verify_length_and_hash
static void verify_length_and_hash(romload_private *romdata, const char *name, UINT32 explength, const hash_collection &hashes)
{
/* we've already complained if there is no file */
if (romdata->file == NULL)
return;
/* verify length */
UINT32 actlength = romdata->file->size();
if (explength != actlength)
{
romdata->errorstring.catprintf("%s WRONG LENGTH (expected: %08x found: %08x)\n", name, explength, actlength);
romdata->warnings++;
}
/* If there is no good dump known, write it */
astring tempstr;
hash_collection &acthashes = romdata->file->hashes(hashes.hash_types(tempstr));
if (hashes.flag(hash_collection::FLAG_NO_DUMP))
{
romdata->errorstring.catprintf("%s NO GOOD DUMP KNOWN\n", name);
romdata->knownbad++;
}
/* verify checksums */
else if (hashes != acthashes)
{
/* otherwise, it's just bad */
romdata->errorstring.catprintf("%s WRONG CHECKSUMS:\n", name);
dump_wrong_and_correct_checksums(romdata, hashes, acthashes);
romdata->warnings++;
}
/* If it matches, but it is actually a bad dump, write it */
else if (hashes.flag(hash_collection::FLAG_BAD_DUMP))
{
romdata->errorstring.catprintf("%s ROM NEEDS REDUMP\n",name);
romdata->knownbad++;
}
}
示例3: verify_length_and_hash
void rom_load_manager::verify_length_and_hash(const char *name, UINT32 explength, const hash_collection &hashes)
{
/* we've already complained if there is no file */
if (m_file == nullptr)
return;
/* verify length */
UINT32 actlength = m_file->size();
if (explength != actlength)
{
strcatprintf(m_errorstring, "%s WRONG LENGTH (expected: %08x found: %08x)\n", name, explength, actlength);
m_warnings++;
}
/* If there is no good dump known, write it */
hash_collection &acthashes = m_file->hashes(hashes.hash_types().c_str());
if (hashes.flag(hash_collection::FLAG_NO_DUMP))
{
strcatprintf(m_errorstring, "%s NO GOOD DUMP KNOWN\n", name);
m_knownbad++;
}
/* verify checksums */
else if (hashes != acthashes)
{
/* otherwise, it's just bad */
strcatprintf(m_errorstring, "%s WRONG CHECKSUMS:\n", name);
dump_wrong_and_correct_checksums(hashes, acthashes);
m_warnings++;
}
/* If it matches, but it is actually a bad dump, write it */
else if (hashes.flag(hash_collection::FLAG_BAD_DUMP))
{
strcatprintf(m_errorstring, "%s ROM NEEDS REDUMP\n",name);
m_knownbad++;
}
}