Changeset 5e801dc in mainline for uspace/srv/ns
- Timestamp:
- 2019-02-25T14:42:38Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a4e78743
- Parents:
- ee8d4d6
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2019-02-25 14:42:38)
- git-committer:
- GitHub <noreply@…> (2019-02-25 14:42:38)
- Location:
- uspace/srv/ns
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/ns/service.c
ree8d4d6 r5e801dc 65 65 } hashed_iface_t; 66 66 67 static size_t service_key_hash(void *key) 68 { 69 return *(service_t *) key; 67 static size_t service_key_hash(const void *key) 68 { 69 const service_t *srv = key; 70 return *srv; 70 71 } 71 72 … … 78 79 } 79 80 80 static bool service_key_equal(void *key, const ht_link_t *item) 81 { 81 static bool service_key_equal(const void *key, const ht_link_t *item) 82 { 83 const service_t *srv = key; 82 84 hashed_service_t *service = 83 85 hash_table_get_inst(item, hashed_service_t, link); 84 86 85 return service->service == *(service_t *) key; 86 } 87 88 static size_t iface_key_hash(void *key) 89 { 90 return *(iface_t *) key; 87 return service->service == *srv; 88 } 89 90 static size_t iface_key_hash(const void *key) 91 { 92 const iface_t *iface = key; 93 return *iface; 91 94 } 92 95 … … 99 102 } 100 103 101 static bool iface_key_equal(void *key, const ht_link_t *item) 102 { 104 static bool iface_key_equal(const void *key, const ht_link_t *item) 105 { 106 const iface_t *kiface = key; 103 107 hashed_iface_t *iface = 104 108 hash_table_get_inst(item, hashed_iface_t, link); 105 109 106 return iface->iface == * (iface_t *) key;110 return iface->iface == *kiface; 107 111 } 108 112 -
uspace/srv/ns/task.c
ree8d4d6 r5e801dc 54 54 } hashed_task_t; 55 55 56 static size_t task_key_hash(void *key) 57 { 58 return *(task_id_t *)key; 59 } 60 61 static size_t task_hash(const ht_link_t *item) 56 static size_t task_key_hash(const void *key) 57 { 58 const task_id_t *tid = key; 59 return *tid; 60 } 61 62 static size_t task_hash(const ht_link_t *item) 62 63 { 63 64 hashed_task_t *ht = hash_table_get_inst(item, hashed_task_t, link); … … 65 66 } 66 67 67 static bool task_key_equal(void *key, const ht_link_t *item) 68 { 68 static bool task_key_equal(const void *key, const ht_link_t *item) 69 { 70 const task_id_t *tid = key; 69 71 hashed_task_t *ht = hash_table_get_inst(item, hashed_task_t, link); 70 return ht->id == * (task_id_t *)key;72 return ht->id == *tid; 71 73 } 72 74 … … 97 99 /* label-to-id hash table operations */ 98 100 99 static size_t p2i_key_hash( void *key)100 { 101 sysarg_t label = *(sysarg_t *)key;102 return label;101 static size_t p2i_key_hash(const void *key) 102 { 103 const sysarg_t *label = key; 104 return *label; 103 105 } 104 106 … … 109 111 } 110 112 111 static bool p2i_key_equal( void *key, const ht_link_t *item)112 { 113 sysarg_t label = *(sysarg_t *)key;113 static bool p2i_key_equal(const void *key, const ht_link_t *item) 114 { 115 const sysarg_t *label = key; 114 116 p2i_entry_t *entry = hash_table_get_inst(item, p2i_entry_t, link); 115 117 116 return ( label == entry->label);118 return (*label == entry->label); 117 119 } 118 120
Note:
See TracChangeset
for help on using the changeset viewer.