1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-04-21 04:55:02 -05:00

Fix various small compiler warnings, mostly unused local variables

[originally from svn r1218]
This commit is contained in:
Simon Tatham 2001-08-28 08:08:43 +00:00
parent 493d34c655
commit ea27f048f9
6 changed files with 7 additions and 14 deletions

View File

@ -74,6 +74,8 @@ int random_byte(void)
{ {
MessageBox(hwnd, "Internal Error", APPNAME, MB_OK | MB_ICONERROR); MessageBox(hwnd, "Internal Error", APPNAME, MB_OK | MB_ICONERROR);
exit(0); exit(0);
/* this line can't be reached but it placates MSVC's warnings :-) */
return 0;
} }
/* /*

View File

@ -314,11 +314,7 @@ void try_output(int is_stderr)
int from_backend(int is_stderr, char *data, int len) int from_backend(int is_stderr, char *data, int len)
{ {
int pos;
DWORD ret;
HANDLE h = (is_stderr ? errhandle : outhandle); HANDLE h = (is_stderr ? errhandle : outhandle);
void *writedata;
int writelen;
int osize, esize; int osize, esize;
if (is_stderr) { if (is_stderr) {

8
scp.c
View File

@ -772,14 +772,13 @@ void scp_sftp_listdir(char *dirname)
struct fxp_names *names; struct fxp_names *names;
struct fxp_name *ournames; struct fxp_name *ournames;
int nnames, namesize; int nnames, namesize;
char *dir;
int i; int i;
printf("Listing directory %s\n", dirname); printf("Listing directory %s\n", dirname);
dirh = fxp_opendir(dirname); dirh = fxp_opendir(dirname);
if (dirh == NULL) { if (dirh == NULL) {
printf("Unable to open %s: %s\n", dir, fxp_error()); printf("Unable to open %s: %s\n", dirname, fxp_error());
} else { } else {
nnames = namesize = 0; nnames = namesize = 0;
ournames = NULL; ournames = NULL;
@ -790,7 +789,7 @@ void scp_sftp_listdir(char *dirname)
if (names == NULL) { if (names == NULL) {
if (fxp_error_type() == SSH_FX_EOF) if (fxp_error_type() == SSH_FX_EOF)
break; break;
printf("Reading directory %s: %s\n", dir, fxp_error()); printf("Reading directory %s: %s\n", dirname, fxp_error());
break; break;
} }
if (names->nnames == 0) { if (names->nnames == 0) {
@ -1689,9 +1688,7 @@ static void rsource(char *src)
static void sink(char *targ, char *src) static void sink(char *targ, char *src)
{ {
char *destfname; char *destfname;
char ch;
int targisdir = 0; int targisdir = 0;
int settime;
int exists; int exists;
DWORD attr; DWORD attr;
HANDLE f; HANDLE f;
@ -1974,7 +1971,6 @@ static void toremote(int argc, char *argv[])
continue; continue;
} }
do { do {
char *last;
char *filename; char *filename;
/* /*
* Ensure that . and .. are never matched by wildcards, * Ensure that . and .. are never matched by wildcards,

View File

@ -81,7 +81,7 @@ static void gprefs(void *sesskey, char *name, char *def,
} while (n < nvals); } while (n < nvals);
/* Add any missing values (backward compatibility ect). */ /* Add any missing values (backward compatibility ect). */
{ {
int i, j; int i;
for (i = 0; i < nvals; i++) { for (i = 0; i < nvals; i++) {
if (!(seen & 1<<mapping[i].v)) { if (!(seen & 1<<mapping[i].v)) {
array[n] = mapping[i].v; array[n] = mapping[i].v;

2
ssh.c
View File

@ -507,7 +507,7 @@ static int ssh_rportcmp_ssh2(void *av, void *bv)
{ {
struct ssh_rportfwd *a = (struct ssh_rportfwd *) av; struct ssh_rportfwd *a = (struct ssh_rportfwd *) av;
struct ssh_rportfwd *b = (struct ssh_rportfwd *) bv; struct ssh_rportfwd *b = (struct ssh_rportfwd *) bv;
int i;
if (a->sport > b->sport) if (a->sport > b->sport)
return +1; return +1;
if (a->sport < b->sport) if (a->sport < b->sport)

View File

@ -159,7 +159,6 @@ void multiedit(struct ctlpos *cp, ...)
void dropdownlist(struct ctlpos *cp, char *text, int staticid, int listid) void dropdownlist(struct ctlpos *cp, char *text, int staticid, int listid)
{ {
RECT r; RECT r;
va_list ap;
r.left = GAPBETWEEN; r.left = GAPBETWEEN;
r.right = cp->width; r.right = cp->width;
@ -995,7 +994,7 @@ int handle_prefslist(struct prefslist *hdl,
if (is_dlmsg) { if (is_dlmsg) {
if (wParam == hdl->listid) { if ((int)wParam == hdl->listid) {
DRAGLISTINFO *dlm = (DRAGLISTINFO *)lParam; DRAGLISTINFO *dlm = (DRAGLISTINFO *)lParam;
int dest; int dest;
switch (dlm->uNotification) { switch (dlm->uNotification) {