Changeset 13655
- Timestamp:
- Dec 13, 2012, 2:00:45 AM (8 years ago)
- Location:
- trunk/libtransmission
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/bitfield.c
r13637 r13655 131 131 } 132 132 133 bool 134 tr_bitfieldHas (const tr_bitfield * b, size_t n) 135 { 136 if (tr_bitfieldHasAll (b)) 137 return true; 138 139 if (tr_bitfieldHasNone (b)) 140 return false; 141 142 if (n>>3u >= b->alloc_count) 143 return false; 144 145 return (b->bits[n>>3u] << (n & 7u) & 0x80) != 0; 146 } 147 133 148 /*** 134 149 **** -
trunk/libtransmission/bitfield.h
r13625 r13655 99 99 } 100 100 101 static inline bool 102 tr_bitfieldHas (const tr_bitfield * b, size_t n) 103 { 104 if (tr_bitfieldHasAll (b)) 105 return true; 106 107 if (tr_bitfieldHasNone (b)) 108 return false; 109 110 if (n>>3u >= b->alloc_count) 111 return false; 112 113 return (b->bits[n>>3u] << (n & 7u) & 0x80) != 0; 114 } 101 bool tr_bitfieldHas (const tr_bitfield * b, size_t n); 115 102 116 103 #endif -
trunk/libtransmission/libtransmission-test.h
r13642 r13655 13 13 fprintf (stderr, "%s %s:%d\n", result, __FILE__, __LINE__) 14 14 15 static inlinebool15 static bool 16 16 should_print (bool pass) 17 17 { … … 26 26 } 27 27 28 static inlinebool28 static bool 29 29 check_condition_impl (const char * file, int line, bool condition) 30 30 { … … 37 37 } 38 38 39 static inlinebool39 static bool 40 40 check_streq_impl (const char * file, int line, const char * expected, const char * actual) 41 41 { … … 52 52 } 53 53 54 static inlinebool54 static bool 55 55 check_int_eq_impl (const char * file, int line, int64_t expected, int64_t actual) 56 56 { … … 67 67 } 68 68 69 static inlinebool69 static bool 70 70 check_ptr_eq_impl (const char * file, int line, const void * expected, const void * actual) 71 71 { … … 121 121 #define NUM_TESTS(tarray)((int)(sizeof (tarray)/sizeof (tarray[0]))) 122 122 123 static in line int123 static int 124 124 runTests (const testFunc * const tests, int numTests) 125 125 {
Note: See TracChangeset
for help on using the changeset viewer.