当前位置: 首页>>代码示例>>C++>>正文


C++ hash_collection::hash_types方法代码示例

本文整理汇总了C++中hash_collection::hash_types方法的典型用法代码示例。如果您正苦于以下问题:C++ hash_collection::hash_types方法的具体用法?C++ hash_collection::hash_types怎么用?C++ hash_collection::hash_types使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在hash_collection的用法示例。


在下文中一共展示了hash_collection::hash_types方法的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;
}
开发者ID:CJBass,项目名称:mame2013-libretro,代码行数:35,代码来源:diimage.c

示例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++;
	}
}
开发者ID:jiangzhonghui,项目名称:mame,代码行数:37,代码来源:romload.c

示例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++;
	}
}
开发者ID:notaz,项目名称:mame,代码行数:36,代码来源:romload.cpp


注:本文中的hash_collection::hash_types方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。