Le Friday 30 January 2009 02:58:34 Vitaliy Margolen, vous avez écrit :
First why do you typecase DWORD to (int) to assign to DWORD? Second DWORD will always be > 0. If you want to check it against limit then just check it being <= 10000 otherwise return error.
[...]
You should use MulDiv instead because this can be optimized out by compiler into something that won't be as accurate.
I store internaly as a DWORD because of those accuracy problems. Thanks for pointing out this function, attached patch is now more homogeneous with existing code, and does not do any casting magic.
You should be checking This->base.acquired instead of fd.
Right, fixed.
Also fixed in test: - test vs. message incoherent - typo in test message