1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-14 17:47:33 -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

@ -24,7 +24,7 @@ void ssh1_connection_direction_specific_setup(
*/
s->mainchan = mainchan_new(
&s->ppl, &s->cl, s->conf, s->term_width, s->term_height,
FALSE /* is_simple */, NULL);
false /* is_simple */, NULL);
}
}
@ -85,7 +85,7 @@ static void ssh1_connection_process_trivial_succfails(void *vs)
{
struct ssh1_connection_state *s = (struct ssh1_connection_state *)vs;
while (s->succfail_head && s->succfail_head->trivial)
ssh1_connection_process_succfail(s, TRUE);
ssh1_connection_process_succfail(s, true);
}
int ssh1_handle_direction_specific_packet(
@ -107,7 +107,7 @@ int ssh1_handle_direction_specific_packet(
ssh_remote_error(s->ppl.ssh,
"Received %s with no outstanding request",
ssh1_pkt_type(pktin->type));
return TRUE;
return true;
}
ssh1_connection_process_succfail(
@ -115,7 +115,7 @@ int ssh1_handle_direction_specific_packet(
queue_toplevel_callback(
ssh1_connection_process_trivial_succfails, s);
return TRUE;
return true;
case SSH1_SMSG_X11_OPEN:
remid = get_uint32(pktin);
@ -133,9 +133,9 @@ int ssh1_handle_direction_specific_packet(
ssh1_channel_init(c);
c->remoteid = remid;
c->chan = x11_new_channel(s->x11authtree, &c->sc,
NULL, -1, FALSE);
NULL, -1, false);
c->remoteid = remid;
c->halfopen = FALSE;
c->halfopen = false;
pktout = ssh_bpp_new_pktout(
s->ppl.bpp, SSH1_MSG_CHANNEL_OPEN_CONFIRMATION);
@ -145,7 +145,7 @@ int ssh1_handle_direction_specific_packet(
ppl_logevent(("Opened X11 forward channel"));
}
return TRUE;
return true;
case SSH1_SMSG_AGENT_OPEN:
remid = get_uint32(pktin);
@ -162,7 +162,7 @@ int ssh1_handle_direction_specific_packet(
ssh1_channel_init(c);
c->remoteid = remid;
c->chan = agentf_new(&c->sc);
c->halfopen = FALSE;
c->halfopen = false;
pktout = ssh_bpp_new_pktout(
s->ppl.bpp, SSH1_MSG_CHANNEL_OPEN_CONFIRMATION);
@ -171,7 +171,7 @@ int ssh1_handle_direction_specific_packet(
pq_push(s->ppl.out_pq, pktout);
}
return TRUE;
return true;
case SSH1_MSG_PORT_OPEN:
remid = get_uint32(pktin);
@ -211,7 +211,7 @@ int ssh1_handle_direction_specific_packet(
} else {
ssh1_channel_init(c);
c->remoteid = remid;
c->halfopen = FALSE;
c->halfopen = false;
pktout = ssh_bpp_new_pktout(
s->ppl.bpp, SSH1_MSG_CHANNEL_OPEN_CONFIRMATION);
put_uint32(pktout, c->remoteid);
@ -223,7 +223,7 @@ int ssh1_handle_direction_specific_packet(
sfree(pf.dhost);
return TRUE;
return true;
case SSH1_SMSG_STDOUT_DATA:
case SSH1_SMSG_STDERR_DATA:
@ -238,7 +238,7 @@ int ssh1_handle_direction_specific_packet(
}
}
return TRUE;
return true;
case SSH1_SMSG_EXIT_STATUS:
{
@ -246,12 +246,12 @@ int ssh1_handle_direction_specific_packet(
ppl_logevent(("Server sent command exit status %d", exitcode));
ssh_got_exitcode(s->ppl.ssh, exitcode);
s->session_terminated = TRUE;
s->session_terminated = true;
}
return TRUE;
return true;
default:
return FALSE;
return false;
}
}
@ -289,7 +289,7 @@ static void ssh1mainchan_request_x11_forwarding(
put_uint32(pktout, screen_number);
pq_push(s->ppl.out_pq, pktout);
ssh1mainchan_queue_response(s, want_reply, FALSE);
ssh1mainchan_queue_response(s, want_reply, false);
}
static void ssh1mainchan_request_agent_forwarding(
@ -303,7 +303,7 @@ static void ssh1mainchan_request_agent_forwarding(
s->ppl.bpp, SSH1_CMSG_AGENT_REQUEST_FORWARDING);
pq_push(s->ppl.out_pq, pktout);
ssh1mainchan_queue_response(s, want_reply, FALSE);
ssh1mainchan_queue_response(s, want_reply, false);
}
static void ssh1mainchan_request_pty(
@ -324,13 +324,13 @@ static void ssh1mainchan_request_pty(
get_ttymodes_from_conf(s->ppl.seat, conf));
pq_push(s->ppl.out_pq, pktout);
ssh1mainchan_queue_response(s, want_reply, FALSE);
ssh1mainchan_queue_response(s, want_reply, false);
}
static int ssh1mainchan_send_env_var(
SshChannel *sc, int want_reply, const char *var, const char *value)
{
return FALSE; /* SSH-1 doesn't support this at all */
return false; /* SSH-1 doesn't support this at all */
}
static void ssh1mainchan_start_shell(
@ -343,7 +343,7 @@ static void ssh1mainchan_start_shell(
pktout = ssh_bpp_new_pktout(s->ppl.bpp, SSH1_CMSG_EXEC_SHELL);
pq_push(s->ppl.out_pq, pktout);
ssh1mainchan_queue_response(s, want_reply, TRUE);
ssh1mainchan_queue_response(s, want_reply, true);
}
static void ssh1mainchan_start_command(
@ -357,25 +357,25 @@ static void ssh1mainchan_start_command(
put_stringz(pktout, command);
pq_push(s->ppl.out_pq, pktout);
ssh1mainchan_queue_response(s, want_reply, TRUE);
ssh1mainchan_queue_response(s, want_reply, true);
}
static int ssh1mainchan_start_subsystem(
SshChannel *sc, int want_reply, const char *subsystem)
{
return FALSE; /* SSH-1 doesn't support this at all */
return false; /* SSH-1 doesn't support this at all */
}
static int ssh1mainchan_send_serial_break(
SshChannel *sc, int want_reply, int length)
{
return FALSE; /* SSH-1 doesn't support this at all */
return false; /* SSH-1 doesn't support this at all */
}
static int ssh1mainchan_send_signal(
SshChannel *sc, int want_reply, const char *signame)
{
return FALSE; /* SSH-1 doesn't support this at all */
return false; /* SSH-1 doesn't support this at all */
}
static void ssh1mainchan_send_terminal_size_change(
@ -512,7 +512,7 @@ struct ssh_rportfwd *ssh1_rportfwd_alloc(
put_uint32(pktout, rpf->dport);
pq_push(s->ppl.out_pq, pktout);
ssh1_queue_succfail_handler(s, ssh1_rportfwd_response, rpf, FALSE);
ssh1_queue_succfail_handler(s, ssh1_rportfwd_response, rpf, false);
return rpf;
}
@ -520,12 +520,12 @@ struct ssh_rportfwd *ssh1_rportfwd_alloc(
SshChannel *ssh1_serverside_x11_open(
ConnectionLayer *cl, Channel *chan, const SocketPeerInfo *pi)
{
assert(FALSE && "Should never be called in the client");
assert(false && "Should never be called in the client");
return NULL;
}
SshChannel *ssh1_serverside_agent_open(ConnectionLayer *cl, Channel *chan)
{
assert(FALSE && "Should never be called in the client");
assert(false && "Should never be called in the client");
return NULL;
}