Fix the _rest_ of the Windows compile warnings. (ahem)
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Tue, 12 Jul 2011 18:13:33 +0000 (18:13 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Tue, 12 Jul 2011 18:13:33 +0000 (18:13 +0000)
git-svn-id: svn://svn.tartarus.org/sgt/putty@9201 cda61777-01e9-0310-a592-d414129be87e

ldiscucs.c
logging.c
windows/winnet.c

index a9e1e13..c4fc726 100644 (file)
@@ -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 {
index 7c9b128..7465480 100644 (file)
--- 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 */
index da291c3..9f5c993 100644 (file)
@@ -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;
 }