Changeset 45671f48 in mainline


Ignore:
Timestamp:
2005-05-11T19:14:15Z (20 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
02a99d2
Parents:
d7568a9f
Message:

typedef short bool (as logical type), defines of false and true
const qualifier for list_member()

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • include/list.h

    rd7568a9f r45671f48  
    7373#define list_get_instance(link,type,member) (type *)(((__u8*)(link))-((__u8*)&(((type *)NULL)->member)))
    7474
    75 extern int list_member(link_t *link, link_t *head);
     75extern bool list_member(const link_t *link, const link_t *head);
    7676extern void list_concat(link_t *head1, link_t *head2);
    7777
  • include/typedefs.h

    rd7568a9f r45671f48  
    2929#ifndef __TYPEDEFS_H__
    3030#define __TYPEDEFS_H__
     31
     32#define false 0
     33#define true 1
     34
     35typedef short bool;
    3136
    3237typedef struct config config_t;
  • src/lib/list.c

    rd7568a9f r45671f48  
    3838 * @param head List to look in.
    3939 *
    40  * @return 1 if link is contained in head, 0 otherwise.
     40 * @return true if link is contained in head, false otherwise.
    4141 *
    4242 */
    43 int list_member(link_t *link, link_t *head)
     43bool list_member(const link_t *link, const link_t *head)
    4444{
    45         int found = 0;
     45        bool found = false;
    4646        link_t *hlp = head->next;
    4747       
    4848        while (hlp != head) {
    4949                if (hlp == link) {
    50                         found = 1;
     50                        found = true;
    5151                        break;
    5252                }
Note: See TracChangeset for help on using the changeset viewer.