mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-06-30 19:12:48 -05:00
Make cmdline_tooltype a const int.
Another ugly mutable global variable gone: now, instead of this variable being defined in cmdline.c and written to by everyone's main(), it's defined _alongside_ everyone's main() as a constant, and cmdline.c just refers to it. A bonus is that now nocmdline.c doesn't have to define it anyway for tools that don't use cmdline.c. But mostly, it didn't need to be mutable, so better for it not to be. While I'm at it, I've also fiddled with the bit flags that go in it, to define their values automatically using a list macro instead of manually specifying each one to be a different power of 2.
This commit is contained in:
@ -570,6 +570,12 @@ const bool share_can_be_upstream = true;
|
||||
|
||||
const bool buildinfo_gtk_relevant = false;
|
||||
|
||||
const unsigned cmdline_tooltype =
|
||||
TOOLTYPE_HOST_ARG |
|
||||
TOOLTYPE_HOST_ARG_CAN_BE_SESSION |
|
||||
TOOLTYPE_HOST_ARG_PROTOCOL_PREFIX |
|
||||
TOOLTYPE_HOST_ARG_FROM_LAUNCHABLE_LOAD;
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
bool sending;
|
||||
@ -603,12 +609,6 @@ int main(int argc, char **argv)
|
||||
stderr_bs = BinarySink_UPCAST(&stderr_bcs);
|
||||
outgoingeof = EOF_NO;
|
||||
|
||||
cmdline_tooltype |=
|
||||
(TOOLTYPE_HOST_ARG |
|
||||
TOOLTYPE_HOST_ARG_CAN_BE_SESSION |
|
||||
TOOLTYPE_HOST_ARG_PROTOCOL_PREFIX |
|
||||
TOOLTYPE_HOST_ARG_FROM_LAUNCHABLE_LOAD);
|
||||
|
||||
stderr_tty_init();
|
||||
/*
|
||||
* Process the command line.
|
||||
|
@ -14,6 +14,8 @@ const bool dup_check_launchable = false; /* no need to check host name
|
||||
* in conf */
|
||||
const bool use_pty_argv = true;
|
||||
|
||||
const unsigned cmdline_tooltype = TOOLTYPE_NONNETWORK;
|
||||
|
||||
/* gtkwin.c will call this, and in pterm it's not needed */
|
||||
void noise_ultralight(NoiseSourceId id, unsigned long data) { }
|
||||
|
||||
@ -46,7 +48,6 @@ char *make_default_wintitle(char *hostname)
|
||||
|
||||
void setup(bool single)
|
||||
{
|
||||
cmdline_tooltype = TOOLTYPE_NONNETWORK;
|
||||
default_protocol = -1;
|
||||
|
||||
if (single)
|
||||
|
@ -77,11 +77,14 @@ char *platform_get_x_display(void) {
|
||||
const bool share_can_be_downstream = true;
|
||||
const bool share_can_be_upstream = true;
|
||||
|
||||
const unsigned cmdline_tooltype =
|
||||
TOOLTYPE_HOST_ARG |
|
||||
TOOLTYPE_PORT_ARG |
|
||||
TOOLTYPE_NO_VERBOSE_OPTION;
|
||||
|
||||
void setup(bool single)
|
||||
{
|
||||
sk_init();
|
||||
cmdline_tooltype |= TOOLTYPE_HOST_ARG | TOOLTYPE_PORT_ARG |
|
||||
TOOLTYPE_NO_VERBOSE_OPTION;
|
||||
default_protocol = be_default_protocol;
|
||||
/* Find the appropriate default port. */
|
||||
{
|
||||
|
Reference in New Issue
Block a user