Chops off the n lowest bits from a bit pattern. Returns the n lowest bits. As a side effect, the original bit pattern will be shifted to the right by n bits.
| 2722 | // lowest bits. As a side effect, the original bit pattern will be |
| 2723 | // shifted to the right by n bits. |
| 2724 | inline UInt32 ChopLowBits(UInt32* bits, int n) { |
| 2725 | const UInt32 low_bits = *bits & ((static_cast<UInt32>(1) << n) - 1); |
| 2726 | *bits >>= n; |
| 2727 | return low_bits; |
| 2728 | } |
| 2729 | |
| 2730 | // Converts a Unicode code point to a narrow string in UTF-8 encoding. |
| 2731 | // code_point parameter is of type UInt32 because wchar_t may not be |