Changeset feeac0d in mainline for uspace/srv/locsrv/category.c


Ignore:
Timestamp:
2013-09-10T16:32:35Z (11 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4982d87
Parents:
e8d6ce2
Message:

Simplify use of list_foreach.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/locsrv/category.c

    re8d6ce2 rfeeac0d  
    7373
    7474        size_t pos = 0;
    75         list_foreach(cdir->categories, item) {
    76                 category_t *cat =
    77                     list_get_instance(item, category_t, cat_list);
    78 
     75        list_foreach(cdir->categories, cat_list, category_t, cat) {
    7976                if (pos < buf_cnt)
    8077                        id_buf[pos] = cat->id;
     
    116113
    117114        /* Verify that category does not contain this service yet. */
    118         list_foreach(cat->svc_memb, item) {
    119                 svc_categ_t *memb = list_get_instance(item, svc_categ_t,
    120                     cat_link);
     115        list_foreach(cat->svc_memb, cat_link, svc_categ_t, memb) {
    121116                if (memb->svc == svc) {
    122117                        return EEXIST;
     
    154149        assert(fibril_mutex_is_locked(&cdir->mutex));
    155150
    156         list_foreach(cdir->categories, item) {
    157                 category_t *cat = list_get_instance(item, category_t,
    158                     cat_list);
     151        list_foreach(cdir->categories, cat_list, category_t, cat) {
    159152                if (cat->id == catid)
    160153                        return cat;
     
    169162        assert(fibril_mutex_is_locked(&cdir->mutex));
    170163
    171         list_foreach(cdir->categories, item) {
    172                 category_t *cat = list_get_instance(item, category_t,
    173                     cat_list);
     164        list_foreach(cdir->categories, cat_list, category_t, cat) {
    174165                if (str_cmp(cat->name, name) == 0)
    175166                        return cat;
     
    197188
    198189        size_t pos = 0;
    199         list_foreach(cat->svc_memb, item) {
    200                 svc_categ_t *memb =
    201                     list_get_instance(item, svc_categ_t, cat_link);
    202 
     190        list_foreach(cat->svc_memb, cat_link, svc_categ_t, memb) {
    203191                if (pos < buf_cnt)
    204192                        id_buf[pos] = memb->svc->id;
Note: See TracChangeset for help on using the changeset viewer.