Re: [Gpsbabel-code] gpsbabel new format
Brought to you by:
robertl
From: Robert L. <rob...@gp...> - 2010-06-18 15:29:27
|
On Fri, Jun 18, 2010 at 7:54 AM, Eriks Zelenka <is...@gm...> wrote: > Hi Robert, > > I'm attaching to this email slightly modified patch to include garmin_xt > format to gpsbabel. As discussed I added testing script to classic-4.test, > all the files needed for testing. Thanx. In the name of rapid progress, I've committed this, but there's still some work to do and I should have caught this on the first review. This code fails on little endian. To correctly support both big and little endian systems (admittedly, LE is quickly fading to obscurity, but I'm not ready to give up them quite yet) when we do a read, we have to know the size of the thing we're reading and we have to know it's a number that needs swapped. gbfread(), which you've used for reading numbers, should really only be used to read things like strings that don't get swapped. Please run through the code and replace code like gbfread(&trackbytes, 2, DATABLOCKSIZE, fin) with trackbytes = gbfgetint16(fin); There are signed and unsigned 16 and 32 bit versions. single byte reads obviously aren't swapped and can be whatever = gbfgetc(fin) This is fine: gbfread(&trk_name, 30, DATABLOCKSIZE, fin); as the name is a string and does not need to be swapped. Can you please make a run through the code for this? * garmin_xt_doc.txt - which is ascii text which can be added to > documentation. I've checked doc.tex in doc directory, it looks outdated or > incomplete, so I decided to send this ASCII instead of merging changes to > doc.tex. > Thanx. I've removed that. I also moved your test suite entry into a file of its own so it can be run in isolation with "./testo garmin_xt" I'll recast your doc for xmldoc/formats soon. Thanx, RJL |