Re: [Qemu-devel] [PATCH 3/7] test-coroutine: avoid overflow on 32-bit systems

2014-12-01 Thread Ming Lei
On Mon, Dec 1, 2014 at 8:41 PM, Paolo Bonzini wrote: > > > On 01/12/2014 02:28, Ming Lei wrote: >>> > - (unsigned long)(10 * duration) / maxcycles); >>> > + (unsigned long)(10.0 * duration / maxcycles)); >> One more single bracket. > > I don't un

Re: [Qemu-devel] [PATCH 3/7] test-coroutine: avoid overflow on 32-bit systems

2014-12-01 Thread Paolo Bonzini
On 01/12/2014 02:28, Ming Lei wrote: >> > - (unsigned long)(10 * duration) / maxcycles); >> > + (unsigned long)(10.0 * duration / maxcycles)); > One more single bracket. I don't understand? Paolo

Re: [Qemu-devel] [PATCH 3/7] test-coroutine: avoid overflow on 32-bit systems

2014-11-30 Thread Ming Lei
On Fri, Nov 28, 2014 at 10:12 PM, Paolo Bonzini wrote: > unsigned long is not large enough to represent 10 * duration there. > Just use floating point. > > Signed-off-by: Paolo Bonzini > --- > tests/test-coroutine.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a

[Qemu-devel] [PATCH 3/7] test-coroutine: avoid overflow on 32-bit systems

2014-11-28 Thread Paolo Bonzini
unsigned long is not large enough to represent 10 * duration there. Just use floating point. Signed-off-by: Paolo Bonzini --- tests/test-coroutine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test-coroutine.c b/tests/test-coroutine.c index e22fae1..27d1b6f