From b17dea93bf9a89b652bf155445889f9736ed2798 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Sun, 7 Jun 2015 23:47:33 +0200 Subject: listen: Fix signedness compiler warnings. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit make[2]: Entering directory '/home/ralf/src/ax25/ax25-apps/listen' gcc -DHAVE_CONFIG_H -I. -I.. -g -O2 -Wall -MT listen.o -MD -MP -MF .deps/listen.Tpo -c -o listen.o listen.c listen.c: In function ‘ascii_dump’: listen.c:231:4: warning: pointer targets in passing argument 2 of ‘__builtin_strncat’ differ in signedness [-Wpointer-sign] strncat(buf, &c, 1); ^ listen.c:231:4: note: expected ‘const char *’ but argument is of type ‘unsigned char *’ listen.c: In function ‘hex_dump’: listen.c:282:8: warning: pointer targets in assignment differ in signedness [-Wpointer-sign] data2 = data; ^ [...] gcc -DHAVE_CONFIG_H -I. -I.. -g -O2 -Wall -MT rosedump.o -MD -MP -MF .deps/rosedump.Tpo -c -o rosedump.o rosedump.c rosedump.c: In function ‘facility’: rosedump.c:331:9: warning: pointer targets in assignment differ in signedness [-Wpointer-sign] factot = data; ^ rosedump.c:398:11: warning: pointer targets in assignment differ in signedness [-Wpointer-sign] for (d = data, l = 0; l < lgaddcall; ^ rosedump.c:406:28: warning: pointer targets in passing argument 1 of ‘dump_ax25_call’ differ in signedness [-Wpointer-sign] dump_ax25_call(d, 7)); ^ rosedump.c:296:14: note: expected ‘unsigned char *’ but argument is of type ‘char *’ static char *dump_ax25_call(unsigned char *data, int l_data) ^ rosedump.c:410:28: warning: pointer targets in passing argument 1 of ‘dump_ax25_call’ differ in signedness [-Wpointer-sign] dump_ax25_call(d, 7)); ^ rosedump.c:296:14: note: expected ‘unsigned char *’ but argument is of type ‘char *’ static char *dump_ax25_call(unsigned char *data, int l_data) ^ rosedump.c:438:4: warning: pointer targets in passing argument 2 of ‘__builtin_strncpy’ differ in signedness [-Wpointer-sign] strncpy(indorig, data, lgadind); ^ rosedump.c:438:4: note: expected ‘const char *’ but argument is of type ‘unsigned char *’ rosedump.c:441:4: warning: pointer targets in passing argument 2 of ‘__builtin_strncpy’ differ in signedness [-Wpointer-sign] strncpy(inddest, data, lgadind); ^ rosedump.c:441:4: note: expected ‘const char *’ but argument is of type ‘unsigned char *’ rosedump.c:451:14: warning: pointer targets in passing argument 1 of ‘data_dump’ differ in signedness [-Wpointer-sign] data_dump(factot, lgtot, 1); ^ In file included from rosedump.c:11:0: listen.h:31:6: note: expected ‘unsigned char *’ but argument is of type ‘char *’ void data_dump(unsigned char *, int, int); ^ [...] gcc -DHAVE_CONFIG_H -I. -I.. -g -O2 -Wall -MT utils.o -MD -MP -MF .deps/utils.Tpo -c -o utils.o utils.c utils.c: In function ‘lprintf’: utils.c:49:10: warning: pointer targets in assignment differ in signedness [-Wpointer-sign] for (p = str; *p != '\0'; p++) { ^ utils.c:71:10: warning: pointer targets in assignment differ in signedness [-Wpointer-sign] for (p = str; *p != '\0'; p++) ^ [...] make[2]: Leaving directory '/home/ralf/src/ax25/ax25-apps/listen' Signed-off-by: Ralf Baechle --- call/yapp.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'call') diff --git a/call/yapp.c b/call/yapp.c index 3d7bf45..8260ab0 100644 --- a/call/yapp.c +++ b/call/yapp.c @@ -288,13 +288,13 @@ static int yapp_download_data(int *filefd, unsigned char *buffer) case STATE_RH: if (buffer[0] == SOH) { /* Parse header: 3 fields == YAPP C */ - char *hptr, *hfield[3]; + unsigned char *hptr, *hfield[3]; if ((length = buffer[1]) == 0) length = 256; hptr = buffer + 2; while (length > 0) { int hlen; - hlen = strlen(hptr) + 1; + hlen = strlen((char *)hptr) + 1; hfield[(int) yappc++] = hptr; hptr += hlen; length -= hlen; @@ -303,13 +303,13 @@ static int yapp_download_data(int *filefd, unsigned char *buffer) if (yappc < 3) { yappc = 0; } else { - file_time = yapp2unix(hfield[2]); + file_time = yapp2unix((char *)hfield[2]); yappc = 1; } if (*filefd == -1) { if ((*filefd = - open(hfield[0], + open((char *)hfield[0], O_RDWR | O_APPEND | O_CREAT, 0666)) == -1) { printf("\n[Unable to open %s]\n", @@ -549,7 +549,7 @@ static int yapp_upload_data(int filefd, char *filename, int filelength, len = buffer[1]; if (buffer[len] == 'C') yappc = 1; - rpos = atol(buffer + 4); + rpos = atol((char *)buffer + 4); lseek(filefd, rpos, SEEK_SET); buffer[0] = ACK; buffer[1] = yappc ? ACK : 0x02; -- cgit v1.2.3