mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-09 07:13:43 -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:
@ -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