]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Having now compiled the last few days' changes with MSVC, it's turned
authorSimon Tatham <anakin@pobox.com>
Tue, 17 Apr 2001 08:24:29 +0000 (08:24 +0000)
committerSimon Tatham <anakin@pobox.com>
Tue, 17 Apr 2001 08:24:29 +0000 (08:24 +0000)
up a bunch of warnings, mostly unused variables. All fixed.

[originally from svn r1058]

pageant.c
ssh.c
ssh.h
sshrsa.c
terminal.c
tree234.c

index 1b303e2ae49403b85d6c4714e6f4579933e2b55a..6f942625fbfc0286590ae31386550f25e405e300 100644 (file)
--- a/pageant.c
+++ b/pageant.c
@@ -55,6 +55,12 @@ typedef DWORD (WINAPI *gsi_fn_t)
 static gsi_fn_t getsecurityinfo;
 #endif
 
+/*
+ * Exports from pageantc.c
+ */
+void agent_query(void *in, int inlen, void **out, int *outlen);
+int agent_exists(void);
+
 /*
  * We need this to link with the RSA code, because rsaencrypt()
  * pads its data with random bytes. Since we only use rsadecrypt()
@@ -1220,7 +1226,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) {
      * Find out if Pageant is already running.
      */
     already_running = FALSE;
-    if (FindWindow("Pageant", "Pageant"))
+    if (agent_exists())
        already_running = TRUE;
     else {
 
diff --git a/ssh.c b/ssh.c
index 8522e3d3618226d7f1a103b3963af6d34aa4faf6..c47aebd13c04eea77288e1a7d8b81a19113cd881 100644 (file)
--- a/ssh.c
+++ b/ssh.c
@@ -366,8 +366,8 @@ static int ssh_channelfind(void *av, void *bv) {
 }
 
 static int alloc_channel_id(void) {
-    const int CHANNEL_NUMBER_OFFSET = 256;
-    int low, high, mid;
+    const unsigned CHANNEL_NUMBER_OFFSET = 256;
+    unsigned low, high, mid;
     int tsize;
     struct ssh_channel *c;
 
@@ -572,8 +572,8 @@ next_packet:
     if (pktin.type == SSH1_MSG_DISCONNECT) {
        /* log reason code in disconnect message */
        char buf[256];
-       int msglen = GET_32BIT(pktin.body);
-       int nowlen;
+       unsigned msglen = GET_32BIT(pktin.body);
+       unsigned nowlen;
        strcpy(buf, "Remote sent disconnect: ");
        nowlen = strlen(buf);
        if (msglen > sizeof(buf)-nowlen-1)
@@ -726,8 +726,8 @@ next_packet:
        /* log reason code in disconnect message */
        char buf[256];
        int reason = GET_32BIT(pktin.data+6);
-       int msglen = GET_32BIT(pktin.data+10);
-       int nowlen;
+       unsigned msglen = GET_32BIT(pktin.data+10);
+       unsigned nowlen;
        if (reason > 0 && reason < lenof(ssh2_disconnect_reasons)) {
            sprintf(buf, "Received disconnect message (%s)",
                    ssh2_disconnect_reasons[reason]);
@@ -2270,7 +2270,7 @@ static void ssh1_protocol(unsigned char *in, int inlen, int ispkt) {
             } else if (pktin.type == SSH1_SMSG_X11_OPEN) {
                 /* Remote side is trying to open a channel to talk to our
                  * X-Server. Give them back a local channel number. */
-                struct ssh_channel *c, *d;
+                struct ssh_channel *c;
 
                logevent("Received X11 connect request");
                /* Refuse if X11 forwarding is disabled. */
@@ -2304,7 +2304,6 @@ static void ssh1_protocol(unsigned char *in, int inlen, int ispkt) {
             } else if (pktin.type == SSH1_SMSG_AGENT_OPEN) {
                 /* Remote side is trying to open a channel to talk to our
                  * agent. Give them back a local channel number. */
-                unsigned i;
                 struct ssh_channel *c;
 
                /* Refuse if agent forwarding is disabled. */
@@ -3920,9 +3919,6 @@ static void do_ssh2_authconn(unsigned char *in, int inlen, int ispkt)
                     ssh2_pkt_send();
                     sfree(c);
                 } else {
-                    struct ssh_channel *d;
-                    unsigned i;
-
                     c->localid = alloc_channel_id();
                     c->closes = 0;
                     c->v2.remwindow = ssh2_pkt_getuint32();
diff --git a/ssh.h b/ssh.h
index 3c4791fbf0fe574bbfba654af006ec7dbe2ad30a..fb6392f7b81e86e3890afc3231c95b5a1c40c121 100644 (file)
--- a/ssh.h
+++ b/ssh.h
@@ -212,6 +212,7 @@ Bignum bignum_from_bytes(unsigned char *data, int nbytes);
 int ssh1_read_bignum(unsigned char *data, Bignum *result);
 int bignum_bitcount(Bignum bn);
 int ssh1_bignum_length(Bignum bn);
+int ssh2_bignum_length(Bignum bn);
 int bignum_byte(Bignum bn, int i);
 int bignum_bit(Bignum bn, int i);
 void bignum_set_bit(Bignum bn, int i, int value);
index 7f1d790e362ecd4022003edf7e7425ffd008ed80..930d151ce2347496144a69ce83e584b35f54f19e 100644 (file)
--- a/sshrsa.c
+++ b/sshrsa.c
@@ -393,7 +393,7 @@ static void *rsa2_openssh_createkey(unsigned char **blob, int *len) {
     return rsa;
 }
 
-static int *rsa2_openssh_fmtkey(void *key, unsigned char *blob, int len) {
+static int rsa2_openssh_fmtkey(void *key, unsigned char *blob, int len) {
     struct RSAKey *rsa = (struct RSAKey *)key;
     int bloblen, i;
 
index 37625104b5fb6ff1654b27565ead7708766443dd..7d6c727c74f288ea6d60bb985e471f9d503e8317 100644 (file)
@@ -297,7 +297,7 @@ void term_init(void) {
 void term_size(int newrows, int newcols, int newsavelines) {
     tree234 *newsb, *newscreen, *newalt;
     unsigned long *newdisp, *newwant, *oldline, *line;
-    int i, j, crows, ccols;
+    int i, j, ccols;
     int posn, oldposn, furthest_back, oldsbsize;
     int save_alt_which = alt_which;
 
@@ -416,7 +416,6 @@ void term_size(int newrows, int newcols, int newsavelines) {
  */
 static void swap_screen (int which) {
     int t;
-    unsigned long tt;
     tree234 *ttr;
 
     if (which == alt_which)
@@ -442,7 +441,7 @@ static void swap_screen (int which) {
  * Update the scroll bar.
  */
 static void update_sbar(void) {
-    int nscreen, nscroll;
+    int nscroll;
 
     nscroll = count234(scrollback);
 
@@ -593,7 +592,7 @@ static void save_cursor(int save) {
  * whole line, or parts thereof.
  */
 static void erase_lots (int line_only, int from_begin, int to_end) {
-    pos start, end, here;
+    pos start, end;
     int erase_lattr;
     unsigned long *ldata;
 
@@ -1683,7 +1682,6 @@ void term_out(void) {
            break;
          case SEEN_ESCHASH:
            {
-               unsigned long *p;
                unsigned long nlattr;
                unsigned long *ldata;
                int i, j;
@@ -2037,7 +2035,7 @@ static void clipme(pos top, pos bottom, char *workbuf) {
     while (poslt(top, bottom)) {
        int nl = FALSE;
        unsigned long *ldata = lineptr(top.y);
-       pos lineend, nlpos;
+       pos nlpos;
 
        nlpos.y = top.y;
        nlpos.x = cols;
@@ -2112,7 +2110,6 @@ void term_copyall (void) {
  */
 static pos sel_spread_half (pos p, int dir) {
     unsigned long *ldata;
-    int x;
     short wvalue;
 
     ldata = lineptr(p.y);
index 1aac3a6ba2f01af0119c170fa48735c7d6fc173b..9d1d7b0455dc3e9cf26cdf6a79e0cc4d6a732bc4 100644 (file)
--- a/tree234.c
+++ b/tree234.c
@@ -572,7 +572,6 @@ static void *delpos234_internal(tree234 *t, int index) {
     LOG(("deleting item %d from tree %p\n", index, t));
     while (1) {
        while (n) {
-           int c;
            int ki;
            node234 *sub;