From 806c9d94341c912a45e563d87ad36d63966a4308 Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 12 Jul 2011 18:13:33 +0000 Subject: [PATCH] Fix the _rest_ of the Windows compile warnings. (ahem) git-svn-id: svn://svn.tartarus.org/sgt/putty@9201 cda61777-01e9-0310-a592-d414129be87e --- ldiscucs.c | 18 +++++++++--------- logging.c | 2 +- windows/winnet.c | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ldiscucs.c b/ldiscucs.c index a9e1e133..c4fc726d 100644 --- a/ldiscucs.c +++ b/ldiscucs.c @@ -71,17 +71,17 @@ void luni_send(void *handle, wchar_t * widebuf, int len, int interactive) if (ch < 0x80) { *p++ = (char) (ch); } else if (ch < 0x800) { - *p++ = (0xC0 | (ch >> 6)); - *p++ = (0x80 | (ch & 0x3F)); + *p++ = (char) (0xC0 | (ch >> 6)); + *p++ = (char) (0x80 | (ch & 0x3F)); } else if (ch < 0x10000) { - *p++ = (0xE0 | (ch >> 12)); - *p++ = (0x80 | ((ch >> 6) & 0x3F)); - *p++ = (0x80 | (ch & 0x3F)); + *p++ = (char) (0xE0 | (ch >> 12)); + *p++ = (char) (0x80 | ((ch >> 6) & 0x3F)); + *p++ = (char) (0x80 | (ch & 0x3F)); } else { - *p++ = (0xF0 | (ch >> 18)); - *p++ = (0x80 | ((ch >> 12) & 0x3F)); - *p++ = (0x80 | ((ch >> 6) & 0x3F)); - *p++ = (0x80 | (ch & 0x3F)); + *p++ = (char) (0xF0 | (ch >> 18)); + *p++ = (char) (0x80 | ((ch >> 12) & 0x3F)); + *p++ = (char) (0x80 | ((ch >> 6) & 0x3F)); + *p++ = (char) (0x80 | (ch & 0x3F)); } } } else { diff --git a/logging.c b/logging.c index 7c9b1287..74654804 100644 --- a/logging.c +++ b/logging.c @@ -43,7 +43,7 @@ static void logwrite(struct LogContext *ctx, void *data, int len) bufchain_add(&ctx->queue, data, len); } else if (ctx->state == L_OPEN) { assert(ctx->lgfp); - if (fwrite(data, 1, len, ctx->lgfp) < len) { + if (fwrite(data, 1, len, ctx->lgfp) < (size_t)len) { logfclose(ctx); ctx->state = L_ERROR; /* Log state is L_ERROR so this won't cause a loop */ diff --git a/windows/winnet.c b/windows/winnet.c index da291c3e..9f5c9933 100644 --- a/windows/winnet.c +++ b/windows/winnet.c @@ -1691,7 +1691,7 @@ char *get_hostname(void) hostname = NULL; break; } - } while (strlen(hostname) >= len-1); + } while (strlen(hostname) >= (size_t)(len-1)); return hostname; } -- 2.11.0