Re: [Openocd-development] [PATCH] Fix build errors in SVN on x86_64

2009-04-27 Thread Øyvind Harboe
> Timeval returns the current time which consists of the UTC time and > a microseconds counter. So you will need to have more than 32 bits > for a comparison. That's not actually the complete story. :-) Counters such as these are *carefully* crafted so they can do a 32 bit subtraction & compariso

Re: [Openocd-development] [PATCH] Fix build errors in SVN on x86_64

2009-04-27 Thread Nico Coesel
> -Oorspronkelijk bericht- > Van: Philippe Vachon [mailto:phili...@cowpig.ca] > Verzonden: maandag 27 april 2009 13:10 > Aan: Øyvind Harboe > CC: Nico Coesel; openocd-development@lists.berlios.de > Onderwerp: Re: [Openocd-development] [PATCH] Fix build errors > in

Re: [Openocd-development] [PATCH] Fix build errors in SVN on x86_64

2009-04-27 Thread Øyvind Harboe
We do welcome patches that addresses 64 bit hosts, we just need to make sure that the basis is right before we hunt down & modify 100 places :-) -- Øyvind Harboe Embedded software and hardware consulting services http://consulting.zylin.com ___ Openoc

Re: [Openocd-development] [PATCH] Fix build errors in SVN on x86_64

2009-04-27 Thread Philippe Vachon
Hi, On Mon, Apr 27, 2009 at 08:58:37AM +0200, Øyvind Harboe wrote: > > If the 'long long' is changed into 'unsigned long long', the code will > > always > > work even in wrap-around situations. Perhaps it is a better idea > > to specify (typedef) a timer type as unsigned long long for this purpos

Re: [Openocd-development] [PATCH] Fix build errors in SVN on x86_64

2009-04-26 Thread Øyvind Harboe
> If the 'long long' is changed into 'unsigned long long', the code will always > work even in wrap-around situations. Perhaps it is a better idea > to specify (typedef) a timer type as unsigned long long for this purpose. I don't understand. Subtraction is identical for signed and unsigned in two

Re: [Openocd-development] [PATCH] Fix build errors in SVN on x86_64

2009-04-26 Thread Nico Coesel
os.de > Onderwerp: Re: [Openocd-development] [PATCH] Fix build errors > in SVN on x86_64 > > On Mon, Apr 27, 2009 at 1:41 AM, Øyvind Harboe > wrote: > > What's wrong with this code? > > > >long long then=timeval_ms(); > >whil

Re: [Openocd-development] [PATCH] Fix build errors in SVN on x86_64

2009-04-26 Thread Albert Cahalan
On Mon, Apr 27, 2009 at 1:41 AM, Øyvind Harboe wrote: > What's wrong with this code? > >long long then=timeval_ms(); >while ((timeval_ms()-then) > This appears many places in the code. > > comparision will work unless the difference is > greater than 31/63 bits in s

Re: [Openocd-development] [PATCH] Fix build errors in SVN on x86_64

2009-04-26 Thread Øyvind Harboe
What's wrong with this code? long long then=timeval_ms(); while ((timeval_ms()-then)http://consulting.zylin.com ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/lis

[Openocd-development] [PATCH] Fix build errors in SVN on x86_64

2009-04-24 Thread Philippe Vachon
Hi, The attached patch fixes several warnings when building on an x86_64 system. The changes are trivial. Most of the issues stem from the fact that: 1) a variable of type long is 8 bytes on x86_64, but is 4 bytes on IA32 2) hex literals with the suffix 'ul' are 8 bytes on x86_64, meaning severa