On 30 August 2011 12:57, Stefan Dösinger stefan@codeweavers.com wrote:
+static DWORD make_bitmask(DWORD count) +{
- DWORD ret = 0;
- for (count--; count != ~0U; count--) ret |= 1 << count;
- return ret;
+}
You could probably do something like "return count ? ~0U >> (32 - count) : 0;"
In this specific case you probably don't care about 0 though, so you might as well just do something like "out->u4.ddpfPixelFormat.u3.dwZBitMask = ~0U >> (32 - in->u2.dwZBufferBitDepth);".