Пример #1
0
static unsigned int tse_hash(const void *ptr)
{
	const TreeStoreElem *tse = ptr;
	union {
		short        h_pair[2];
		unsigned int u_int;
	} hash;

	BLI_assert(tse->type || !tse->nr);

	hash.h_pair[0] = tse->type;
	hash.h_pair[1] = tse->nr;

	hash.u_int ^= BLI_ghashutil_ptrhash(tse->id);

	return hash.u_int;
}
Пример #2
0
unsigned int BLI_ghashutil_pairhash(const void *ptr)
{
	const GHashPair *pair = ptr;
	unsigned int hash = BLI_ghashutil_ptrhash(pair->first);
	return hash ^ BLI_ghashutil_ptrhash(pair->second);
}