summaryrefslogtreecommitdiffstats
path: root/onkyo.c
diff options
context:
space:
mode:
authorDan McGee <dpmcgee@gmail.com>2015-04-07 11:47:59 -0500
committerDan McGee <dpmcgee@gmail.com>2015-04-07 11:47:59 -0500
commit347ae48021e32cba1bac8459cb36f88626268883 (patch)
tree87cec169455e57db07e3d6b5cdf2f30095267552 /onkyo.c
parent4bc588efc4a92dcf0e76d87bc730699270d6f178 (diff)
downloadonkyocontrol-master.tar.gz
onkyocontrol-master.zip
Fix up a handful of integer conversion warningsHEADmaster
Signed-off-by: Dan McGee <dpmcgee@gmail.com>
Diffstat (limited to 'onkyo.c')
-rw-r--r--onkyo.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/onkyo.c b/onkyo.c
index 8e8916b..fb88145 100644
--- a/onkyo.c
+++ b/onkyo.c
@@ -406,7 +406,7 @@ static int open_serial_device(const char *path)
/* canonical input mode- end read at a line descriptor */
newtio.c_lflag = ICANON;
/* add the Onkyo-used EOF char to allow canonical read */
- newtio.c_cc[VEOL] = END_RECV[strlen(END_RECV) - 1];
+ newtio.c_cc[VEOL] = (cc_t)END_RECV[strlen(END_RECV) - 1];
/* clean the line and activate the settings */
ret = tcflush(rcvr->fd, TCIOFLUSH);
@@ -659,7 +659,7 @@ static int process_input(struct conn *c)
const char * const end_pos = &(c->recv_buf[BUF_SIZE]);
int ret = 0;
- int count;
+ ssize_t count;
/*
* Picture time! Let's get overly verbose since we don't do this
@@ -687,6 +687,7 @@ static int process_input(struct conn *c)
while(count > 0) {
if(*c->recv_buf_pos == '\n') {
int processret = 0;
+ size_t remaining;
struct receiver *r;
/* We have a newline. This means we should have a full command
* and can attempt to interpret it. */
@@ -705,10 +706,11 @@ static int process_input(struct conn *c)
}
/* now move our remaining buffer to the start of our buffer */
c->recv_buf_pos++;
- memmove(c->recv_buf, c->recv_buf_pos, count - 1);
+ remaining = (size_t)count - 1;
+ memmove(c->recv_buf, c->recv_buf_pos, remaining);
c->recv_buf_pos = c->recv_buf;
- memset(&(c->recv_buf_pos[count - 1]), 0,
- end_pos - &(c->recv_buf_pos[count - 1]));
+ memset(&(c->recv_buf_pos[remaining]), 0,
+ end_pos - &(c->recv_buf_pos[remaining]));
if(ret == -2)
break;
}