1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-05-28 23:34:49 -05:00

64-bit cleanness: use INT_PTR/UINT_PTR where appropriate.

These integer types are correct for the id/handle parameter to
AppendMenu / InsertMenu / DeleteMenu, and also for the return type of
dialog box procedures.
This commit is contained in:
Simon Tatham 2016-04-02 14:10:27 +01:00
parent 00960d8695
commit 83746d7236
2 changed files with 15 additions and 14 deletions

View File

@ -67,8 +67,8 @@ void force_normal(HWND hwnd)
recurse = 0;
}
static int CALLBACK LogProc(HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam)
static INT_PTR CALLBACK LogProc(HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam)
{
int i;
@ -162,8 +162,8 @@ static int CALLBACK LogProc(HWND hwnd, UINT msg,
return 0;
}
static int CALLBACK LicenceProc(HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam)
static INT_PTR CALLBACK LicenceProc(HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam)
{
switch (msg) {
case WM_INITDIALOG:
@ -189,8 +189,8 @@ static int CALLBACK LicenceProc(HWND hwnd, UINT msg,
return 0;
}
static int CALLBACK AboutProc(HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam)
static INT_PTR CALLBACK AboutProc(HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam)
{
char *str;
@ -291,8 +291,8 @@ static void SaneEndDialog(HWND hwnd, int ret)
/*
* Null dialog procedure.
*/
static int CALLBACK NullDlgProc(HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam)
static INT_PTR CALLBACK NullDlgProc(HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam)
{
return 0;
}
@ -375,8 +375,8 @@ static void create_controls(HWND hwnd, char *path)
* (Being a dialog procedure, in general it returns 0 if the default
* dialog processing should be performed, and 1 if it should not.)
*/
static int CALLBACK GenericMainDlgProc(HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam)
static INT_PTR CALLBACK GenericMainDlgProc(HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam)
{
HWND hw, treeview;
struct treeview_faff tvfaff;

View File

@ -827,7 +827,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
AppendMenu(m, MF_SEPARATOR, 0, 0);
AppendMenu(m, MF_ENABLED, IDM_NEWSESS, "Ne&w Session...");
AppendMenu(m, MF_ENABLED, IDM_DUPSESS, "&Duplicate Session");
AppendMenu(m, MF_POPUP | MF_ENABLED, (UINT) savedsess_menu,
AppendMenu(m, MF_POPUP | MF_ENABLED, (UINT_PTR) savedsess_menu,
"Sa&ved Sessions");
AppendMenu(m, MF_ENABLED, IDM_RECONF, "Chan&ge Settings...");
AppendMenu(m, MF_SEPARATOR, 0, 0);
@ -1054,7 +1054,7 @@ void update_specials_menu(void *frontend)
saved_menu = new_menu; /* XXX lame stacking */
new_menu = CreatePopupMenu();
AppendMenu(saved_menu, MF_POPUP | MF_ENABLED,
(UINT) new_menu, specials[i].name);
(UINT_PTR) new_menu, specials[i].name);
break;
case TS_EXITMENU:
nesting--;
@ -1079,13 +1079,14 @@ void update_specials_menu(void *frontend)
for (j = 0; j < lenof(popup_menus); j++) {
if (specials_menu) {
/* XXX does this free up all submenus? */
DeleteMenu(popup_menus[j].menu, (UINT)specials_menu, MF_BYCOMMAND);
DeleteMenu(popup_menus[j].menu, (UINT_PTR)specials_menu,
MF_BYCOMMAND);
DeleteMenu(popup_menus[j].menu, IDM_SPECIALSEP, MF_BYCOMMAND);
}
if (new_menu) {
InsertMenu(popup_menus[j].menu, IDM_SHOWLOG,
MF_BYCOMMAND | MF_POPUP | MF_ENABLED,
(UINT) new_menu, "S&pecial Command");
(UINT_PTR) new_menu, "S&pecial Command");
InsertMenu(popup_menus[j].menu, IDM_SHOWLOG,
MF_BYCOMMAND | MF_SEPARATOR, IDM_SPECIALSEP, 0);
}