Esempio n. 1
0
static MCTextLayoutFont *MCTextLayoutFontFind(const LOGFONTA& p_info)
{
	for(MCTextLayoutFont *t_font = s_fonts; t_font != nil; t_font = t_font -> next)
		if (MCMemoryEqual(&p_info, &t_font -> info, sizeof(LOGFONTA)))
			return t_font;

	return nil;
}
Esempio n. 2
0
static uindex_t MCGCacheTableLookup(MCGCacheTableRef self, void *p_key, uint32_t p_key_length, hash_t p_hash)
{
	uindex_t t_probe;
	t_probe = p_hash % self -> total_buckets;	
	
	if (self -> used_buckets != self -> total_buckets)
	{
		for (uindex_t i = 0; i < self -> total_buckets; i++)
		{
			__MCGCacheTableEntry *t_pair;
			t_pair = &self -> pairs[t_probe];
			
			if (t_pair -> value == NULL || (t_pair -> hash == p_hash && t_pair -> key_length == p_key_length && MCMemoryEqual(p_key, t_pair -> key, p_key_length)))
				return t_probe;
			
			t_probe++;
			if (t_probe >= self -> total_buckets)
				t_probe -= self -> total_buckets;
		}
	}
	
	return UINDEX_MAX;
}