Changeset 9700
- Timestamp:
- Dec 10, 2009, 4:54:48 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/bitfield.c
r9671 r9700 160 160 161 161 tr_bitfield* 162 tr_bitfieldOr( tr_bitfield * a, 163 const tr_bitfield * b ) 164 { 165 uint8_t * ait; 166 const uint8_t *aend, *bit, *bend; 167 168 for( ait = a->bits, aend = ait + a->byteCount, 169 bit = b->bits, bend = bit + b->byteCount; 170 ait != aend && bit != bend; ) 171 { 162 tr_bitfieldOr( tr_bitfield * a, const tr_bitfield * b ) 163 { 164 uint8_t * ait = a->bits; 165 const uint8_t * aend = ait + a->byteCount; 166 const uint8_t * bit = b->bits; 167 const uint8_t * bend = bit + b->byteCount; 168 169 while( ait!=aend && bit!=bend ) 172 170 *ait++ |= *bit++; 173 }174 171 175 172 return a; … … 178 175 /* set 'a' to all the flags that were in 'a' but not 'b' */ 179 176 void 180 tr_bitfieldDifference( tr_bitfield * a, 181 const tr_bitfield * b ) 182 { 183 uint8_t * ait; 184 const uint8_t *aend, *bit; 185 186 assert( a->byteCount == b->byteCount ); 187 188 for( ait = a->bits, bit = b->bits, aend = ait + a->byteCount; 189 ait != aend; ) 177 tr_bitfieldDifference( tr_bitfield * a, const tr_bitfield * b ) 178 { 179 uint8_t * ait = a->bits; 180 const uint8_t * aend = ait + a->byteCount; 181 const uint8_t * bit = b->bits; 182 const uint8_t * bend = bit + b->byteCount; 183 184 while( ait!=aend && bit!=bend ) 190 185 *ait++ &= ~( *bit++ ); 191 186 }
Note: See TracChangeset
for help on using the changeset viewer.