simon-git: putty (master): Simon Tatham
Commits to Tartarus hosted VCS
tartarus-commits at lists.tartarus.org
Tue Mar 10 21:28:03 GMT 2020
TL;DR:
b4e1bca2 Change vtable defs to use C99 designated initialisers.
fb80717e Fix typo in a top-of-file comment.
18d273fc Rework per-backend GUI configuration.
Repository: https://git.tartarus.org/simon/putty.git
On the web: https://git.tartarus.org/?p=simon/putty.git
Branch updated: master
Committer: Simon Tatham <anakin at pobox.com>
Date: 2020-03-10 21:28:03
commit b4e1bca2c31b830503921ae96412b2b00aa86fac
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=b4e1bca2c31b830503921ae96412b2b00aa86fac;hp=ade10f13040474b8fecf0427e14cc34f481d5f0b
Author: Simon Tatham <anakin at pobox.com>
Date: Tue Mar 10 21:06:29 2020 +0000
Change vtable defs to use C99 designated initialisers.
This is a sweeping change applied across the whole code base by a spot
of Emacs Lisp. Now, everywhere I declare a vtable filled with function
pointers (and the occasional const data member), all the members of
the vtable structure are initialised by name using the '.fieldname =
value' syntax introduced in C99.
We were already using this syntax for a handful of things in the new
key-generation progress report system, so it's not new to the code
base as a whole.
The advantage is that now, when a vtable only declares a subset of the
available fields, I can initialise the rest to NULL or zero just by
leaving them out. This is most dramatic in a couple of the outlying
vtables in things like psocks (which has a ConnectionLayerVtable
containing only one non-NULL method), but less dramatically, it means
that the new 'flags' field in BackendVtable can be completely left out
of every backend definition except for the SUPDUP one which defines it
to a nonzero value. Similarly, the test_for_upstream method only used
by SSH doesn't have to be mentioned in the rest of the backends;
network Plugs for listening sockets don't have to explicitly null out
'receive' and 'sent', and vice versa for 'accepting', and so on.
While I'm at it, I've normalised the declarations so they don't use
the unnecessarily verbose 'struct' keyword. Also a handful of them
weren't const; now they are.
agentf.c | 46 +++++------
clicons.c | 8 +-
cmdgen.c | 14 ++--
errsock.c | 13 ++-
fuzzterm.c | 56 ++++++-------
mainchan.c | 46 +++++------
nullplug.c | 9 +--
pageant.c | 43 +++++-----
portfwd.c | 63 +++++++--------
proxy.c | 30 +++----
pscp.c | 42 +++++-----
psftp.c | 42 +++++-----
psocks.c | 65 +++------------
raw.c | 50 ++++++------
rlogin.c | 50 ++++++------
scpserver.c | 48 ++++++------
sesschan.c | 204 ++++++++++++++++++++++++------------------------
sftpserver.c | 18 ++---
ssh.c | 91 +++++++++++----------
ssh.h | 8 +-
ssh1bpp.c | 14 ++--
ssh1connection-client.c | 37 ++++-----
ssh1connection-server.c | 29 ++-----
ssh1connection.c | 94 +++++++++-------------
ssh1login-server.c | 20 ++---
ssh1login.c | 20 ++---
ssh2bpp-bare.c | 16 ++--
ssh2bpp.c | 14 ++--
ssh2connection.c | 114 +++++++++++++--------------
ssh2transport.c | 35 +++++----
ssh2userauth-server.c | 16 ++--
ssh2userauth.c | 20 ++---
sshaes.c | 59 ++++++++++----
ssharcf.c | 34 +++++---
sshblowf.c | 53 ++++++++-----
sshbpp.h | 2 +
sshccp.c | 45 ++++++-----
sshchan.h | 4 +
sshcommon.c | 46 +++++------
sshdes.c | 74 ++++++++++++++----
sshdss.c | 35 ++++-----
sshecc.c | 180 +++++++++++++++++++-----------------------
sshhmac.c | 88 +++++++++++++++------
sshmd5.c | 10 ++-
sshppl.h | 1 +
sshprime.c | 14 ++--
sshrsa.c | 36 ++++-----
sshserver.c | 51 ++++++------
sshsh256.c | 51 ++++++++----
sshsh512.c | 20 ++++-
sshsha.c | 49 +++++++++---
sshsha3.c | 31 +++++---
sshshare.c | 15 ++--
sshverstring.c | 14 ++--
sshzlib.c | 18 ++---
supdup.c | 51 ++++++------
telnet.c | 49 ++++++------
testback.c | 50 +++++++++---
unix/gtkfont.c | 72 ++++++++---------
unix/gtkfont.h | 3 +-
unix/gtkwin.c | 110 +++++++++++++-------------
unix/uxfdsock.c | 16 ++--
unix/uxnet.c | 18 ++---
unix/uxpgnt.c | 13 ++-
unix/uxplink.c | 42 +++++-----
unix/uxpsusan.c | 8 +-
unix/uxpty.c | 39 +++++----
unix/uxser.c | 39 +++++----
unix/uxserver.c | 16 ++--
unix/uxsftpserver.c | 36 ++++-----
windows/windlg.c | 8 +-
windows/window.c | 98 +++++++++++------------
windows/winhsock.c | 16 ++--
windows/winnet.c | 16 ++--
windows/winnps.c | 12 +--
windows/winpgen.c | 14 ++--
windows/winpgnt.c | 10 +--
windows/winplink.c | 42 +++++-----
windows/winser.c | 39 +++++----
x11fwd.c | 55 +++++++------
80 files changed, 1648 insertions(+), 1529 deletions(-)
commit fb80717e7e7ed10c86523ebc4b325f1079a6b24d
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=fb80717e7e7ed10c86523ebc4b325f1079a6b24d;hp=b4e1bca2c31b830503921ae96412b2b00aa86fac
Author: Simon Tatham <anakin at pobox.com>
Date: Tue Mar 10 21:11:14 2020 +0000
Fix typo in a top-of-file comment.
uxfdsock.c may have to contain a sock, but in spite of that, it is not
actually sick.
unix/uxfdsock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
commit 18d273fcf1eca232fb1ace58b31b21e6da79d4bf
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=18d273fcf1eca232fb1ace58b31b21e6da79d4bf;hp=fb80717e7e7ed10c86523ebc4b325f1079a6b24d
Author: Simon Tatham <anakin at pobox.com>
Date: Tue Mar 10 21:18:08 2020 +0000
Rework per-backend GUI configuration.
In commit 1f399bec58 I had the idea of generating the protocol radio
buttons in the GUI configurer by looping over the backends[] array,
which gets the reliably correct list of available backends for a given
binary rather than having to second-guess. That's given me an idea: we
can do the same for the per-backend config panels too.
Now the GUI config panel for every backend is guarded by a check of
backend_vt_from_proto, and we won't display the config for that
backend unless it's present.
In particular, this allows me to move the serial-port configuration
back into config.c from the separate file sercfg.c: we find out
whether to apply it by querying backend_vt_from_proto(PROT_SERIAL),
the same as any other backend.
In _particular_ particular, that also makes it much easier for me to
move the serial config up the pecking order, so that it's now second
only to SSH in the list of per-protocol config panes, which I think is
now where it deserves to be.
(A side effect of that is that I now have to come up with a different
method of having each serial backend specify the subset of parity and
flow control schemes it supports. I've done it by adding an extra pair
of serial-port specific bitmask fields to BackendVtable, taking
advantage of the new vtable definition idiom to avoid having to
boringly declare them as zero in all the other backends.)
Recipe | 4 +-
config.c | 182 +++++++++++++++++++++++++++++++++++++++++++++++++++----
putty.h | 4 ++
sercfg.c | 171 ---------------------------------------------------
unix/uxcfg.c | 9 ---
unix/uxser.c | 6 ++
windows/wincfg.c | 6 --
windows/winser.c | 9 +++
8 files changed, 191 insertions(+), 200 deletions(-)
More information about the tartarus-commits
mailing list