Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 1023758 in mainline


Ignore:
Timestamp:
2016-05-14T06:14:13Z (5 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master
Children:
1cf26ab
Parents:
d249b9d
Message:

Use STATIC_ASSERT instead of ASSERT

Location:
kernel/generic
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/adt/list.h

    rd249b9d r1023758  
    7676#define list_foreach(list, member, itype, iterator) \
    7777        for (itype *iterator = NULL; iterator == NULL; iterator = (itype *) 1) \
    78             for (link_t *_link = (list).head.next; \
    79             iterator = list_get_instance(_link, itype, member), \
    80             _link != &(list).head; _link = _link->next)
     78                for (link_t *_link = (list).head.next; \
     79                    iterator = list_get_instance(_link, itype, member), \
     80                    _link != &(list).head; _link = _link->next)
    8181
    8282#define list_foreach_rev(list, member, itype, iterator) \
    8383        for (itype *iterator = NULL; iterator == NULL; iterator = (itype *) 1) \
    84             for (link_t *_link = (list).head.prev; \
    85             iterator = list_get_instance(_link, itype, member), \
    86             _link != &(list).head; _link = _link->prev)
     84                for (link_t *_link = (list).head.prev; \
     85                    iterator = list_get_instance(_link, itype, member), \
     86                    _link != &(list).head; _link = _link->prev)
    8787
    8888/** Unlike list_foreach(), allows removing items while traversing a list.
     
    113113#define list_foreach_safe(list, iterator, next_iter) \
    114114        for (link_t *iterator = (list).head.next, \
    115                 *next_iter = iterator->next; \
    116                 iterator != &(list).head; \
    117                 iterator = next_iter, next_iter = iterator->next)
     115            *next_iter = iterator->next; \
     116            iterator != &(list).head; \
     117            iterator = next_iter, next_iter = iterator->next)
    118118
    119119       
  • kernel/generic/src/adt/cht.c

    rd249b9d r1023758  
    526526        ASSERT(op && op->hash && op->key_hash && op->equal && op->key_equal);
    527527        /* Memoized hashes are stored in the rcu_link.func function pointer. */
    528         ASSERT(sizeof(size_t) == sizeof(rcu_func_t));
     528        STATIC_ASSERT(sizeof(size_t) == sizeof(rcu_func_t));
    529529        ASSERT(sentinel.hash == (uintptr_t)sentinel.rcu_link.func);
    530530
     
    13111311                }
    13121312        } else {
    1313                 ASSERT(N_JOIN == N_JOIN_FOLLOWS);
     1313                STATIC_ASSERT(N_JOIN == N_JOIN_FOLLOWS);
    13141314               
    13151315                /* Keep the N_JOIN/N_JOIN_FOLLOWS mark but strip N_DELETED. */
Note: See TracChangeset for help on using the changeset viewer.