Fix serialdump.c warnings (clang)

Using clang (on osx) yields to some warnings
(conversion between signed/unsigned, unused variable)
which gcc would only produce when used with -Wall.
This commit fixes those.
This commit is contained in:
Tommy Sparber 2015-10-28 17:46:59 +11:00
parent 17714c2111
commit 64c66efd7f

View file

@ -55,7 +55,7 @@ usage(int result)
} }
static void static void
print_hex_line(unsigned char *prefix, unsigned char *outbuf, int index) print_hex_line(char *prefix, unsigned char *outbuf, int index)
{ {
int i; int i;
@ -92,7 +92,8 @@ main(int argc, char **argv)
char *speedname = BAUDRATE_S; char *speedname = BAUDRATE_S;
char *device = MODEMDEVICE; char *device = MODEMDEVICE;
char *timeformat = NULL; char *timeformat = NULL;
unsigned char buf[BUFSIZE], outbuf[HCOLS]; unsigned char buf[BUFSIZE];
char outbuf[HCOLS];
unsigned char mode = MODE_START_TEXT; unsigned char mode = MODE_START_TEXT;
int nfound, flags = 0; int nfound, flags = 0;
unsigned char lastc = '\0'; unsigned char lastc = '\0';
@ -273,7 +274,7 @@ main(int argc, char **argv)
} }
if(FD_ISSET(fd, &smask)) { if(FD_ISSET(fd, &smask)) {
int i, j, n = read(fd, buf, sizeof(buf)); int i, n = read(fd, buf, sizeof(buf));
if(n < 0) { if(n < 0) {
perror("could not read"); perror("could not read");
exit(-1); exit(-1);