Thanx applied by hand.   Will commit once I have internet access beyond my Droid.

On Jun 20, 2010 5:28 AM, "Gerhard Olsson" <gerhard.nospam@gmail.com> wrote:

A few issues in compiling with MSVC:

* Files subsrip.c, garmin_xt.c is not included in the Visual Studio project.
* garmin_xt.c uses (for instance) uint16_t instead of gbuint16
* C99 declaration in compegps.c

Patch below, but I would use search&replace myself.
For msvc/GPSBabel.vcproj, I do not have a patch since I use VSE2010,
that uses msvc/GPSBabel.vcxproj
(I could not get a combination of Windows DDK (WDK) and Windows SDK to
compile delbin otherwise)
I may have other MSVC project patches too, but the patches here are
required anyway.

/Gerhard

$ cvs diff -u compegps.c
Index: compegps.c
===================================================================
RCS file: /cvsroot/gpsbabel/gpsbabel/compegps.c,v
retrieving revision 1.21
diff -u -r1.21 compegps.c
--- compegps.c  31 May 2010 21:15:50 -0000      1.21
+++ compegps.c  20 Jun 2010 10:11:51 -0000
@@ -147,12 +147,12 @@
 static waypoint*
 parse_wpt(char *buff)
 {
+       int has_time = 0;
       int col = -1;
       char *c, *cx;
       waypoint *wpt = waypt_new();
       struct tm tm;
       memset(&tm, 0, sizeof(tm));
-       int has_time = 0;

       c = strstr(buff, "A ");
       if (c == buff) col++;

$ cvs diff -u garmin_xt.c
Index: garmin_xt.c
===================================================================
RCS file: /cvsroot/gpsbabel/gpsbabel/garmin_xt.c,v
retrieving revision 1.2
diff -u -r1.2 garmin_xt.c
--- garmin_xt.c 20 Jun 2010 04:18:31 -0000      1.2
+++ garmin_xt.c 20 Jun 2010 10:12:24 -0000
@@ -83,13 +83,13 @@
       gbfclose(fin);
 }

-static uint16_t
+static gbuint16
 format_garmin_xt_rd_st_attrs(char *p_trk_name, unsigned char *p_track_color)
 {
       int             method = 0;
-       uint16_t        trackbytes = 0, TrackPoints = 0;
+       gbuint16        trackbytes = 0, TrackPoints = 0;
       unsigned char   spam = 0;
-       int32_t         TrackMaxLat = 0, TrackMaxLon = 0, TrackMinLat
= 0, TrackMinLon = 0;
+       gbint32         TrackMaxLat = 0, TrackMaxLon = 0, TrackMinLat
= 0, TrackMinLon = 0;
       char            trk_name[30]="";
       // TODO: SHIFT - can't test behaviour, do not have appropriate files
       //int           ii;
@@ -173,11 +173,11 @@
 * Function to Decompose track block of STRK_BLOCK_SIZE bytes
 */
 static void
-format_garmin_xt_decomp_trk_blk(unsigned char ii, unsigned char
TrackBlock[], double *Ele, double *Lat, double *Lon, uint32_t *Time)
+format_garmin_xt_decomp_trk_blk(unsigned char ii, unsigned char
TrackBlock[], double *Ele, double *Lat, double *Lon, gbuint32 *Time)
 {
-       uint32_t        LatLW = 0, LonLW = 0, TimeLW = 0;
+       gbuint32        LatLW = 0, LonLW = 0, TimeLW = 0;
       double          LatF = 0, LonF = 0;
-       uint16_t        PrevEleW;
+       gbuint16        PrevEleW;

       //printf("%d %d %d %d %d %d\n", TrackBlock[0], TrackBlock[1],
TrackBlock[2], TrackBlock[3], TrackBlock[4], TrackBlock[5]);
       PrevEleW = TrackBlock[ ( ii - 1 ) * 12 + 1 ];
@@ -225,7 +225,7 @@
 static void
 format_garmin_xt_decomp_last_ele(unsigned char ii, double *PrevEle,
unsigned char TrackBlock[])
 {
-       uint16_t        PrevEleW;
+       gbuint16        PrevEleW;

       PrevEleW = TrackBlock[ii - 1];
       PrevEleW = PrevEleW << 8;
@@ -241,12 +241,12 @@
 {
       int             Count = 0; // Used to obtain number of read bytes
       int             NumberOfTracks = 0, TracksCompleted = 0; //
Number of tracks in the file and number of processed tracks
-       uint16_t        trackbytes = 0; // Bytes in track
+       gbuint16        trackbytes = 0; // Bytes in track
       unsigned char   TrackBlock[STRK_BLOCK_SIZE]; // File Block
       unsigned char   ii; // temp variable
       double          Lat = 0, Lon = 0; // wpt data
       double          PrevLat = 0, PrevLon = 0, PrevEle = 0; // wpt data
-       uint32_t        Time = 0, PrevTime =0; // wpt data
+       gbuint32        Time = 0, PrevTime =0; // wpt data
       int             FirstCoo;
       unsigned char   trk_color = 0xff;

@@ -354,14 +354,14 @@
 static void
 format_garmin_xt_proc_atrk(void)
 {
-       uint16_t        block=0, uu=0;
-       uint32_t        Lat=0, Lon=0;
-       uint32_t        Tim=0;
+       gbuint16        block=0, uu=0;
+       gbuint32        Lat=0, Lon=0;
+       gbuint32        Tim=0;
       double          LatF = 0, LonF = 0, AltF = 0;
       waypoint        *wpt;
       int             method = 0;
       unsigned char   buf[3];
-       uint32_t        num_trackpoints;
+       gbuint32        num_trackpoints;

       // get the option for the processing the track name
       if ( opt_trk_header )

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Gpsbabel-code mailing list  http://www.gpsbabel.org
Gpsbabel-code@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gpsbabel-code