Re: kernel32: Add a couple of weird PE images
13 Dec
2006
13 Dec
'06
8:46 p.m.
On Wednesday 13 December 2006 18:00, Dmitry Timoshkov wrote:
+static BOOL is_power_of_two(DWORD alignment) +{ + if (!alignment) return FALSE; + + while (!(alignment & 1)) + { + alignment >>= 1; + } + return alignment == 1; +}
Although speed should not be an issue here, a faster way to test for a power of two is: alignment && !(alignment & (alignment-1)) Bye, -- Michael Jung mjung(a)iss.tu-darmstadt.de
6946
Age (days ago)
6946
Last active (days ago)
0 comments
1 participants
participants (1)
-
Michael Jung