The divide statement below gives an entirely wrong answer:
Result = dfi->Free / dfi->Allocated; // Result <- 178956470 = 0x0AAAA8B6
where dfi->Free is -12000 and dfi->Allocated is 24, and the correct answer is -500.
If I just bring the values into temps first it works fine:
temp1 = dfi->Free;
temp2 = dfi->Allocated;
Result = temp1 / temp2; // Result <- -500
Is there some restriction on C divides with structure elements that I'm not aware of? All the variables are "long" types.
Thanks for any input.