Changeset 7590


Ignore:
Timestamp:
Jan 3, 2009, 12:11:31 AM (12 years ago)
Author:
charles
Message:

(trunk libT) inline the tr_bencIs*() utility functions

Location:
trunk/libtransmission
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/bencode.c

    r7567 r7590  
    3434***
    3535**/
    36 
    37 tr_bool
    38 tr_bencIsType( const tr_benc * val, int type )
    39 {
    40     return ( val ) && ( val->type == type );
    41 }
    4236
    4337static tr_bool
  • trunk/libtransmission/bencode.h

    r7552 r7590  
    157157tr_bool   tr_bencGetStr( const tr_benc * val, const char ** setme );
    158158
    159 tr_bool   tr_bencIsType( const tr_benc *, int type );
    160 
    161 
    162 #define tr_bencIsInt( b )    tr_bencIsType( ( b ), TYPE_INT )
    163 #define tr_bencIsDict( b )   tr_bencIsType( ( b ), TYPE_DICT )
    164 #define tr_bencIsList( b )   tr_bencIsType( ( b ), TYPE_LIST )
    165 #define tr_bencIsString( b ) tr_bencIsType( ( b ), TYPE_STR )
     159static inline tr_bool tr_bencIsType  ( const tr_benc * b, int type ) { return ( b != NULL ) && ( b->type == type ); }
     160static inline tr_bool tr_bencIsInt   ( const tr_benc * b ) { return tr_bencIsType( b, TYPE_INT ); }
     161static inline tr_bool tr_bencIsDict  ( const tr_benc * b ) { return tr_bencIsType( b, TYPE_DICT ); }
     162static inline tr_bool tr_bencIsList  ( const tr_benc * b ) { return tr_bencIsType( b, TYPE_LIST ); }
     163static inline tr_bool tr_bencIsString( const tr_benc * b ) { return tr_bencIsType( b, TYPE_STR ); }
    166164
    167165/**
Note: See TracChangeset for help on using the changeset viewer.