Re: [Xen-devel] [PATCH v3 18/25] s390x/3270: Let insert_IAC_escape_char() use size_t

2019-02-20 Thread Cornelia Huck
On Wed, 20 Feb 2019 02:02:25 +0100
Philippe Mathieu-Daudé  wrote:

> This function takes size_t argument and return a size_t.
> 
> Signed-off-by: Philippe Mathieu-Daudé 
> ---
>  hw/char/terminal3270.c | 7 ---
>  1 file changed, 4 insertions(+), 3 deletions(-)

Reviewed-by: Cornelia Huck 

___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PATCH v3 18/25] s390x/3270: Let insert_IAC_escape_char() use size_t

2019-02-19 Thread Philippe Mathieu-Daudé
This function takes size_t argument and return a size_t.

Signed-off-by: Philippe Mathieu-Daudé 
---
 hw/char/terminal3270.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/hw/char/terminal3270.c b/hw/char/terminal3270.c
index 35b079d5c4..1cb48a3c6f 100644
--- a/hw/char/terminal3270.c
+++ b/hw/char/terminal3270.c
@@ -199,9 +199,10 @@ static int read_payload_3270(EmulatedCcw3270Device *dev)
 }
 
 /* TN3270 uses binary transmission, which needs escape IAC to IAC IAC */
-static int insert_IAC_escape_char(uint8_t *outv, int out_len)
+static size_t insert_IAC_escape_char(uint8_t *outv, size_t out_len)
 {
-int IAC_num = 0, new_out_len, i, j;
+size_t new_out_len;
+int IAC_num = 0, i, j;
 
 for (i = 0; i < out_len; i++) {
 if (outv[i] == IAC) {
@@ -232,7 +233,7 @@ static int write_payload_3270(EmulatedCcw3270Device *dev, 
uint8_t cmd)
 int count = ccw_dstream_avail(get_cds(t));
 int bound = (OUTPUT_BUFFER_SIZE - 3) / 2;
 int len = MIN(count, bound);
-int out_len = 0;
+size_t out_len = 0;
 
 if (!t->handshake_done) {
 if (!(t->outv[0] == IAC && t->outv[1] != IAC)) {
-- 
2.20.1


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel