mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 01:48:00 +00:00
Cleanups to remove warnings for GNU/mingw32 compilation
[originally from svn r325]
This commit is contained in:
parent
55b8c21f0f
commit
8446532e4a
1
ldisc.c
1
ldisc.c
@ -1,5 +1,6 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
#include "putty.h"
|
#include "putty.h"
|
||||||
|
|
||||||
|
6
scp.c
6
scp.c
@ -164,7 +164,7 @@ static void print_stats(char *name, unsigned long size, unsigned long done,
|
|||||||
eta = size - done;
|
eta = size - done;
|
||||||
else
|
else
|
||||||
eta = (unsigned long) ((size - done) / ratebs);
|
eta = (unsigned long) ((size - done) / ratebs);
|
||||||
sprintf(etastr, "%02d:%02d:%02d",
|
sprintf(etastr, "%02ld:%02ld:%02ld",
|
||||||
eta / 3600, (eta % 3600) / 60, eta % 60);
|
eta / 3600, (eta % 3600) / 60, eta % 60);
|
||||||
|
|
||||||
pct = (int) (100.0 * (float) done / size);
|
pct = (int) (100.0 * (float) done / size);
|
||||||
@ -457,7 +457,7 @@ static void sink(char *targ)
|
|||||||
ssh_send("", 1);
|
ssh_send("", 1);
|
||||||
return;
|
return;
|
||||||
case 'T':
|
case 'T':
|
||||||
if (sscanf(buf, "T%d %*d %d %*d",
|
if (sscanf(buf, "T%ld %*d %ld %*d",
|
||||||
&mtime, &atime) == 2) {
|
&mtime, &atime) == 2) {
|
||||||
settime = 1;
|
settime = 1;
|
||||||
ssh_send("", 1);
|
ssh_send("", 1);
|
||||||
@ -471,7 +471,7 @@ static void sink(char *targ)
|
|||||||
bump("Protocol error: Expected control record");
|
bump("Protocol error: Expected control record");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sscanf(buf+1, "%u %u %[^\n]", &mode, &size, namebuf) != 3)
|
if (sscanf(buf+1, "%u %lu %[^\n]", &mode, &size, namebuf) != 3)
|
||||||
bump("Protocol error: Illegal file descriptor format");
|
bump("Protocol error: Illegal file descriptor format");
|
||||||
if (targisdir) {
|
if (targisdir) {
|
||||||
char t[2048];
|
char t[2048];
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#include <winreg.h>
|
#include <winreg.h>
|
||||||
#include <tchar.h>
|
#include <tchar.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "putty.h"
|
#include "putty.h"
|
||||||
|
|
||||||
|
12
windlg.c
12
windlg.c
@ -304,7 +304,7 @@ static void load_settings (char *section, int do_host) {
|
|||||||
gppi (sesskey, "FontIsBold", 0, &cfg.fontisbold);
|
gppi (sesskey, "FontIsBold", 0, &cfg.fontisbold);
|
||||||
gppi (sesskey, "FontCharSet", ANSI_CHARSET, &cfg.fontcharset);
|
gppi (sesskey, "FontCharSet", ANSI_CHARSET, &cfg.fontcharset);
|
||||||
gppi (sesskey, "FontHeight", 10, &cfg.fontheight);
|
gppi (sesskey, "FontHeight", 10, &cfg.fontheight);
|
||||||
gppi (sesskey, "FontVTMode", VT_POORMAN, &cfg.vtmode);
|
gppi (sesskey, "FontVTMode", VT_POORMAN, (int *)&cfg.vtmode);
|
||||||
gppi (sesskey, "TryPalette", 0, &cfg.try_palette);
|
gppi (sesskey, "TryPalette", 0, &cfg.try_palette);
|
||||||
gppi (sesskey, "BoldAsColour", 1, &cfg.bold_colour);
|
gppi (sesskey, "BoldAsColour", 1, &cfg.bold_colour);
|
||||||
for (i=0; i<22; i++) {
|
for (i=0; i<22; i++) {
|
||||||
@ -316,10 +316,14 @@ static void load_settings (char *section, int do_host) {
|
|||||||
"85,255,255", "187,187,187", "255,255,255"
|
"85,255,255", "187,187,187", "255,255,255"
|
||||||
};
|
};
|
||||||
char buf[20], buf2[30];
|
char buf[20], buf2[30];
|
||||||
|
int c0, c1, c2;
|
||||||
sprintf(buf, "Colour%d", i);
|
sprintf(buf, "Colour%d", i);
|
||||||
gpps (sesskey, buf, defaults[i], buf2, sizeof(buf2));
|
gpps (sesskey, buf, defaults[i], buf2, sizeof(buf2));
|
||||||
sscanf(buf2, "%d,%d,%d", &cfg.colours[i][0],
|
if(sscanf(buf2, "%d,%d,%d", &c0, &c1, &c2) == 3) {
|
||||||
&cfg.colours[i][1], &cfg.colours[i][2]);
|
cfg.colours[i][0] = c0;
|
||||||
|
cfg.colours[i][1] = c1;
|
||||||
|
cfg.colours[i][2] = c2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
gppi (sesskey, "MouseIsXterm", 0, &cfg.mouse_is_xterm);
|
gppi (sesskey, "MouseIsXterm", 0, &cfg.mouse_is_xterm);
|
||||||
for (i=0; i<256; i+=32) {
|
for (i=0; i<256; i+=32) {
|
||||||
@ -1122,7 +1126,7 @@ static int CALLBACK ColourProc (HWND hwnd, UINT msg,
|
|||||||
i = (i < 3 ? i*2 : i == 3 ? 5 : i*2-2);
|
i = (i < 3 ? i*2 : i == 3 ? 5 : i*2-2);
|
||||||
cc.lStructSize = sizeof(cc);
|
cc.lStructSize = sizeof(cc);
|
||||||
cc.hwndOwner = hwnd;
|
cc.hwndOwner = hwnd;
|
||||||
cc.hInstance = hinst;
|
cc.hInstance = (HWND)hinst;
|
||||||
cc.lpCustColors = custom;
|
cc.lpCustColors = custom;
|
||||||
cc.rgbResult = RGB (cfg.colours[i][0], cfg.colours[i][1],
|
cc.rgbResult = RGB (cfg.colours[i][0], cfg.colours[i][1],
|
||||||
cfg.colours[i][2]);
|
cfg.colours[i][2]);
|
||||||
|
5
window.c
5
window.c
@ -3,6 +3,7 @@
|
|||||||
#include <winsock.h>
|
#include <winsock.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
#define PUTTY_DO_GLOBALS /* actually _define_ globals */
|
#define PUTTY_DO_GLOBALS /* actually _define_ globals */
|
||||||
#include "putty.h"
|
#include "putty.h"
|
||||||
@ -150,7 +151,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) {
|
|||||||
*/
|
*/
|
||||||
HANDLE filemap;
|
HANDLE filemap;
|
||||||
Config *cp;
|
Config *cp;
|
||||||
if (sscanf(p+1, "%x", &filemap) == 1 &&
|
if (sscanf(p+1, "%p", &filemap) == 1 &&
|
||||||
(cp = MapViewOfFile(filemap, FILE_MAP_READ,
|
(cp = MapViewOfFile(filemap, FILE_MAP_READ,
|
||||||
0, 0, sizeof(Config))) != NULL) {
|
0, 0, sizeof(Config))) != NULL) {
|
||||||
cfg = *cp;
|
cfg = *cp;
|
||||||
@ -671,7 +672,7 @@ static int WINAPI WndProc (HWND hwnd, UINT message,
|
|||||||
UnmapViewOfFile(p);
|
UnmapViewOfFile(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sprintf(c, "putty &%08x", filemap);
|
sprintf(c, "putty &%p", filemap);
|
||||||
cl = c;
|
cl = c;
|
||||||
} else if (wParam == IDM_SAVEDSESS) {
|
} else if (wParam == IDM_SAVEDSESS) {
|
||||||
char *session = sessions[(lParam - IDM_SAVED_MIN) / 16];
|
char *session = sessions[(lParam - IDM_SAVED_MIN) / 16];
|
||||||
|
Loading…
Reference in New Issue
Block a user