Changeset feeac0d in mainline for uspace/lib/c/generic
- Timestamp:
- 2013-09-10T16:32:35Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4982d87
- Parents:
- e8d6ce2
- Location:
- uspace/lib/c/generic
- Files:
-
- 5 edited
-
adt/hash_table.c (modified) (2 diffs)
-
adt/list.c (modified) (1 diff)
-
cfg.c (modified) (3 diffs)
-
devman.c (modified) (1 diff)
-
pio_trace.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/adt/hash_table.c
re8d6ce2 rfeeac0d 227 227 228 228 /* Check for duplicates. */ 229 list_foreach(h->bucket[idx], cur) {229 list_foreach(h->bucket[idx], link, ht_link_t, cur_link) { 230 230 /* 231 231 * We could filter out items using their hashes first, but 232 232 * calling equal() might very well be just as fast. 233 233 */ 234 ht_link_t *cur_link = member_to_inst(cur, ht_link_t, link);235 234 if (h->op->equal(cur_link, item)) 236 235 return false; … … 258 257 size_t idx = h->op->key_hash(key) % h->bucket_cnt; 259 258 260 list_foreach(h->bucket[idx], cur) { 261 ht_link_t *cur_link = member_to_inst(cur, ht_link_t, link); 259 list_foreach(h->bucket[idx], link, ht_link_t, cur_link) { 262 260 /* 263 261 * Is this is the item we are looking for? We could have first -
uspace/lib/c/generic/adt/list.c
re8d6ce2 rfeeac0d 102 102 unsigned int count = 0; 103 103 104 list_foreach(*list, link) { 104 link_t *link = list_first(list); 105 while (link != NULL) { 105 106 count++; 107 link = list_next(link, list); 106 108 } 107 109 -
uspace/lib/c/generic/cfg.c
re8d6ce2 rfeeac0d 83 83 return true; 84 84 85 list_foreach(data->sections, link) { 86 const cfg_section_t *section = cfg_section_instance(link); 87 85 cfg_file_foreach(data, section) { 88 86 if (!list_empty(§ion->entries)) 89 87 return false; … … 413 411 const cfg_section_t *cfg_find_section(const cfg_file_t *data, const char *title) 414 412 { 415 list_foreach(data->sections, link) { 416 const cfg_section_t *section = cfg_section_instance(link); 417 413 cfg_file_foreach(data, section) { 418 414 if (str_cmp(section->title, title) == 0) 419 415 return section; … … 434 430 const char *cfg_find_value(const cfg_section_t *section, const char *key) 435 431 { 436 list_foreach(section->entries, link) { 437 const cfg_entry_t *entry = cfg_entry_instance(link); 438 432 cfg_section_foreach(section, entry) { 439 433 if (str_cmp(entry->key, key) == 0) 440 434 return entry->value; -
uspace/lib/c/generic/devman.c
re8d6ce2 rfeeac0d 230 230 } 231 231 232 match_id_t *match_id = NULL; 233 234 list_foreach(match_ids->ids, link) { 235 match_id = list_get_instance(link, match_id_t, link); 236 232 list_foreach(match_ids->ids, link, match_id_t, match_id) { 237 233 ipc_call_t answer2; 238 234 aid_t req2 = async_send_1(exch, DEVMAN_ADD_MATCH_ID, -
uspace/lib/c/generic/pio_trace.c
re8d6ce2 rfeeac0d 95 95 pio_regions_t *regions = get_regions(); 96 96 fibril_rwlock_read_lock(®ions->guard); 97 list_foreach(regions->list, it) { 98 assert(it); 99 region_t *reg = region_instance(it); 100 assert(reg); 97 list_foreach(regions->list, link, region_t, reg) { 101 98 if ((r >= reg->base) && (r < reg->base + reg->size)) { 102 99 if (reg->log) … … 131 128 fibril_rwlock_write_lock(®ions->guard); 132 129 list_foreach_safe(regions->list, it, next) { 133 assert(it);134 130 region_t *reg = region_instance(it); 135 assert(reg);136 131 if (r >= reg->base && (r < reg->base + reg->size)) { 137 list_remove(®->link);138 region_destroy(reg);132 list_remove(®->link); 133 region_destroy(reg); 139 134 } 140 135 }
Note:
See TracChangeset
for help on using the changeset viewer.
