- state_id = IDS_STATE_MIN;
- while(dwStateBit) {
state_id++;
dwStateBit /= 2;
- }
It looks like ffs() could be used to do that. Actually it would be better to find a way to connect those resource ids with actual STATE_SYSTEM_* symbols, not sure if it's possible to do cleanly.
Also I don't like formatting, especially prefixed names, but that's probably considered to be submitter choice.
On 05/12/14 13:22, Nikolay Sivov wrote:
- state_id = IDS_STATE_MIN;
- while(dwStateBit) {
state_id++;
dwStateBit /= 2;
- }
It looks like ffs() could be used to do that.
fss() returns least significant bit.
Actually it would be
better to find a way to connect those resource ids with actual STATE_SYSTEM_* symbols, not sure if it's possible to do cleanly.
I don't see a clean way of doing it.
On 5/12/2014 15:40, Piotr Caban wrote:
On 05/12/14 13:22, Nikolay Sivov wrote:
- state_id = IDS_STATE_MIN;
- while(dwStateBit) {
state_id++;
dwStateBit /= 2;
- }
It looks like ffs() could be used to do that.
fss() returns least significant bit.
Yes, why is this a problem? Input state is supposed to have only one bit set (or none).
On 05/12/14 13:53, Nikolay Sivov wrote:
On 5/12/2014 15:40, Piotr Caban wrote:
On 05/12/14 13:22, Nikolay Sivov wrote:
- state_id = IDS_STATE_MIN;
- while(dwStateBit) {
state_id++;
dwStateBit /= 2;
- }
It looks like ffs() could be used to do that.
fss() returns least significant bit.
Yes, why is this a problem? Input state is supposed to have only one bit set (or none).
I've checked how behaves native dll on win7 and implemented it the same way.