lang: types: We should use the platform-dependent int instead

This could be a 32 or 64 bit sized int depending on arch.
This commit is contained in:
James Shubin
2023-08-28 15:54:36 -04:00
parent c1850e0e20
commit 3fb75707e7
3 changed files with 4 additions and 3 deletions

View File

@@ -23,13 +23,14 @@ import (
)
// nextPowerOfTwo gets the lowest number higher than v that is a power of two.
func nextPowerOfTwo(v uint32) uint32 {
func nextPowerOfTwo(v uint) uint {
v--
v |= v >> 1
v |= v >> 2
v |= v >> 4
v |= v >> 8
v |= v >> 16
v |= v >> 32
v++
return v
}