1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-06-30 19:12:48 -05:00

Move default_protocol and default_port into settings.c.

These global variables are only ever used by load_settings, which uses
them to vary the default protocol and port number in the absence of
any specification elsewhere. So there's no real need for them to be
universally accessible via the awkward GLOBAL mechanism: they can be
statics inside settings.c, with accessor functions that can set them.

That was the last GLOBAL in putty.h, so I've removed the definition of
the macro GLOBAL itself as well. There are still some GLOBALs in the
Windows subdirectory, though.
This commit is contained in:
Simon Tatham
2020-02-02 10:00:42 +00:00
parent e9c3f1ca6d
commit 46fc31c062
9 changed files with 53 additions and 66 deletions

View File

@ -532,14 +532,14 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
char *p;
bool special_launchable_argument = false;
default_protocol = be_default_protocol;
settings_set_default_protocol(be_default_protocol);
/* Find the appropriate default port. */
{
const struct BackendVtable *vt =
backend_vt_from_proto(default_protocol);
default_port = 0; /* illegal */
backend_vt_from_proto(be_default_protocol);
settings_set_default_port(0); /* illegal */
if (vt)
default_port = vt->default_port;
settings_set_default_port(vt->default_port);
}
conf_set_int(conf, CONF_logtype, LGTYP_NONE);