mirror of
https://github.com/linux-can/can-utils.git
synced 2026-09-22 16:09:52 +02:00
can-utils: fix sign-compare warnings (#513)
Fixing several build issues reported by Gary Bisson when he was building can-utils with clang (AOSP14). URL: https://github.com/linux-can/can-utils/pull/512 Reported-by: Gary Bisson (https://github.com/gibsson) Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
This commit is contained in:
+7
-7
@@ -53,13 +53,13 @@
|
||||
static int pty2can(int pty, int socket, struct can_filter *fi,
|
||||
int *is_open, int *tstamp)
|
||||
{
|
||||
unsigned int nbytes;
|
||||
unsigned int nbytes, tmp;
|
||||
char cmd;
|
||||
static char buf[200];
|
||||
char replybuf[10]; /* for answers to received commands */
|
||||
int ptr;
|
||||
unsigned int ptr;
|
||||
struct can_frame frame;
|
||||
int ret, tmp, i;
|
||||
int ret, i;
|
||||
static unsigned int rxoffset = 0; /* points to the end of an received incomplete SLCAN message */
|
||||
|
||||
ret = read(pty, &buf[rxoffset], sizeof(buf) - rxoffset - 1);
|
||||
@@ -282,8 +282,8 @@ rx_restart:
|
||||
ptr--;
|
||||
}
|
||||
|
||||
tmp = write(socket, &frame, sizeof(frame));
|
||||
if (tmp != sizeof(frame)) {
|
||||
ret = write(socket, &frame, sizeof(frame));
|
||||
if (ret != sizeof(frame)) {
|
||||
perror("write socket");
|
||||
return 1;
|
||||
}
|
||||
@@ -296,8 +296,8 @@ rx_out_nack:
|
||||
replybuf[0] = '\a';
|
||||
tmp = 1;
|
||||
rx_out:
|
||||
tmp = write(pty, replybuf, tmp);
|
||||
if (tmp < 0) {
|
||||
ret = write(pty, replybuf, tmp);
|
||||
if (ret < 0) {
|
||||
perror("write pty replybuf");
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user