- uint64_t res = w - ((w >> 1) & 0x5555555555555555ul);
- res = (res & 0x3333333333333333ul) + ((res >> 2) & 0x3333333333333333ul);
- res = (res + (res >> 4)) & 0x0F0F0F0F0F0F0F0Ful;
+ uint64_t res = w - ((w >> 1) & 0x5555555555555555ULL);
+ res = (res & 0x3333333333333333ULL) + ((res >> 2) & 0x3333333333333333ULL);
+ res = (res + (res >> 4)) & 0x0F0F0F0F0F0F0F0FULL;