MCPcopy Create free account
hub / github.com/RsyncProject/rsync / bi_reverse

Function bi_reverse

zlib/trees.c:1091–1099  ·  view source on GitHub ↗

=========================================================================== * Reverse the first len bits of a code, using straightforward code (a faster * method would use a table) * IN assertion: 1 <= len <= 15 */

Source from the content-addressed store, hash-verified

1089 * IN assertion: 1 <= len <= 15
1090 */
1091local unsigned bi_reverse(unsigned code, int len)
1092{
1093 register unsigned res = 0;
1094 do {
1095 res |= code & 1;
1096 code >>= 1, res <<= 1;
1097 } while (--len > 0);
1098 return res >> 1;
1099}
1100
1101/* ===========================================================================
1102 * Flush the bit buffer, keeping at most 7 bits in it.

Callers 2

tr_static_initFunction · 0.85
gen_codesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected