Using right shifts, you can compute the next power of two of an 32-bit integer in a very effective way:
For example, the size of a texture should be usually a power of two, so this code comes in very handy.