diff options
author | gson <gson@pkgsrc.org> | 2006-07-11 18:11:24 +0000 |
---|---|---|
committer | gson <gson@pkgsrc.org> | 2006-07-11 18:11:24 +0000 |
commit | 829882d7e5900c49cf44629c04ab2547ff3460cd (patch) | |
tree | aacee81782c29729f2150fb2c4651b3177c93592 /geography | |
parent | acec97ecc0b7f431e47e3f03d97ac3cdb2278b92 (diff) | |
download | pkgsrc-829882d7e5900c49cf44629c04ab2547ff3460cd.tar.gz |
Pointer signedness fixes, to make it build with gcc 4.1.2 which
otherwise fails as the Makefile specifies -Wall -Werror.
Diffstat (limited to 'geography')
-rw-r--r-- | geography/garmin-utils/distinfo | 6 | ||||
-rw-r--r-- | geography/garmin-utils/patches/patch-ab | 320 | ||||
-rw-r--r-- | geography/garmin-utils/patches/patch-ac | 22 | ||||
-rw-r--r-- | geography/garmin-utils/patches/patch-ad | 22 |
4 files changed, 366 insertions, 4 deletions
diff --git a/geography/garmin-utils/distinfo b/geography/garmin-utils/distinfo index 1784590506a..5297258ad6b 100644 --- a/geography/garmin-utils/distinfo +++ b/geography/garmin-utils/distinfo @@ -1,7 +1,9 @@ -$NetBSD: distinfo,v 1.5 2006/07/11 17:33:27 gson Exp $ +$NetBSD: distinfo,v 1.6 2006/07/11 18:11:24 gson Exp $ SHA1 (garmin-utils-2.2.tar.gz) = 05416b402caae1d0852e557cb9b01def264dadd2 RMD160 (garmin-utils-2.2.tar.gz) = 7696287c1255448171f7042ad0f425ca5f07579c Size (garmin-utils-2.2.tar.gz) = 172886 bytes SHA1 (patch-aa) = 042115771e3c680e192d7de4dbe3fdfc2007427d -SHA1 (patch-ab) = eed00c08892c83f91e683d9873c991bb4d164855 +SHA1 (patch-ab) = cc1969552f4baeeaa207ec0d8ba231945249c4c3 +SHA1 (patch-ac) = 0fa963f7057905b0d9e3437fb67b19b2234f2afd +SHA1 (patch-ad) = 1a8ec9655ab5c3d5d7e07e9264765450cf163f97 diff --git a/geography/garmin-utils/patches/patch-ab b/geography/garmin-utils/patches/patch-ab index 17b1513bd0a..b412ee4964d 100644 --- a/geography/garmin-utils/patches/patch-ab +++ b/geography/garmin-utils/patches/patch-ab @@ -1,16 +1,203 @@ -$NetBSD: patch-ab,v 1.2 2006/07/11 17:33:27 gson Exp $ +$NetBSD: patch-ab,v 1.3 2006/07/11 18:11:24 gson Exp $ --- lib/gpsformat.c.orig 2004-08-19 05:45:29.000000000 +0300 +++ lib/gpsformat.c +@@ -34,11 +34,11 @@ scan_state(u_char *buf) + { + int state = START; + if (*buf == '[') { +- if (strncmp(buf, RTE_HDR, sizeof RTE_HDR - 1) == 0) ++ if (strncmp((char *) buf, RTE_HDR, sizeof RTE_HDR - 1) == 0) + state = ROUTES; +- else if (strncmp(buf, TRK_HDR, sizeof TRK_HDR - 1) == 0) ++ else if (strncmp((char *) buf, TRK_HDR, sizeof TRK_HDR - 1) == 0) + state = TRACKS; +- else if (strncmp(buf, WPT_HDR, sizeof WPT_HDR - 1) == 0) ++ else if (strncmp((char *) buf, WPT_HDR, sizeof WPT_HDR - 1) == 0) + state = WAYPOINTS; + } + return state; +@@ -58,7 +58,7 @@ gps_buffer_new(void) + * convert len bytes of buf in hex representation to binary + */ + static void +-gps_get_info(char *info, char *buf, int len) ++gps_get_info(u_char *info, char *buf, int len) + { + int ix; + int val; +@@ -132,8 +132,8 @@ build_list_entry(u_char *data, int data_ + * the data buffer and an updated lenght + */ + static u_char * +-wpt_common(int *datalen, int state, char *name, double lat, double lon, +- char *cmnt) ++wpt_common(int *datalen, int state, u_char *name, double lat, double lon, ++ u_char *cmnt) + { + u_char *data; + int len; @@ -147,7 +147,7 @@ wpt_common(int *datalen, int state, char /* byte 1-6: waypoint name */ for (ix = 0; ix < 6; ix += 1) { - data[len++] = toupper(name[ix]); -+ data[len++] = toupper((unsigned char)(name[ix])); ++ data[len++] = toupper((unsigned char)name[ix]); } /* byte 7-10: latitude */ +@@ -173,7 +173,7 @@ wpt_common(int *datalen, int state, char + } + + static struct gps_list_entry * +-d100_wpt(int state, char *name, double lat, double lon, char *cmnt) ++d100_wpt(int state, u_char *name, double lat, double lon, u_char *cmnt) + { + u_char *data; + int len; +@@ -183,7 +183,7 @@ d100_wpt(int state, char *name, double l + } + + static struct gps_list_entry * +-d101_wpt(int state, char *name, double lat, double lon, char *cmnt, int sym) ++d101_wpt(int state, u_char *name, double lat, double lon, u_char *cmnt, int sym) + { + u_char *data; + int len; +@@ -203,7 +203,7 @@ d101_wpt(int state, char *name, double l + } + + static struct gps_list_entry * +-d102_wpt(int state, char *name, double lat, double lon, char *cmnt, int sym) ++d102_wpt(int state, u_char *name, double lat, double lon, u_char *cmnt, int sym) + { + u_char *data; + int len; +@@ -224,7 +224,7 @@ d102_wpt(int state, char *name, double l + } + + static struct gps_list_entry * +-d103_wpt(int state, char *name, double lat, double lon, char *cmnt, int sym, ++d103_wpt(int state, u_char *name, double lat, double lon, u_char *cmnt, int sym, + int disp) + { + u_char *data; +@@ -242,7 +242,7 @@ d103_wpt(int state, char *name, double l + } + + static struct gps_list_entry * +-d104_wpt(int state, char *name, double lat, double lon, char *cmnt, int sym, ++d104_wpt(int state, u_char *name, double lat, double lon, u_char *cmnt, int sym, + int disp) + { + u_char *data; +@@ -261,7 +261,7 @@ d104_wpt(int state, char *name, double l + } + + static struct gps_list_entry * +-d105_wpt(int state, double lat, double lon, char *cmnt, int sym) ++d105_wpt(int state, double lat, double lon, u_char *cmnt, int sym) + { + u_char *data; + int len; +@@ -292,7 +292,7 @@ d105_wpt(int state, double lat, double l + } + + static struct gps_list_entry * +-d106_wpt(int state, double lat, double lon, char *cmnt, int sym) ++d106_wpt(int state, double lat, double lon, u_char *cmnt, int sym) + { + u_char *data; + int len; +@@ -327,7 +327,7 @@ d106_wpt(int state, double lat, double l + } + + static struct gps_list_entry * +-d107_wpt(int state, char *name, double lat, double lon, char *cmnt, int sym, ++d107_wpt(int state, u_char *name, double lat, double lon, u_char *cmnt, int sym, + int disp) + { + u_char *data; +@@ -354,8 +354,8 @@ d107_wpt(int state, char *name, double l + } + + static struct gps_list_entry * +-d108_wpt(int state, char *name, double lat, double lon, float alt, +- char *cmnt, int sym, int disp, char *info) ++d108_wpt(int state, u_char *name, double lat, double lon, float alt, ++ u_char *cmnt, int sym, int disp, u_char *info) + { + u_char *data; + int len; +@@ -418,13 +418,13 @@ d108_wpt(int state, char *name, double l + data[len++] = ' '; + + /* byte 49-99: ident (max 51 characters) */ +- tlen = strlcpy(&data[len], name, GPS_STRING_MAX); ++ tlen = strlcpy((char *) &data[len], (char *) name, GPS_STRING_MAX); + if (++tlen > GPS_STRING_MAX) + tlen = GPS_STRING_MAX; + len += tlen; + + /* comment follows name (max 51 characters) */ +- tlen = strlcpy(&data[len], cmnt, GPS_STRING_MAX); ++ tlen = strlcpy((char *) &data[len], (char *) cmnt, GPS_STRING_MAX); + if (++tlen > GPS_STRING_MAX) + tlen = GPS_STRING_MAX; + len += tlen; +@@ -438,8 +438,8 @@ d108_wpt(int state, char *name, double l + } + + static struct gps_list_entry * +-d109_wpt(int state, char *name, double lat, double lon, float alt, +- char *cmnt, int sym, int disp, char *info) ++d109_wpt(int state, u_char *name, double lat, double lon, float alt, ++ u_char *cmnt, int sym, int disp, u_char *info) + { + u_char *data; + int len; +@@ -508,13 +508,13 @@ d109_wpt(int state, char *name, double l + data[len++] = (u_char) 0xff; + + /* byte 53-103: ident (max GPS_STRING_MAX characters) */ +- tlen = strlcpy(&data[len], name, GPS_STRING_MAX); ++ tlen = strlcpy((char *) &data[len], (char *) name, GPS_STRING_MAX); + if (++tlen > GPS_STRING_MAX) + tlen = GPS_STRING_MAX; + len += tlen; + + /* comment follows name (max 51 characters) */ +- tlen = strlcpy(&data[len], cmnt, GPS_STRING_MAX); ++ tlen = strlcpy((char *) &data[len], (char *) cmnt, GPS_STRING_MAX); + if (++tlen > GPS_STRING_MAX) + tlen = GPS_STRING_MAX; + len += tlen; +@@ -545,9 +545,9 @@ waypoints(gps_handle gps, u_char *buf, i + int sym; /* symbol */ + int disp; /* symbol display mode */ + float alt; /* altitude */ +- char name[GPS_STRING_MAX + 1]; /* waypoint name */ +- char cmnt[GPS_STRING_MAX + 1]; /* comment */ +- char data[GPS_STRING_MAX + 1]; /* waypoint class and subclass */ ++ u_char name[GPS_STRING_MAX + 1]; /* waypoint name */ ++ u_char cmnt[GPS_STRING_MAX + 1]; /* comment */ ++ u_char data[GPS_STRING_MAX + 1]; /* waypoint class and subclass */ + + char *beg; + char *end; +@@ -562,10 +562,10 @@ waypoints(gps_handle gps, u_char *buf, i + data[0] = 0; + + /* Latitude and longitude */ +- sscanf(buf, "%lf %lf", &lat, &lon); ++ sscanf((char *) buf, "%lf %lf", &lat, &lon); + + /* key:value pairs */ +- for (beg = strchr(buf, ':'); beg; beg = end) { ++ for (beg = strchr((char *) buf, ':'); beg; beg = end) { + end = strchr(beg + 1, ':'); + /* len includes space for null */ + if (end == NULL) @@ -574,7 +574,7 @@ waypoints(gps_handle gps, u_char *buf, i len = end - beg - 2; if (len > GPS_STRING_MAX) @@ -20,3 +207,132 @@ $NetBSD: patch-ab,v 1.2 2006/07/11 17:33:27 gson Exp $ case 'A': sscanf(&beg[1], "%f", &alt); break; +@@ -591,10 +591,10 @@ waypoints(gps_handle gps, u_char *buf, i + sscanf(&beg[1], "%d", &disp); + break; + case 'I': +- strlcpy(name, &beg[1], len); ++ strlcpy((char *) name, &beg[1], len); + break; + case 'C': +- strlcpy(cmnt, &beg[1], len); ++ strlcpy((char *) cmnt, &beg[1], len); + break; + case 'L': + /* route link code */ +@@ -676,7 +676,7 @@ d200_route(int num) + } + + static struct gps_list_entry * +-d201_route(int num, char *cmnt) ++d201_route(int num, u_char *cmnt) + { + u_char *data; + int len; +@@ -693,7 +693,7 @@ d201_route(int num, char *cmnt) + } + + static struct gps_list_entry * +-d202_route(char *cmnt) ++d202_route(u_char *cmnt) + { + u_char *data; + int len; +@@ -703,7 +703,7 @@ d202_route(char *cmnt) + len = 0; + + data[len++] = p_rte_hdr; +- tlen = strlcpy(&data[len], cmnt, GPS_STRING_MAX); ++ tlen = strlcpy((char *) &data[len], (char *) cmnt, GPS_STRING_MAX); + if (++tlen > GPS_STRING_MAX) + tlen = GPS_STRING_MAX; + len += tlen; +@@ -724,12 +724,12 @@ routes(gps_handle gps, u_char *buf) + char *p; + int rte; + int num; +- char cmnt[GPS_STRING_MAX + 1]; ++ u_char cmnt[GPS_STRING_MAX + 1]; + +- sscanf(buf, "**%d", &num); +- p = strchr(buf, ' '); ++ sscanf((char *) buf, "**%d", &num); ++ p = strchr((char *) buf, ' '); + if (p) +- strlcpy(cmnt, p + 1, GPS_STRING_MAX); ++ strlcpy((char *) cmnt, p + 1, GPS_STRING_MAX); + else + cmnt[GPS_STRING_MAX] = 0; + gps_printf(gps, 3, "route %d %s\n", num, cmnt); +@@ -788,13 +788,13 @@ track_hdr(gps_handle gps, u_char *buf) + u_char *data; + int len; + int tlen; +- char name[GPS_STRING_MAX + 1]; /* track name */ ++ u_char name[GPS_STRING_MAX + 1]; /* track name */ + + /* skip any leading whitespace and extract the name */ + for (len = 0; buf[len]; len += 1) + if (! isspace(buf[len])) + break; +- strlcpy(name, &buf[len], GPS_STRING_MAX); ++ strlcpy((char *) name, (char *) &buf[len], GPS_STRING_MAX); + + data = gps_buffer_new(); + len = 0; +@@ -808,7 +808,7 @@ track_hdr(gps_handle gps, u_char *buf) + data[len++] = 0xff; + + /* byte 3-n: ident (max GPS_STRING_MAX characters) */ +- tlen = strlcpy(&data[len], name, GPS_STRING_MAX); ++ tlen = strlcpy((char *) &data[len], (char *) name, GPS_STRING_MAX); + if (++tlen > GPS_STRING_MAX) + tlen = GPS_STRING_MAX; + len += tlen; +@@ -834,12 +834,12 @@ tracks(gps_handle gps, u_char *buf) + buf += 19; + + /* Latitude and longitude */ +- sscanf(buf, "%lf %lf", &lat, &lon); ++ sscanf((char *) buf, "%lf %lf", &lat, &lon); + + /* look for start flag */ +- p = strrchr(buf, ' '); ++ p = strrchr((char *) buf, ' '); + if (p != NULL) +- start = strcmp(p+1, "start") == 0; ++ start = strcmp((char *) p+1, "start") == 0; + else + start = 0; + +@@ -951,10 +951,10 @@ gps_format(gps_handle gps, FILE *stream) + int rte; + char *p; + +- while (fgets(buf, sizeof buf, stream)) { ++ while (fgets((char *) buf, sizeof buf, stream)) { + + /* kill any trailing newline */ +- if ((p = strrchr(buf, '\n')) != NULL) ++ if ((p = strrchr((char *) buf, '\n')) != NULL) + *p = 0; + + /* skip any leading whitespace */ +@@ -967,7 +967,7 @@ gps_format(gps_handle gps, FILE *stream) + continue; + + /* check for list terminator */ +- if (buf[ix] == '[' && strncmp(&buf[ix], "[end", 4) == 0) { ++ if (buf[ix] == '[' && strncmp((char *) &buf[ix], "[end", 4) == 0) { + gps_printf(gps, 3, "...end\n"); + state = START; + } +@@ -1003,7 +1003,7 @@ gps_format(gps_handle gps, FILE *stream) + } + break; + case TRACKS: +- if (strncmp(&buf[ix], "Track:", 6) == 0) { ++ if (strncmp((char *) &buf[ix], "Track:", 6) == 0) { + if (gps_get_trk_hdr_type(gps) != 0) + entry = track_hdr(gps, &buf[ix + 6]); + } else diff --git a/geography/garmin-utils/patches/patch-ac b/geography/garmin-utils/patches/patch-ac new file mode 100644 index 00000000000..d8f71af6f4a --- /dev/null +++ b/geography/garmin-utils/patches/patch-ac @@ -0,0 +1,22 @@ +$NetBSD: patch-ac,v 1.1 2006/07/11 18:11:24 gson Exp $ + +--- lib/gpsprint.c.orig 2004-08-19 05:45:29.000000000 +0300 ++++ lib/gpsprint.c +@@ -49,7 +49,7 @@ get_strings(const u_char *buf, int bufsi + strings[ix] = malloc(STRING_MAX); + if (strings[ix] != NULL) { + if (off > 0 && bufsiz > off) +- off += strlcpy(strings[ix], &buf[off], ++ off += strlcpy(strings[ix], (char *) &buf[off], + STRING_MAX) + 1; + else + *strings[ix] = 0; +@@ -70,7 +70,7 @@ get_string(const u_char *buf, int bufsiz + if (off != 0 && bufsiz > off) { + str = malloc(len + 1); + if (str != NULL) +- strlcpy(str, &buf[off], len + 1); ++ strlcpy(str, (char *) &buf[off], len + 1); + } + return str; + } diff --git a/geography/garmin-utils/patches/patch-ad b/geography/garmin-utils/patches/patch-ad new file mode 100644 index 00000000000..8a1636d9ab7 --- /dev/null +++ b/geography/garmin-utils/patches/patch-ad @@ -0,0 +1,22 @@ +$NetBSD: patch-ad,v 1.1 2006/07/11 18:11:24 gson Exp $ + +--- lib/gpsprod.c.orig 2003-10-06 22:13:53.000000000 +0300 ++++ lib/gpsprod.c +@@ -33,7 +33,7 @@ int + gps_product(gps_handle gps, int *product_id, int *software_version, + char **product_description) + { +- char rqst = p_prod_rqst; ++ u_char rqst = p_prod_rqst; + int retries = 5; + u_char *data = malloc(GPS_FRAME_MAX); + +@@ -55,7 +55,7 @@ gps_product(gps_handle gps, int *product + data[3] + (data[4] << 8); + if (datalen > 5) + *product_description = +- strdup(&data[5]); ++ strdup((char *) &data[5]); + else + *product_description = 0; + gps_printf(gps, 3, |