267 return (void*) &iter->entry; |
267 return (void*) &iter->entry; |
268 } |
268 } |
269 |
269 |
270 static void *cx_hash_map_iter_current_key(const void *it) { |
270 static void *cx_hash_map_iter_current_key(const void *it) { |
271 const CxMapIterator *iter = it; |
271 const CxMapIterator *iter = it; |
272 struct cx_hash_map_element_s *elm = iter->elem; |
272 return (void*) iter->entry.key; |
273 return &elm->key; |
|
274 } |
273 } |
275 |
274 |
276 static void *cx_hash_map_iter_current_value(const void *it) { |
275 static void *cx_hash_map_iter_current_value(const void *it) { |
277 const CxMapIterator *iter = it; |
276 const CxMapIterator *iter = it; |
278 const CxMap *map = iter->map.c; |
277 return iter->entry.value; |
279 struct cx_hash_map_element_s *elm = iter->elem; |
|
280 if (map->collection.store_pointer) { |
|
281 return *(void **) elm->data; |
|
282 } else { |
|
283 return elm->data; |
|
284 } |
|
285 } |
278 } |
286 |
279 |
287 static bool cx_hash_map_iter_valid(const void *it) { |
280 static bool cx_hash_map_iter_valid(const void *it) { |
288 const CxMapIterator *iter = it; |
281 const CxMapIterator *iter = it; |
289 return iter->elem != NULL; |
282 return iter->elem != NULL; |