From bb640d32213c5dce2ad26515b5fc26e023ec9b98 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Mon, 21 Jul 2008 23:21:09 -0700 Subject: [PATCH] Explicitly cast a -1 that is being assigned to a size_t. --- flist.c | 2 +- io.c | 4 ++-- log.c | 2 +- rsync.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/flist.c b/flist.c index 7c21f73e..2d17bf7f 100644 --- a/flist.c +++ b/flist.c @@ -689,7 +689,7 @@ static struct file_struct *recv_file_entry(struct file_list *flist, xbuf outbuf, inbuf; INIT_CONST_XBUF(outbuf, thisname); - INIT_XBUF(inbuf, lastname, basename_len, -1); + INIT_XBUF(inbuf, lastname, basename_len, (size_t)-1); if (iconvbufs(ic_recv, &inbuf, &outbuf, 0) < 0) { io_error |= IOERR_GENERAL; diff --git a/io.c b/io.c index d884846a..60685757 100644 --- a/io.c +++ b/io.c @@ -511,7 +511,7 @@ static void mplex_write(int fd, enum msgcode code, const char *buf, size_t len, xbuf outbuf, inbuf; INIT_XBUF(outbuf, buffer + 4, 0, sizeof buffer - 4); - INIT_XBUF(inbuf, (char*)buf, len, -1); + INIT_XBUF(inbuf, (char*)buf, len, (size_t)-1); iconvbufs(ic_send, &inbuf, &outbuf, ICB_INCLUDE_BAD | ICB_INCLUDE_INCOMPLETE); @@ -1093,7 +1093,7 @@ static int readfd_unbuffered(int fd, char *buf, size_t len) int add_null = 0; INIT_CONST_XBUF(outbuf, line); - INIT_XBUF(inbuf, ibuf, 0, -1); + INIT_XBUF(inbuf, ibuf, 0, (size_t)-1); while (msg_bytes) { inbuf.len = msg_bytes > sizeof ibuf diff --git a/log.c b/log.c index d50523b8..13c9311d 100644 --- a/log.c +++ b/log.c @@ -351,7 +351,7 @@ output_msg: int ierrno; INIT_CONST_XBUF(outbuf, convbuf); - INIT_XBUF(inbuf, (char*)buf, len, -1); + INIT_XBUF(inbuf, (char*)buf, len, (size_t)-1); while (inbuf.len) { iconvbufs(ic, &inbuf, &outbuf, 0); diff --git a/rsync.h b/rsync.h index 65402576..3a709d3b 100644 --- a/rsync.h +++ b/rsync.h @@ -851,7 +851,7 @@ typedef struct { } xbuf; #define INIT_XBUF(xb, str, ln, sz) (xb).buf = (str), (xb).len = (ln), (xb).size = (sz), (xb).pos = 0 -#define INIT_XBUF_STRLEN(xb, str) (xb).buf = (str), (xb).len = strlen((xb).buf), (xb).size = (-1), (xb).pos = 0 +#define INIT_XBUF_STRLEN(xb, str) (xb).buf = (str), (xb).len = strlen((xb).buf), (xb).size = (size_t)-1, (xb).pos = 0 /* This one is used to make an output xbuf based on a char[] buffer: */ #define INIT_CONST_XBUF(xb, bf) (xb).buf = (bf), (xb).size = sizeof (bf), (xb).len = (xb).pos = 0 -- 2.34.1