Changeset 205832b in mainline for kernel/generic/src/adt/cht.c
- Timestamp:
- 2012-11-05T15:37:39Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f048658
- Parents:
- 6b99156
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/adt/cht.c
r6b99156 r205832b 151 151 /* Sentinel node used by all buckets. Stores the greatest possible hash value.*/ 152 152 static const cht_link_t sentinel = { 153 .link = 0, 153 /* NULL and N_NORMAL */ 154 .link = 0 | N_NORMAL, 154 155 .hash = -1 155 156 }; … … 265 266 h->max_load = (max_load == 0) ? CHT_MAX_LOAD : max_load; 266 267 h->min_order = min_order; 267 h->new_b = 0;268 h->new_b = NULL; 268 269 h->op = op; 269 270 atomic_set(&h->item_cnt, 0); … … 298 299 299 300 if (!b) 300 return 0;301 return NULL; 301 302 302 303 b->order = order; … … 346 347 347 348 free(h->b); 348 h->b = 0;349 h->b = NULL; 349 350 350 351 /* You must clear the table of items. Otherwise cht_destroy will leak. */ … … 457 458 */ 458 459 459 cht_link_t *cur = 0;460 cht_link_t *cur = NULL; 460 461 marked_ptr_t prev = head; 461 462 … … 492 493 } 493 494 494 return 0;495 return NULL; 495 496 } 496 497 … … 607 608 * points to an allocated join node (if non-null) even if marked 608 609 * invalid. Before the resizer lets join nodes to be unlinked 609 * (and freed) it sets old_head to 0and waits for a grace period.610 * (and freed) it sets old_head to NULL and waits for a grace period. 610 611 * So either the invalid old_head points to join node; or old_head 611 612 * is null and we would have seen a completed bucket join while … … 616 617 } 617 618 618 return 0;619 return NULL; 619 620 } else { 620 621 /* … … 700 701 .ppred = phead, 701 702 .cur = get_next(*phead), 702 .last = 0703 .last = NULL 703 704 }; 704 705 … … 807 808 */ 808 809 read_barrier(); 809 return 0!= find_duplicate(h, item, hash, wnd->cur);810 return NULL != find_duplicate(h, item, hash, wnd->cur); 810 811 } 811 812 … … 840 841 } 841 842 842 return 0;843 return NULL; 843 844 } 844 845 … … 908 909 .ppred = phead, 909 910 .cur = get_next(*phead), 910 .last = 0911 .last = NULL 911 912 }; 912 913 … … 1194 1195 } 1195 1196 1196 /* wnd->cur may be 0or even marked N_DELETED. */1197 /* wnd->cur may be NULL or even marked N_DELETED. */ 1197 1198 return true; 1198 1199 } … … 1966 1967 1967 1968 /* Not needed; just for increased readability. */ 1968 h->new_b = 0;1969 h->new_b = NULL; 1969 1970 } 1970 1971 … … 2065 2066 2066 2067 /* Not needed; just for increased readability. */ 2067 h->new_b = 0;2068 h->new_b = NULL; 2068 2069 } 2069 2070 … … 2144 2145 2145 2146 wnd_t wnd = { 2146 .ppred = 0,2147 .cur = 02147 .ppred = NULL, 2148 .cur = NULL 2148 2149 }; 2149 2150 marked_ptr_t *cur_link = new_head;
Note:
See TracChangeset
for help on using the changeset viewer.