Changeset b72efe8 in mainline for uspace/lib/c/include/ipc/devman.h


Ignore:
Timestamp:
2011-06-19T14:38:59Z (13 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
74464e8
Parents:
1d1bb0f
Message:

Separate list_t typedef from link_t (user-space part).

  • list_t represents lists
  • Use list_first(), list_last(), list_empty() where appropriate
  • Use list_foreach() where possible
  • assert_link_not_used()
  • usb_hid_report_path_free() shall not unlink the path, caller must do it
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/ipc/devman.h

    r1d1bb0f rb72efe8  
    7272 */
    7373typedef struct match_id_list {
    74         link_t ids;
     74        list_t ids;
    7575} match_id_list_t;
    7676
     
    9595{
    9696        match_id_t *mid = NULL;
    97         link_t *link = ids->ids.next;
     97        link_t *link = ids->ids.head.next;
    9898       
    99         while (link != &ids->ids) {
     99        while (link != &ids->ids.head) {
    100100                mid = list_get_instance(link, match_id_t,link);
    101101                if (mid->score < id->score) {
    102102                        break;
    103                 }       
     103                }
    104104                link = link->next;
    105105        }
     
    118118        match_id_t *id;
    119119       
    120         while(!list_empty(&ids->ids)) {
    121                 link = ids->ids.next;
    122                 list_remove(link);             
     120        while (!list_empty(&ids->ids)) {
     121                link = list_first(&ids->ids);
     122                list_remove(link);
    123123                id = list_get_instance(link, match_id_t, link);
    124                 delete_match_id(id);           
    125         }       
     124                delete_match_id(id);
     125        }
    126126}
    127127
Note: See TracChangeset for help on using the changeset viewer.