Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/devman/devtree.c

    r3083c74 r5e801dc  
    4242/* hash table operations */
    4343
    44 static inline size_t handle_key_hash(void *key)
    45 {
    46         devman_handle_t handle = *(devman_handle_t *)key;
    47         return handle;
     44static inline size_t handle_key_hash(const void *key)
     45{
     46        const devman_handle_t *handle = key;
     47        return *handle;
    4848}
    4949
     
    6060}
    6161
    62 static bool devman_devices_key_equal(void *key, const ht_link_t *item)
    63 {
    64         devman_handle_t handle = *(devman_handle_t *)key;
     62static bool devman_devices_key_equal(const void *key, const ht_link_t *item)
     63{
     64        const devman_handle_t *handle = key;
    6565        dev_node_t *dev = hash_table_get_inst(item, dev_node_t, devman_dev);
    66         return dev->handle == handle;
    67 }
    68 
    69 static bool devman_functions_key_equal(void *key, const ht_link_t *item)
    70 {
    71         devman_handle_t handle = *(devman_handle_t *)key;
     66        return dev->handle == *handle;
     67}
     68
     69static bool devman_functions_key_equal(const void *key, const ht_link_t *item)
     70{
     71        const devman_handle_t *handle = key;
    7272        fun_node_t *fun = hash_table_get_inst(item, fun_node_t, devman_fun);
    73         return fun->handle == handle;
    74 }
    75 
    76 static inline size_t service_id_key_hash(void *key)
    77 {
    78         service_id_t service_id = *(service_id_t *)key;
    79         return service_id;
     73        return fun->handle == *handle;
     74}
     75
     76static inline size_t service_id_key_hash(const void *key)
     77{
     78        const service_id_t *service_id = key;
     79        return *service_id;
    8080}
    8181
     
    8686}
    8787
    88 static bool loc_functions_key_equal(void *key, const ht_link_t *item)
    89 {
    90         service_id_t service_id = *(service_id_t *)key;
     88static bool loc_functions_key_equal(const void *key, const ht_link_t *item)
     89{
     90        const service_id_t *service_id = key;
    9191        fun_node_t *fun = hash_table_get_inst(item, fun_node_t, loc_fun);
    92         return fun->service_id == service_id;
     92        return fun->service_id == *service_id;
    9393}
    9494
Note: See TracChangeset for help on using the changeset viewer.