1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-01 11:32:48 -05:00

Formatting: normalise to put a space after condition keywords.

'if (thing)' is the local style here, not 'if(thing)'. Similarly with
'for' and 'while'.
This commit is contained in:
Simon Tatham
2022-12-28 15:32:24 +00:00
parent 6fcc7ed728
commit d509a2dc1e
10 changed files with 39 additions and 39 deletions

View File

@ -26,7 +26,7 @@
if (uli.QuadPart != 0) \
uli.QuadPart = uli.QuadPart / CNS_PERSEC - UNIX_EPOCH; \
(t) = (time_t) uli.QuadPart; \
} while(0)
} while (0)
/* Windows code to set up the GSSAPI library list. */
@ -142,7 +142,7 @@ struct ssh_gss_liblist *ssh_gss_setup(Conf *conf)
char *installdir = get_reg_sz(regkey, "InstallDir");
if (installdir) {
char *bindir = dupcat(installdir, "\\bin");
if(p_AddDllDirectory) {
if (p_AddDllDirectory) {
/* Add MIT Kerberos' path to the DLL search path,
* it loads its own DLLs further down the road */
wchar_t *dllPath = dup_mb_to_wc(DEFAULT_CODEPAGE, 0, bindir);
@ -235,7 +235,7 @@ struct ssh_gss_liblist *ssh_gss_setup(Conf *conf)
module = NULL;
path = conf_get_filename(conf, CONF_ssh_gss_custom)->path;
if (*path) {
if(p_AddDllDirectory) {
if (p_AddDllDirectory) {
/* Add the custom directory as well in case it chainloads
* some other DLLs (e.g a non-installed MIT Kerberos
* instance) */

View File

@ -559,7 +559,7 @@ static void prompt_add_keyfile(bool encrypted)
of.lpstrTitle = "Select Private Key File";
of.Flags = OFN_ALLOWMULTISELECT | OFN_EXPLORER;
if (request_file(keypath, &of, true, false)) {
if(strlen(filelist) > of.nFileOffset) {
if (strlen(filelist) > of.nFileOffset) {
/* Only one filename returned? */
Filename *fn = filename_from_str(filelist);
win_add_keyfile(fn, encrypted);
@ -804,7 +804,7 @@ static INT_PTR CALLBACK KeyListProc(HWND hwnd, UINT msg,
/* do the same for the rsa keys */
for (i = rCount - 1; (itemNum >= 0) && (i >= 0); i--) {
if(selectedArray[itemNum] == i) {
if (selectedArray[itemNum] == i) {
switch (LOWORD(wParam)) {
case IDC_KEYLIST_REMOVE:
pageant_delete_nth_ssh1_key(i);
@ -909,10 +909,10 @@ static void update_sessions(void)
if (!putty_path)
return;
if(ERROR_SUCCESS != RegOpenKey(HKEY_CURRENT_USER, PUTTY_REGKEY, &hkey))
if (ERROR_SUCCESS != RegOpenKey(HKEY_CURRENT_USER, PUTTY_REGKEY, &hkey))
return;
for(num_entries = GetMenuItemCount(session_menu);
for (num_entries = GetMenuItemCount(session_menu);
num_entries > initial_menuitems_count;
num_entries--)
RemoveMenu(session_menu, 0, MF_BYPOSITION);
@ -921,8 +921,8 @@ static void update_sessions(void)
index_menu = 0;
sb = strbuf_new();
while(ERROR_SUCCESS == RegEnumKey(hkey, index_key, buf, MAX_PATH)) {
if(strcmp(buf, PUTTY_DEFAULT) != 0) {
while (ERROR_SUCCESS == RegEnumKey(hkey, index_key, buf, MAX_PATH)) {
if (strcmp(buf, PUTTY_DEFAULT) != 0) {
strbuf_clear(sb);
unescape_registry_key(buf, sb);
@ -942,7 +942,7 @@ static void update_sessions(void)
RegCloseKey(hkey);
if(index_menu == 0) {
if (index_menu == 0) {
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_TYPE | MIIM_STATE;
mii.fType = MFT_STRING;
@ -1311,8 +1311,8 @@ static LRESULT CALLBACK TrayWndProc(HWND hwnd, UINT message,
if (restrict_putty_acl)
strcat(cmdline, "&R");
if((INT_PTR)ShellExecute(hwnd, NULL, putty_path, cmdline,
_T(""), SW_SHOW) <= 32) {
if ((INT_PTR)ShellExecute(hwnd, NULL, putty_path, cmdline,
_T(""), SW_SHOW) <= 32) {
MessageBox(NULL, "Unable to execute PuTTY!",
"Error", MB_OK | MB_ICONERROR);
}
@ -1371,7 +1371,7 @@ static LRESULT CALLBACK TrayWndProc(HWND hwnd, UINT message,
launch_help(hwnd, WINHELP_CTX_pageant_general);
break;
default: {
if(wParam >= IDM_SESSIONS_BASE && wParam <= IDM_SESSIONS_MAX) {
if (wParam >= IDM_SESSIONS_BASE && wParam <= IDM_SESSIONS_MAX) {
MENUITEMINFO mii;
TCHAR buf[MAX_PATH + 1];
TCHAR param[MAX_PATH + 1];
@ -1386,8 +1386,8 @@ static LRESULT CALLBACK TrayWndProc(HWND hwnd, UINT message,
strcat(param, "&R");
strcat(param, "@");
strcat(param, mii.dwTypeData);
if((INT_PTR)ShellExecute(hwnd, NULL, putty_path, param,
_T(""), SW_SHOW) <= 32) {
if ((INT_PTR)ShellExecute(hwnd, NULL, putty_path, param,
_T(""), SW_SHOW) <= 32) {
MessageBox(NULL, "Unable to execute PuTTY!", "Error",
MB_OK | MB_ICONERROR);
}
@ -1835,7 +1835,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
args = strchr(command, ' ');
if (args) {
*args++ = 0;
while(*args && isspace(*args)) args++;
while (*args && isspace(*args)) args++;
}
spawn_cmd(command, args, show);
}

View File

@ -86,14 +86,14 @@ static inline uint64_t uint64_from_words(uint32_t hi, uint32_t lo)
uli.QuadPart = ((ULONGLONG)(t) + 11644473600ull) * 10000000ull; \
(ft).dwLowDateTime = uli.LowPart; \
(ft).dwHighDateTime = uli.HighPart; \
} while(0)
} while (0)
#define TIME_WIN_TO_POSIX(ft, t) do { \
ULARGE_INTEGER uli; \
uli.LowPart = (ft).dwLowDateTime; \
uli.HighPart = (ft).dwHighDateTime; \
uli.QuadPart = uli.QuadPart / 10000000ull - 11644473600ull; \
(t) = (unsigned long) uli.QuadPart; \
} while(0)
} while (0)
struct RFile {
HANDLE h;

View File

@ -682,7 +682,7 @@ void init_ucs(Conf *conf, struct unicode_data *ucsdata)
if (!DIRECT_FONT(ucsdata->unitab_xterm[i]))
ucsdata->unitab_xterm[i] =
(WCHAR) (CSET_ACP + poorman_vt100[i - 96]);
for(i=128;i<256;i++)
for (i = 128; i < 256; i++)
if (!DIRECT_FONT(ucsdata->unitab_scoacs[i]))
ucsdata->unitab_scoacs[i] =
(WCHAR) (CSET_ACP + poorman_scoacs[i - 128]);
@ -695,7 +695,7 @@ static void link_font(WCHAR *line_tbl, WCHAR *font_tbl, WCHAR attr)
for (line_index = 0; line_index < 256; line_index++) {
if (DIRECT_FONT(line_tbl[line_index]))
continue;
for(i = 0; i < 256; i++) {
for (i = 0; i < 256; i++) {
font_index = ((32 + i) & 0xFF);
if (line_tbl[line_index] == font_tbl[font_index]) {
line_tbl[line_index] = (WCHAR) (attr + font_index);

View File

@ -2550,7 +2550,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
* `ready to appear' state.
*/
show_mouseptr(wgs, true); /* make sure pointer is visible */
if( lParam == 0 )
if (lParam == 0)
PostMessage(hwnd, WM_CHAR, ' ', 0);
break;
case IDM_FULLSCREEN:
@ -3792,7 +3792,7 @@ static void do_text_internal(
uni_buf = snewn(uni_len, wchar_t);
}
for(nlen = mptr = 0; mptr<len; mptr++) {
for (nlen = mptr = 0; mptr<len; mptr++) {
uni_buf[nlen] = 0xFFFD;
if (IsDBCSLeadByteEx(wgs->ucsdata.font_codepage,
(BYTE) text[mptr])) {
@ -4673,8 +4673,8 @@ static int TranslateKey(WinGuiSeat *wgs, UINT message, WPARAM wParam,
bool capsOn = false;
/* helg: clear CAPS LOCK state if caps lock switches to cyrillic */
if(keystate[VK_CAPITAL] != 0 &&
conf_get_bool(wgs->conf, CONF_xlat_capslockcyr)) {
if (keystate[VK_CAPITAL] != 0 &&
conf_get_bool(wgs->conf, CONF_xlat_capslockcyr)) {
capsOn = !left_alt;
keystate[VK_CAPITAL] = 0;
}
@ -4778,7 +4778,7 @@ static int TranslateKey(WinGuiSeat *wgs, UINT message, WPARAM wParam,
term_keyinputw(wgs->term, &wch, 1);
}
} else {
if(capsOn && wch < 0x80) {
if (capsOn && wch < 0x80) {
WCHAR cbuf[2];
cbuf[0] = 27;
cbuf[1] = xlat_uskbd2cyrllic(wch);