1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-25 01:02:24 +00:00

Fix some picky compiler warnings kindly provided by Borland C++ 5.5

[originally from svn r396]
This commit is contained in:
Simon Tatham 2000-03-08 10:21:13 +00:00
parent 3ceb7127ba
commit 11821d4d27
6 changed files with 19 additions and 20 deletions

View File

@ -11,7 +11,6 @@
static void c_write (char *buf, int len) { static void c_write (char *buf, int len) {
while (len--) { while (len--) {
int new_head = (inbuf_head + 1) & INBUF_MASK; int new_head = (inbuf_head + 1) & INBUF_MASK;
int c = (unsigned char) *buf;
if (new_head != inbuf_reap) { if (new_head != inbuf_reap) {
inbuf[inbuf_head] = *buf++; inbuf[inbuf_head] = *buf++;
inbuf_head = new_head; inbuf_head = new_head;

1
raw.c
View File

@ -52,7 +52,6 @@ static void s_write (void *buf, int len) {
static void c_write (char *buf, int len) { static void c_write (char *buf, int len) {
while (len--) { while (len--) {
int new_head = (inbuf_head + 1) & INBUF_MASK; int new_head = (inbuf_head + 1) & INBUF_MASK;
int c = (unsigned char) *buf;
if (new_head != inbuf_reap) { if (new_head != inbuf_reap) {
inbuf[inbuf_head] = *buf++; inbuf[inbuf_head] = *buf++;
inbuf_head = new_head; inbuf_head = new_head;

14
scp.c
View File

@ -270,7 +270,7 @@ static void source(char *src)
time_t stat_starttime, stat_lasttime; time_t stat_starttime, stat_lasttime;
attr = GetFileAttributes(src); attr = GetFileAttributes(src);
if (attr == -1) { if (attr == (DWORD)-1) {
run_err("%s: No such file or directory", src); run_err("%s: No such file or directory", src);
return; return;
} }
@ -425,7 +425,7 @@ static void sink(char *targ)
char namebuf[2048]; char namebuf[2048];
char ch; char ch;
int targisdir = 0; int targisdir = 0;
int settime = 0; int settime;
int exists; int exists;
DWORD attr; DWORD attr;
HANDLE f; HANDLE f;
@ -438,7 +438,7 @@ static void sink(char *targ)
char *stat_name; char *stat_name;
attr = GetFileAttributes(targ); attr = GetFileAttributes(targ);
if (attr != -1 && (attr & FILE_ATTRIBUTE_DIRECTORY) != 0) if (attr != (DWORD)-1 && (attr & FILE_ATTRIBUTE_DIRECTORY) != 0)
targisdir = 1; targisdir = 1;
if (targetshouldbedirectory && !targisdir) if (targetshouldbedirectory && !targisdir)
@ -498,7 +498,7 @@ static void sink(char *targ)
strcpy(namebuf, targ); strcpy(namebuf, targ);
} }
attr = GetFileAttributes(namebuf); attr = GetFileAttributes(namebuf);
exists = (attr != -1); exists = (attr != (DWORD)-1);
if (buf[0] == 'D') { if (buf[0] == 'D') {
if (exists && (attr & FILE_ATTRIBUTE_DIRECTORY) == 0) { if (exists && (attr & FILE_ATTRIBUTE_DIRECTORY) == 0) {
@ -540,7 +540,7 @@ static void sink(char *targ)
for (i = 0; i < size; i += 4096) { for (i = 0; i < size; i += 4096) {
char transbuf[4096]; char transbuf[4096];
int j, k = 4096; DWORD j, k = 4096;
if (i + k > size) k = size - i; if (i + k > size) k = size - i;
if (ssh_recv(transbuf, k) == 0) if (ssh_recv(transbuf, k) == 0)
bump("Lost connection"); bump("Lost connection");
@ -732,7 +732,7 @@ static void tolocal(int argc, char *argv[])
/* /*
* Initialize the Win$ock driver. * Initialize the Win$ock driver.
*/ */
static void init_winsock() static void init_winsock(void)
{ {
WORD winsock_ver; WORD winsock_ver;
WSADATA wsadata; WSADATA wsadata;
@ -748,7 +748,7 @@ static void init_winsock()
/* /*
* Short description of parameters. * Short description of parameters.
*/ */
static void usage() static void usage(void)
{ {
printf("PuTTY Secure Copy client\n"); printf("PuTTY Secure Copy client\n");
printf("%s\n", ver); printf("%s\n", ver);

View File

@ -88,7 +88,7 @@ static int s_read (char *buf, int len) {
/* /*
* Read and decrypt one incoming SSH packet. * Read and decrypt one incoming SSH packet.
*/ */
static void get_packet() static void get_packet(void)
{ {
unsigned char buf[4]; unsigned char buf[4];
int ret; int ret;

View File

@ -126,7 +126,8 @@ static void bigmod(unsigned short *a, unsigned short *m, int len)
q--; q--;
t -= m1; t -= m1;
r = (r + m0) & 0xffff; /* overflow? */ r = (r + m0) & 0xffff; /* overflow? */
if (r >= m0 && t > ((unsigned long) r << 16) + a[i+1]) if (r >= (unsigned long)m0 &&
t > ((unsigned long) r << 16) + a[i+1])
q--; q--;
} }

View File

@ -37,7 +37,7 @@
#define WM_IGNORE_SIZE (WM_USER + 2) #define WM_IGNORE_SIZE (WM_USER + 2)
#define WM_IGNORE_CLIP (WM_USER + 3) #define WM_IGNORE_CLIP (WM_USER + 3)
static int WINAPI WndProc (HWND, UINT, WPARAM, LPARAM); static LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);
static int TranslateKey(WPARAM wParam, LPARAM lParam, unsigned char *output); static int TranslateKey(WPARAM wParam, LPARAM lParam, unsigned char *output);
static void cfgtopalette(void); static void cfgtopalette(void);
static void init_palette(void); static void init_palette(void);
@ -622,8 +622,8 @@ static void click (Mouse_Button b, int x, int y) {
lasttime = thistime; lasttime = thistime;
} }
static int WINAPI WndProc (HWND hwnd, UINT message, static LRESULT CALLBACK WndProc (HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam) { WPARAM wParam, LPARAM lParam) {
HDC hdc; HDC hdc;
static int ignore_size = FALSE; static int ignore_size = FALSE;
static int ignore_clip = FALSE; static int ignore_clip = FALSE;
@ -902,11 +902,11 @@ static int WINAPI WndProc (HWND hwnd, UINT message,
ignore_size = TRUE; /* don't panic on next WM_SIZE msg */ ignore_size = TRUE; /* don't panic on next WM_SIZE msg */
break; break;
case WM_ENTERSIZEMOVE: case WM_ENTERSIZEMOVE:
EnableSizeTip(1); EnableSizeTip(1);
break; break;
case WM_EXITSIZEMOVE: case WM_EXITSIZEMOVE:
EnableSizeTip(0); EnableSizeTip(0);
break; break;
case WM_SIZING: case WM_SIZING:
{ {
int width, height, w, h, ew, eh; int width, height, w, h, ew, eh;
@ -916,7 +916,7 @@ static int WINAPI WndProc (HWND hwnd, UINT message,
height = r->bottom - r->top - extra_height; height = r->bottom - r->top - extra_height;
w = (width + font_width/2) / font_width; if (w < 1) w = 1; w = (width + font_width/2) / font_width; if (w < 1) w = 1;
h = (height + font_height/2) / font_height; if (h < 1) h = 1; h = (height + font_height/2) / font_height; if (h < 1) h = 1;
UpdateSizeTip(hwnd, w, h); UpdateSizeTip(hwnd, w, h);
ew = width - w * font_width; ew = width - w * font_width;
eh = height - h * font_height; eh = height - h * font_height;
if (ew != 0) { if (ew != 0) {
@ -940,7 +940,7 @@ static int WINAPI WndProc (HWND hwnd, UINT message,
else else
return 0; return 0;
} }
break; /* break; (never reached) */
case WM_SIZE: case WM_SIZE:
if (wParam == SIZE_MINIMIZED) { if (wParam == SIZE_MINIMIZED) {
SetWindowText (hwnd, SetWindowText (hwnd,