On Mon, Apr 27, 2009 at 1:41 AM, Øyvind Harboe <oyvind.har...@zylin.com> wrote:
> What's wrong with this code?
>
>                long long then=timeval_ms();
>                while ((timeval_ms()-then)<duration)
>
> This appears many places in the code.
>
> comparision will work unless the difference is
> greater than 31/63 bits in signed mode...

Assuming nothing is unsigned long long or bigger,
it should all promote to long long. That's 63 bits
at minimum, not counting the sign bit.

Even if it were 31-bit, you'd have:
24 days, 20 hours, 31 minutes, 23 seconds, 647 milliseconds

That's quite the marathon debug session.
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to