Fixes for the khash changes.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2117 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
fc88dc959f
commit
3ae9bebe33
@ -45,7 +45,7 @@ spinlock team_spinlock = 0;
|
||||
static struct team *create_team_struct(const char *name, bool kernel);
|
||||
static void delete_team_struct(struct team *p);
|
||||
static int team_struct_compare(void *_p, const void *_key);
|
||||
static unsigned int team_struct_hash(void *_p, const void *_key, unsigned int range);
|
||||
static uint32 team_struct_hash(void *_p, const void *_key, uint32 range);
|
||||
static void kfree_strings_array(char **strings, int strc);
|
||||
static int user_copy_strings_array(char **strings, int strc, char ***kstrings);
|
||||
static void _dump_team_info(struct team *p);
|
||||
@ -301,21 +301,23 @@ team_struct_compare(void *_p, const void *_key)
|
||||
struct team *p = _p;
|
||||
const struct team_key *key = _key;
|
||||
|
||||
if(p->id == key->id) return 0;
|
||||
else return 1;
|
||||
if (p->id == key->id)
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
static unsigned int
|
||||
team_struct_hash(void *_p, const void *_key, unsigned int range)
|
||||
static uint32
|
||||
team_struct_hash(void *_p, const void *_key, uint32 range)
|
||||
{
|
||||
struct team *p = _p;
|
||||
const struct team_key *key = _key;
|
||||
|
||||
if (p != NULL)
|
||||
return (p->id % range);
|
||||
return p->id % range;
|
||||
|
||||
return (key->id % range);
|
||||
return key->id % range;
|
||||
}
|
||||
|
||||
|
||||
|
@ -75,7 +75,9 @@ static int region_compare(void *_r, const void *key)
|
||||
return -1;
|
||||
}
|
||||
|
||||
static unsigned int region_hash(void *_r, const void *key, unsigned int range)
|
||||
|
||||
static uint32
|
||||
region_hash(void *_r, const void *key, uint32 range)
|
||||
{
|
||||
vm_region *r = _r;
|
||||
const region_id *id = key;
|
||||
@ -86,7 +88,9 @@ static unsigned int region_hash(void *_r, const void *key, unsigned int range)
|
||||
return (*id % range);
|
||||
}
|
||||
|
||||
static int aspace_compare(void *_a, const void *key)
|
||||
|
||||
static int
|
||||
aspace_compare(void *_a, const void *key)
|
||||
{
|
||||
vm_address_space *aspace = _a;
|
||||
const aspace_id *id = key;
|
||||
@ -97,7 +101,9 @@ static int aspace_compare(void *_a, const void *key)
|
||||
return -1;
|
||||
}
|
||||
|
||||
static unsigned int aspace_hash(void *_a, const void *key, unsigned int range)
|
||||
|
||||
static uint32
|
||||
aspace_hash(void *_a, const void *key, uint32 range)
|
||||
{
|
||||
vm_address_space *aspace = _a;
|
||||
const aspace_id *id = key;
|
||||
|
@ -44,7 +44,8 @@ static int page_compare_func(void *_p, const void *_key)
|
||||
|
||||
#define HASH(offset, ref) ((unsigned int)(offset >> 12) ^ ((unsigned int)(ref)>>4))
|
||||
|
||||
static unsigned int page_hash_func(void *_p, const void *_key, unsigned int range)
|
||||
static uint32
|
||||
page_hash_func(void *_p, const void *_key, uint32 range)
|
||||
{
|
||||
vm_page *p = _p;
|
||||
const struct page_lookup_key *key = _key;
|
||||
|
Loading…
Reference in New Issue
Block a user