Vincent Béron wrote:

Besides the fact that HIDWORD and LODWORD (typo in LODDWORD) do not
exist,

Yes, I was extrapolating on existing macros for readability.

it looks fine as long as you don't actually compile it.

Writing those two and compiling yields the error "initializer element is
not constant".


Yes. You are right. If you try to cast them to "unsigned long long", you get the compiler to reveal the true problem:

keyboard.c:86: warning: initializer element is not computable at load time

Which is, I'm afraid, without solution. The compiler is not smart enough to understand that the cast (or a shift of 32 bits) is not really a mathematical operation, and will refuse to do it if it doesn't know the exact value at compile time. I tried doing the same thing with pointer arithmetics, but to no avail (the cast fails). I'm afraid this one bested me. I don't see a clean solution to this one.


         Shachar

--
Shachar Shemesh
Lingnu Open Source Consulting ltd.
http://www.lingnu.com/




Reply via email to