Returns the nearest higher power of two. If the value is already a power of two, returns the same value
| 312 | // Returns the nearest higher power of two. |
| 313 | // If the value is already a power of two, returns the same value |
| 314 | DWORD GetNearestPowerOfTwo(DWORD dwFileCount) |
| 315 | { |
| 316 | dwFileCount --; |
| 317 | |
| 318 | dwFileCount |= dwFileCount >> 1; |
| 319 | dwFileCount |= dwFileCount >> 2; |
| 320 | dwFileCount |= dwFileCount >> 4; |
| 321 | dwFileCount |= dwFileCount >> 8; |
| 322 | dwFileCount |= dwFileCount >> 16; |
| 323 | |
| 324 | return dwFileCount + 1; |
| 325 | } |
| 326 | /* |
| 327 | DWORD GetNearestPowerOfTwo(DWORD dwFileCount) |
| 328 | { |
no outgoing calls
no test coverage detected