Page 1 of 1

Structure PROCESSOR_POWER_POLICY_INFO ... AllowPromotion:1 ?

Posted: Tue Mar 29, 2005 6:46 pm
by bingo
Structure PROCESSOR_POWER_POLICY_INFO
TimeCheck.l
DemoteLimit.l
PromoteLimit.l
DemotePercent.b
PromotePercent.b
Spare.b[2]
AllowDemotion:1.l
AllowPromotion:1.l ; already declared ???
Reserved:30.l
EndStructure

this structure field has been already declared :?:

[pb3.93]

Posted: Tue Mar 29, 2005 7:33 pm
by tinman
It's because the PureBasic compiler thinks that you have a variable called 1.l in your structure and that you have already declared it.

In C that is a bitfield, so makes those Allow* fields use 1 bit each. You can stick a .l variable in there and access the relevant bits, but I can't remember whether it is a standard or compiler specific whether they are allocated right to left or right to left so you will need to check to see which ones are the correct bits. I'd guess at right to left, so that AllowDemotion is bit 0 and AllowPromotion is bit 1.