1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-16 02:27:32 -05:00

Adopt C99 <stdbool.h>'s true/false.

This commit includes <stdbool.h> from defs.h and deletes my
traditional definitions of TRUE and FALSE, but other than that, it's a
100% mechanical search-and-replace transforming all uses of TRUE and
FALSE into the C99-standardised lowercase spellings.

No actual types are changed in this commit; that will come next. This
is just getting the noise out of the way, so that subsequent commits
can have a higher proportion of signal.
This commit is contained in:
Simon Tatham
2018-10-29 19:50:29 +00:00
parent a647f2ba11
commit a6f1709c2f
127 changed files with 1994 additions and 2012 deletions

View File

@ -81,12 +81,12 @@ char *get_username(void)
{
DWORD namelen;
char *user;
int got_username = FALSE;
int got_username = false;
DECL_WINDOWS_FUNCTION(static, BOOLEAN, GetUserNameExA,
(EXTENDED_NAME_FORMAT, LPSTR, PULONG));
{
static int tried_usernameex = FALSE;
static int tried_usernameex = false;
if (!tried_usernameex) {
/* Not available on Win9x, so load dynamically */
HMODULE secur32 = load_system32_dll("secur32.dll");
@ -97,7 +97,7 @@ char *get_username(void)
HMODULE sspicli = load_system32_dll("sspicli.dll");
(void)sspicli; /* squash compiler warning about unused variable */
GET_WINDOWS_FUNCTION(secur32, GetUserNameExA);
tried_usernameex = TRUE;
tried_usernameex = true;
}
}
@ -125,7 +125,7 @@ char *get_username(void)
if (!got_username) {
/* Fall back to local user name */
namelen = 0;
if (GetUserName(NULL, &namelen) == FALSE) {
if (GetUserName(NULL, &namelen) == false) {
/*
* Apparently this doesn't work at least on Windows XP SP2.
* Thus assume a maximum of 256. It will fail again if it
@ -604,7 +604,7 @@ int open_for_write_would_lose_data(const Filename *fn)
* let the subsequent attempt to open the file for real give a
* more useful error message.
*/
return FALSE;
return false;
}
if (attrs.dwFileAttributes & (FILE_ATTRIBUTE_DEVICE |
FILE_ATTRIBUTE_DIRECTORY)) {
@ -613,7 +613,7 @@ int open_for_write_would_lose_data(const Filename *fn)
* opening it for writing will not cause truncation. (It may
* not _succeed_ either, but that's not our problem here!)
*/
return FALSE;
return false;
}
if (attrs.nFileSizeHigh == 0 && attrs.nFileSizeLow == 0) {
/*
@ -622,7 +622,7 @@ int open_for_write_would_lose_data(const Filename *fn)
* opening it for writing won't truncate any data away because
* there's nothing to truncate anyway.
*/
return FALSE;
return false;
}
return TRUE;
return true;
}