summaryrefslogtreecommitdiffstats
path: root/call/yapp.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2015-06-07 23:47:33 +0200
committerRalf Baechle <ralf@linux-mips.org>2015-06-08 01:31:26 +0200
commitb17dea93bf9a89b652bf155445889f9736ed2798 (patch)
treef8d50dda57e685073c4cdda92ea2d5311a5a0b9a /call/yapp.c
parent868d75cd2bdb0545518c4b651aa3f8b5953954c5 (diff)
listen: Fix signedness compiler warnings.
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 <ralf@linux-mips.org>
Diffstat (limited to 'call/yapp.c')
-rw-r--r--call/yapp.c10
1 files changed, 5 insertions, 5 deletions
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;