]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Fix various small compiler warnings, mostly unused local variables
authorSimon Tatham <anakin@pobox.com>
Tue, 28 Aug 2001 08:08:43 +0000 (08:08 +0000)
committerSimon Tatham <anakin@pobox.com>
Tue, 28 Aug 2001 08:08:43 +0000 (08:08 +0000)
[originally from svn r1218]

pageant.c
plink.c
scp.c
settings.c
ssh.c
winctrls.c

index fc5e8791951454b90a00bea258fe6e3f6b62bc50..503cb8575b7d926fc7d009d29d91a810c49ae00d 100644 (file)
--- a/pageant.c
+++ b/pageant.c
@@ -74,6 +74,8 @@ int random_byte(void)
 {
     MessageBox(hwnd, "Internal Error", APPNAME, MB_OK | MB_ICONERROR);
     exit(0);
+    /* this line can't be reached but it placates MSVC's warnings :-) */
+    return 0;
 }
 
 /*
diff --git a/plink.c b/plink.c
index d8ef32b335c8e869a5a7b772fe62bd38829b0bce..461035a2f91cdaa36f3ab91e10c5ddbce2cb8a2c 100644 (file)
--- a/plink.c
+++ b/plink.c
@@ -314,11 +314,7 @@ void try_output(int is_stderr)
 
 int from_backend(int is_stderr, char *data, int len)
 {
-    int pos;
-    DWORD ret;
     HANDLE h = (is_stderr ? errhandle : outhandle);
-    void *writedata;
-    int writelen;
     int osize, esize;
 
     if (is_stderr) {
diff --git a/scp.c b/scp.c
index 8b71390e110da8f26572262b8bcd0fd6aa279a20..250e229a5afe59f6a30ea274a164944b8400659c 100644 (file)
--- a/scp.c
+++ b/scp.c
@@ -772,14 +772,13 @@ void scp_sftp_listdir(char *dirname)
     struct fxp_names *names;
     struct fxp_name *ournames;
     int nnames, namesize;
-    char *dir;
     int i;
 
     printf("Listing directory %s\n", dirname);
 
     dirh = fxp_opendir(dirname);
     if (dirh == NULL) {
-       printf("Unable to open %s: %s\n", dir, fxp_error());
+       printf("Unable to open %s: %s\n", dirname, fxp_error());
     } else {
        nnames = namesize = 0;
        ournames = NULL;
@@ -790,7 +789,7 @@ void scp_sftp_listdir(char *dirname)
            if (names == NULL) {
                if (fxp_error_type() == SSH_FX_EOF)
                    break;
-               printf("Reading directory %s: %s\n", dir, fxp_error());
+               printf("Reading directory %s: %s\n", dirname, fxp_error());
                break;
            }
            if (names->nnames == 0) {
@@ -1689,9 +1688,7 @@ static void rsource(char *src)
 static void sink(char *targ, char *src)
 {
     char *destfname;
-    char ch;
     int targisdir = 0;
-    int settime;
     int exists;
     DWORD attr;
     HANDLE f;
@@ -1974,7 +1971,6 @@ static void toremote(int argc, char *argv[])
            continue;
        }
        do {
-           char *last;
            char *filename;
            /*
             * Ensure that . and .. are never matched by wildcards,
index 59db54d391eebfadf55a2aaa734a65f0c3d040e7..989eedd3c3e71cd3f5e549f09fbdda0724305f1f 100644 (file)
@@ -81,7 +81,7 @@ static void gprefs(void *sesskey, char *name, char *def,
     } while (n < nvals);
     /* Add any missing values (backward compatibility ect). */
     {
-       int i, j;
+       int i;
        for (i = 0; i < nvals; i++) {
            if (!(seen & 1<<mapping[i].v)) {
                array[n] = mapping[i].v;
diff --git a/ssh.c b/ssh.c
index efc28ef6206a7f912ac1400bc709107774be388e..b0f16518483e37f98209f7c6664f77bd10398152 100644 (file)
--- a/ssh.c
+++ b/ssh.c
@@ -507,7 +507,7 @@ static int ssh_rportcmp_ssh2(void *av, void *bv)
 {
     struct ssh_rportfwd *a = (struct ssh_rportfwd *) av;
     struct ssh_rportfwd *b = (struct ssh_rportfwd *) bv;
-    int i;
+
     if (a->sport > b->sport)
        return +1;
     if (a->sport < b->sport)
index 61821c312fe6fdb09542bb50191bcc64b9d35c93..de4812c70284ebb0fcd20ff781475135387abbc2 100644 (file)
@@ -159,7 +159,6 @@ void multiedit(struct ctlpos *cp, ...)
 void dropdownlist(struct ctlpos *cp, char *text, int staticid, int listid)
 {
     RECT r;
-    va_list ap;
 
     r.left = GAPBETWEEN;
     r.right = cp->width;
@@ -995,7 +994,7 @@ int handle_prefslist(struct prefslist *hdl,
 
     if (is_dlmsg) {
 
-        if (wParam == hdl->listid) {
+        if ((int)wParam == hdl->listid) {
             DRAGLISTINFO *dlm = (DRAGLISTINFO *)lParam;
             int dest;
             switch (dlm->uNotification) {