Changeset 205832b in mainline for kernel/generic/src/adt/cht.c


Ignore:
Timestamp:
2012-11-05T15:37:39Z (12 years ago)
Author:
Adam Hraska <adam.hraska+hos@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f048658
Parents:
6b99156
Message:

Replaced 0 with NULL where appropriate (in rcu, cht, uspace hashtable, smp_call, workqueue).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/adt/cht.c

    r6b99156 r205832b  
    151151/* Sentinel node used by all buckets. Stores the greatest possible hash value.*/
    152152static const cht_link_t sentinel = {
    153         .link = 0,
     153        /* NULL and N_NORMAL */
     154        .link = 0 | N_NORMAL,
    154155        .hash = -1
    155156};
     
    265266        h->max_load = (max_load == 0) ? CHT_MAX_LOAD : max_load;
    266267        h->min_order = min_order;
    267         h->new_b = 0;
     268        h->new_b = NULL;
    268269        h->op = op;
    269270        atomic_set(&h->item_cnt, 0);
     
    298299       
    299300        if (!b)
    300                 return 0;
     301                return NULL;
    301302       
    302303        b->order = order;
     
    346347       
    347348        free(h->b);
    348         h->b = 0;
     349        h->b = NULL;
    349350       
    350351        /* You must clear the table of items. Otherwise cht_destroy will leak. */
     
    457458         */
    458459
    459         cht_link_t *cur = 0;
     460        cht_link_t *cur = NULL;
    460461        marked_ptr_t prev = head;
    461462
     
    492493        }
    493494       
    494         return 0;
     495        return NULL;
    495496}
    496497
     
    607608                         * points to an allocated join node (if non-null) even if marked
    608609                         * invalid. Before the resizer lets join nodes to be unlinked
    609                          * (and freed) it sets old_head to 0 and waits for a grace period.
     610                         * (and freed) it sets old_head to NULL and waits for a grace period.
    610611                         * So either the invalid old_head points to join node; or old_head
    611612                         * is null and we would have seen a completed bucket join while
     
    616617                }
    617618               
    618                 return 0;
     619                return NULL;
    619620        } else {
    620621                /*
     
    700701                        .ppred = phead,
    701702                        .cur = get_next(*phead),
    702                         .last = 0
     703                        .last = NULL
    703704                };
    704705               
     
    807808         */
    808809        read_barrier();
    809         return 0 != find_duplicate(h, item, hash, wnd->cur);
     810        return NULL != find_duplicate(h, item, hash, wnd->cur);
    810811}
    811812
     
    840841        }
    841842       
    842         return 0;       
     843        return NULL;
    843844}
    844845
     
    908909                        .ppred = phead,
    909910                        .cur = get_next(*phead),
    910                         .last = 0
     911                        .last = NULL
    911912                };
    912913               
     
    11941195        }
    11951196
    1196         /* wnd->cur may be 0 or even marked N_DELETED. */
     1197        /* wnd->cur may be NULL or even marked N_DELETED. */
    11971198        return true;
    11981199}
     
    19661967       
    19671968        /* Not needed; just for increased readability. */
    1968         h->new_b = 0;
     1969        h->new_b = NULL;
    19691970}
    19701971
     
    20652066       
    20662067        /* Not needed; just for increased readability. */
    2067         h->new_b = 0;
     2068        h->new_b = NULL;
    20682069}
    20692070
     
    21442145
    21452146        wnd_t wnd = {
    2146                 .ppred = 0,
    2147                 .cur = 0
     2147                .ppred = NULL,
     2148                .cur = NULL
    21482149        };
    21492150        marked_ptr_t *cur_link = new_head;
Note: See TracChangeset for help on using the changeset viewer.