simon-git: putty (master): Simon Tatham
Commits to Tartarus hosted VCS
tartarus-commits at lists.tartarus.org
Sat Nov 3 13:49:18 GMT 2018
TL;DR:
1d459fc7 Fix misuse of FALSE for null pointer return values.
3a2afbc9 Remove duplicate typedef for mainchan.
5cb56389 Remove three uses of bitwise ops on boolean values.
a647f2ba Adopt C99 <stdint.h> integer types.
a6f1709c Adopt C99 <stdbool.h>'s true/false.
5691805c Introduce a conf value type of bool.
1378bb04 Switch some Conf settings over to being bool.
3214563d Convert a lot of 'int' variables to 'bool'.
f9cb4eb5 Make a few small helper functions inline.
3933a27d Make send_raw_mouse a field of GtkFrontend.
650bfbb0 Nitpick: fix missing 'void' in one declaration.
9248f5c9 winnet.c: remove duplicated errstring system.
c089827e Rework mungestr() and unmungestr().
91d16881 Add missing 'static' on file-internal declarations.
c5895ec2 Move all extern declarations into header files.
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: 2018-11-03 13:49:18
commit 1d459fc725dc303f9bbeb9f893d9eb735b2a5e96
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=1d459fc725dc303f9bbeb9f893d9eb735b2a5e96;hp=23e98b0afb7284faac564c22a5595ebdcd983607
Author: Simon Tatham <anakin at pobox.com>
Date: Mon Oct 29 07:23:32 2018 +0000
Fix misuse of FALSE for null pointer return values.
x11_char_struct returns a pointer or NULL, so while returning FALSE
would have ended up doing the right thing after macro expansion and
integer->pointer conversion, it wasn't actually how I _meant_ to spell
a failure return.
unix/gtkfont.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
commit 3a2afbc9c03010fa62ee7ed622c1d5eb1696c0ab
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=3a2afbc9c03010fa62ee7ed622c1d5eb1696c0ab;hp=1d459fc725dc303f9bbeb9f893d9eb735b2a5e96
Author: Simon Tatham <anakin at pobox.com>
Date: Thu Nov 1 18:17:41 2018 +0000
Remove duplicate typedef for mainchan.
In some compiler modes - notably the one that gtk-config selects when
GTK PuTTY is built for GTK 1 - it's an error to typedef the same thing
twice. 'mainchan' is defined in defs.h, so it doesn't need defining
again where the structure contents are specified.
mainchan.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
commit 5cb56389bdf78f98e44128afca39fba2dac74dfa
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=5cb56389bdf78f98e44128afca39fba2dac74dfa;hp=3a2afbc9c03010fa62ee7ed622c1d5eb1696c0ab
Author: Simon Tatham <anakin at pobox.com>
Date: Tue Oct 30 18:09:12 2018 +0000
Remove three uses of bitwise ops on boolean values.
If values are boolean, it's confusing to use & and | in place of &&
and ||. In two of these three cases it was simply a typo and I've used
the other one; in the third, it was a deliberate avoidance of short-
circuit evaluation (and commented as such), but having seen how easy
it is to make the same typo by accident, I've decided it's clearer to
just move the LHS and RHS evaluations outside the expression.
mainchan.c | 2 +-
ssh2transport.c | 10 +++++-----
unix/gtkask.c | 2 +-
3 files changed, 7 insertions(+), 7 deletions(-)
commit a647f2ba1165393506c6c006c0bce4b82f5fa1ab
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=a647f2ba1165393506c6c006c0bce4b82f5fa1ab;hp=5cb56389bdf78f98e44128afca39fba2dac74dfa
Author: Simon Tatham <anakin at pobox.com>
Date: Fri Oct 26 23:08:58 2018 +0100
Adopt C99 <stdint.h> integer types.
The annoying int64.h is completely retired, since C99 guarantees a
64-bit integer type that you can actually treat like an ordinary
integer. Also, I've replaced the local typedefs uint32 and word32
(scattered through different parts of the crypto code) with the
standard uint32_t.
Recipe | 4 +-
defs.h | 12 +++-
int64.c | 175 ----------------------------------------------------
int64.h | 29 ---------
marshal.c | 21 +++----
marshal.h | 5 +-
misc.h | 56 ++++++++++++++---
pgssapi.h | 2 +-
pscp.c | 115 ++++++++++++++--------------------
psftp.c | 21 +++----
psftp.h | 10 ++-
scpserver.c | 57 +++++++----------
sftp.c | 45 ++++++--------
sftp.h | 15 +++--
sftpserver.c | 2 +-
ssh.h | 23 +++----
sshaes.c | 50 +++++++--------
sshblowf.c | 86 +++++++++++++-------------
sshccp.c | 6 +-
sshcrcda.c | 36 +++++------
sshdes.c | 39 ++++++------
sshmd5.c | 37 +++++------
sshrand.c | 30 ++++-----
sshsh256.c | 39 +++++-------
sshsh512.c | 106 +++++++++++--------------------
sshsha.c | 46 +++++++-------
unix/uxsftp.c | 29 +++------
unix/uxsftpserver.c | 31 +++-------
windows/winsftp.c | 28 ++++-----
29 files changed, 433 insertions(+), 722 deletions(-)
commit a6f1709c2f4d07a9312c5a6dd591fa0cf529808f
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=a6f1709c2f4d07a9312c5a6dd591fa0cf529808f;hp=a647f2ba1165393506c6c006c0bce4b82f5fa1ab
Author: Simon Tatham <anakin at pobox.com>
Date: Mon Oct 29 19:50:29 2018 +0000
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.
agentf.c | 6 +-
callback.c | 8 +-
cmdgen.c | 80 ++++-----
cmdline.c | 36 ++--
conf.c | 8 +-
config.c | 54 +++---
contrib/cygtermd/telnet.c | 8 +-
defs.h | 8 +-
dialog.c | 6 +-
dialog.h | 2 +-
fuzzterm.c | 10 +-
import.c | 20 +--
ldisc.c | 4 +-
logging.c | 14 +-
mainchan.c | 76 ++++----
marshal.c | 10 +-
misc.c | 38 ++--
nocmdline.c | 2 +-
pageant.c | 14 +-
pinger.c | 8 +-
portfwd.c | 26 +--
proxy.c | 4 +-
pscp.c | 26 +--
psftp.c | 106 +++++------
psftp.h | 6 +-
putty.h | 26 +--
raw.c | 16 +-
rlogin.c | 8 +-
scpserver.c | 70 ++++----
sesschan.c | 64 +++----
settings.c | 16 +-
sftp.c | 4 +-
sftpserver.c | 6 +-
ssh.c | 36 ++--
ssh.h | 18 +-
ssh1bpp.c | 10 +-
ssh1connection-client.c | 54 +++---
ssh1connection-server.c | 52 +++---
ssh1connection.c | 46 ++---
ssh1login-server.c | 6 +-
ssh1login.c | 58 +++---
ssh2bpp-bare.c | 6 +-
ssh2bpp.c | 22 +--
ssh2connection-client.c | 22 +--
ssh2connection-server.c | 32 ++--
ssh2connection.c | 58 +++---
ssh2kex-client.c | 10 +-
ssh2kex-server.c | 4 +-
ssh2transhk.c | 4 +-
ssh2transport.c | 132 +++++++-------
ssh2userauth-server.c | 6 +-
ssh2userauth.c | 100 +++++------
sshbpp.h | 4 +-
sshchan.h | 4 +-
sshcommon.c | 70 ++++----
sshecc.c | 8 +-
sshpubk.c | 54 +++---
sshrand.c | 4 +-
sshrsa.c | 4 +-
sshserver.c | 22 +--
sshserver.h | 2 +-
sshshare.c | 28 +--
sshverstring.c | 2 +-
sshzlib.c | 21 +--
telnet.c | 24 +--
terminal.c | 438 +++++++++++++++++++++++-----------------------
terminal.h | 4 +-
testbn.c | 8 +-
timing.c | 4 +-
unix/gtkapp.c | 6 +-
unix/gtkask.c | 50 +++---
unix/gtkcols.c | 37 ++--
unix/gtkcomm.c | 14 +-
unix/gtkcompat.h | 2 +-
unix/gtkdlg.c | 166 +++++++++---------
unix/gtkfont.c | 152 ++++++++--------
unix/gtkmain.c | 8 +-
unix/gtkmisc.c | 12 +-
unix/gtkwin.c | 288 +++++++++++++++---------------
unix/unix.h | 4 +-
unix/ux_x11.c | 8 +-
unix/uxagentc.c | 4 +-
unix/uxcons.c | 4 +-
unix/uxmisc.c | 6 +-
unix/uxnet.c | 50 +++---
unix/uxpeer.c | 4 +-
unix/uxpgnt.c | 110 ++++++------
unix/uxplink.c | 38 ++--
unix/uxpterm.c | 2 +-
unix/uxpty.c | 30 ++--
unix/uxputty.c | 8 +-
unix/uxser.c | 8 +-
unix/uxserver.c | 28 +--
unix/uxsftp.c | 16 +-
unix/uxsftpserver.c | 22 +--
unix/uxucs.c | 2 +-
windows/sizetip.c | 4 +-
windows/wincapi.c | 4 +-
windows/wincfg.c | 4 +-
windows/wincons.c | 2 +-
windows/winctrls.c | 56 +++---
windows/windlg.c | 32 ++--
windows/window.c | 222 +++++++++++------------
windows/winhandl.c | 64 +++----
windows/winhelp.c | 8 +-
windows/winhsock.c | 8 +-
windows/winjump.c | 16 +-
windows/winmisc.c | 16 +-
windows/winnet.c | 44 ++---
windows/winnoise.c | 2 +-
windows/winnpc.c | 2 +-
windows/winnps.c | 16 +-
windows/winpgen.c | 58 +++---
windows/winpgnt.c | 32 ++--
windows/winpgntc.c | 8 +-
windows/winplink.c | 28 +--
windows/winprint.c | 8 +-
windows/winproxy.c | 6 +-
windows/winsecur.c | 24 +--
windows/winsecur.h | 4 +-
windows/winser.c | 32 ++--
windows/winsftp.c | 14 +-
windows/winshare.c | 4 +-
windows/winstore.c | 6 +-
windows/winstuff.h | 4 +-
windows/winx11.c | 2 +-
x11fwd.c | 30 ++--
127 files changed, 1994 insertions(+), 2012 deletions(-)
commit 5691805cbd4147ac861dd93f5784cea7edde8384
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=5691805cbd4147ac861dd93f5784cea7edde8384;hp=a6f1709c2f4d07a9312c5a6dd591fa0cf529808f
Author: Simon Tatham <anakin at pobox.com>
Date: Mon Oct 29 20:02:21 2018 +0000
Introduce a conf value type of bool.
It's not actually used anywhere yet, though. This is just adding the
accessor functions, which will enforce a rigorous separation between
conf keys typed as int and as bool.
conf.c | 38 +++++++++++++++++++++++++++++++++++++-
putty.h | 2 ++
2 files changed, 39 insertions(+), 1 deletion(-)
commit 1378bb049ab6c62fe0b852dcedc81d7b1474a23f
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=1378bb049ab6c62fe0b852dcedc81d7b1474a23f;hp=5691805cbd4147ac861dd93f5784cea7edde8384
Author: Simon Tatham <anakin at pobox.com>
Date: Mon Oct 29 19:57:31 2018 +0000
Switch some Conf settings over to being bool.
I think this is the full set of things that ought logically to be
boolean.
One annoyance is that quite a few radio-button controls in config.c
address Conf fields that are now bool rather than int, which means
that the shared handler function can't just access them all with
conf_{get,set}_int. Rather than back out the rigorous separation of
int and bool in conf.c itself, I've just added a similar alternative
handler function for the bool-typed ones.
cmdline.c | 26 ++--
config.c | 72 +++++++---
fuzzterm.c | 7 +-
ldisc.c | 4 +-
logging.c | 2 +-
mainchan.c | 10 +-
portfwd.c | 4 +-
proxy.c | 2 +-
pscp.c | 18 +--
psftp.c | 14 +-
putty.h | 250 ++++++++++++++++-----------------
settings.c | 397 ++++++++++++++++++++++++++++-------------------------
ssh.c | 22 +--
ssh1connection.c | 2 +-
ssh1login.c | 8 +-
ssh2connection.c | 4 +-
ssh2transport.c | 22 +--
sshserver.c | 4 +-
sshshare.c | 6 +-
telnet.c | 4 +-
terminal.c | 114 +++++++--------
unix/gtkmain.c | 14 +-
unix/gtkwin.c | 87 ++++++------
unix/uxpgnt.c | 1 +
unix/uxplink.c | 19 ++-
unix/uxpty.c | 6 +-
unix/uxserver.c | 5 +
unix/uxsftp.c | 5 +
windows/windefs.c | 5 +
windows/window.c | 88 ++++++------
windows/winplink.c | 14 +-
31 files changed, 658 insertions(+), 578 deletions(-)
commit 3214563d8ed7469e20d4ffdddd55c430334ce803
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=3214563d8ed7469e20d4ffdddd55c430334ce803;hp=1378bb049ab6c62fe0b852dcedc81d7b1474a23f
Author: Simon Tatham <anakin at pobox.com>
Date: Fri Nov 2 19:23:19 2018 +0000
Convert a lot of 'int' variables to 'bool'.
My normal habit these days, in new code, is to treat int and bool as
_almost_ completely separate types. I'm still willing to use C's
implicit test for zero on an integer (e.g. 'if (!blob.len)' is fine,
no need to spell it out as blob.len != 0), but generally, if a
variable is going to be conceptually a boolean, I like to declare it
bool and assign to it using 'true' or 'false' rather than 0 or 1.
PuTTY is an exception, because it predates the C99 bool, and I've
stuck to its existing coding style even when adding new code to it.
But it's been annoying me more and more, so now that I've decided C99
bool is an acceptable thing to require from our toolchain in the first
place, here's a quite thorough trawl through the source doing
'boolification'. Many variables and function parameters are now typed
as bool rather than int; many assignments of 0 or 1 to those variables
are now spelled 'true' or 'false'.
I managed this thorough conversion with the help of a custom clang
plugin that I wrote to trawl the AST and apply heuristics to point out
where things might want changing. So I've even managed to do a decent
job on parts of the code I haven't looked at in years!
To make the plugin's work easier, I pushed platform front ends
generally in the direction of using standard 'bool' in preference to
platform-specific boolean types like Windows BOOL or GTK's gboolean;
I've left the platform booleans in places they _have_ to be for the
platform APIs to work right, but variables only used by my own code
have been converted wherever I found them.
In a few places there are int values that look very like booleans in
_most_ of the places they're used, but have a rarely-used third value,
or a distinction between different nonzero values that most users
don't care about. In these cases, I've _removed_ uses of 'true' and
'false' for the return values, to emphasise that there's something
more subtle going on than a simple boolean answer:
- the 'multisel' field in dialog.h's list box structure, for which
the GTK front end in particular recognises a difference between 1
and 2 but nearly everything else treats as boolean
- the 'urgent' parameter to plug_receive, where 1 vs 2 tells you
something about the specific location of the urgent pointer, but
most clients only care about 0 vs 'something nonzero'
- the return value of wc_match, where -1 indicates a syntax error in
the wildcard.
- the return values from SSH-1 RSA-key loading functions, which use
-1 for 'wrong passphrase' and 0 for all other failures (so any
caller which already knows it's not loading an _encrypted private_
key can treat them as boolean)
- term->esc_query, and the 'query' parameter in toggle_mode in
terminal.c, which _usually_ hold 0 for ESC[123h or 1 for ESC[?123h,
but can also hold -1 for some other intervening character that we
don't support.
In a few places there's an integer that I haven't turned into a bool
even though it really _can_ only take values 0 or 1 (and, as above,
tried to make the call sites consistent in not calling those values
true and false), on the grounds that I thought it would make it more
confusing to imply that the 0 value was in some sense 'negative' or
bad and the 1 positive or good:
- the return value of plug_accepting uses the POSIXish convention of
0=success and nonzero=error; I think if I made it bool then I'd
also want to reverse its sense, and that's a job for a separate
piece of work.
- the 'screen' parameter to lineptr() in terminal.c, where 0 and 1
represent the default and alternate screens. There's no obvious
reason why one of those should be considered 'true' or 'positive'
or 'success' - they're just indices - so I've left it as int.
ssh_scp_recv had particularly confusing semantics for its previous int
return value: its call sites used '<= 0' to check for error, but it
never actually returned a negative number, just 0 or 1. Now the
function and its call sites agree that it's a bool.
In a couple of places I've renamed variables called 'ret', because I
don't like that name any more - it's unclear whether it means the
return value (in preparation) for the _containing_ function or the
return value received from a subroutine call, and occasionally I've
accidentally used the same variable for both and introduced a bug. So
where one of those got in my way, I've renamed it to 'toret' or 'retd'
(the latter short for 'returned') in line with my usual modern
practice, but I haven't done a thorough job of finding all of them.
Finally, one amusing side effect of doing this is that I've had to
separate quite a few chained assignments. It used to be perfectly fine
to write 'a = b = c = TRUE' when a,b,c were int and TRUE was just a
the 'true' defined by stdbool.h, that idiom provokes a warning from
gcc: 'suggest parentheses around assignment used as truth value'!
agentf.c | 12 +-
be_misc.c | 2 +-
callback.c | 6 +-
cmdgen.c | 17 +--
cmdline.c | 16 +--
conf.c | 9 +-
config.c | 44 ++++----
dialog.c | 30 ++---
dialog.h | 30 ++---
fuzzterm.c | 30 ++---
import.c | 117 +++++++++----------
ldisc.c | 8 +-
ldisc.h | 6 +-
ldiscucs.c | 4 +-
logging.c | 6 +-
mainchan.c | 44 ++++----
marshal.c | 10 +-
marshal.h | 6 +-
minibidi.c | 30 ++---
misc.c | 36 +++---
misc.h | 26 ++---
network.h | 34 +++---
nullplug.c | 2 +-
pageant.c | 23 ++--
pageant.h | 8 +-
pinger.c | 2 +-
portfwd.c | 36 +++---
proxy.c | 52 ++++-----
proxy.h | 16 +--
pscp.c | 191 ++++++++++++++++---------------
psftp.c | 270 ++++++++++++++++++++++----------------------
psftp.h | 12 +-
putty.h | 135 +++++++++++-----------
raw.c | 24 ++--
rlogin.c | 30 ++---
scpserver.c | 31 +++---
sercfg.c | 2 +-
sesschan.c | 96 ++++++++--------
settings.c | 203 +++++++++++++++++----------------
sftp.c | 114 ++++++++-----------
sftp.h | 59 +++++-----
sftpcommon.c | 6 +-
ssh.c | 51 ++++-----
ssh.h | 126 ++++++++++-----------
ssh1bpp.c | 2 +-
ssh1censor.c | 2 +-
ssh1connection-client.c | 51 +++++----
ssh1connection-server.c | 14 ++-
ssh1connection.c | 38 +++----
ssh1connection.h | 32 +++---
ssh1login-server.c | 10 +-
ssh1login.c | 36 +++---
ssh2bpp.c | 22 ++--
ssh2censor.c | 2 +-
ssh2connection-client.c | 36 +++---
ssh2connection-server.c | 36 +++---
ssh2connection.c | 48 ++++----
ssh2connection.h | 64 +++++------
ssh2kex-client.c | 8 +-
ssh2transhk.c | 8 +-
ssh2transport.c | 75 +++++++------
ssh2transport.h | 46 ++++----
ssh2userauth-server.c | 6 +-
ssh2userauth.c | 47 ++++----
sshaes.c | 12 +-
sshbn.c | 7 +-
sshbpp.h | 24 ++--
sshchan.h | 110 +++++++++---------
sshcommon.c | 74 ++++++------
sshcrcda.c | 16 +--
sshdh.c | 2 +-
sshdss.c | 18 +--
sshecc.c | 221 ++++++++++++++++++------------------
sshmac.c | 7 +-
sshppl.h | 22 ++--
sshpubk.c | 107 +++++++++---------
sshrand.c | 2 +-
sshrsa.c | 45 ++++----
sshserver.c | 8 +-
sshserver.h | 12 +-
sshsha.c | 12 +-
sshshare.c | 35 +++---
sshverstring.c | 16 +--
sshzlib.c | 20 ++--
telnet.c | 39 +++----
terminal.c | 290 ++++++++++++++++++++++++++----------------------
terminal.h | 136 ++++++++++++-----------
testbn.c | 4 +-
timing.c | 2 +-
tree234.c | 3 +-
unix/gtkapp.c | 8 +-
unix/gtkask.c | 14 ++-
unix/gtkcfg.c | 2 +-
unix/gtkcols.c | 2 +-
unix/gtkcols.h | 2 +-
unix/gtkcomm.c | 2 +-
unix/gtkdlg.c | 53 ++++-----
unix/gtkfont.c | 164 ++++++++++++++-------------
unix/gtkfont.h | 14 +--
unix/gtkmain.c | 34 +++---
unix/gtkmisc.c | 3 +-
unix/gtkmisc.h | 3 +-
unix/gtkwin.c | 155 ++++++++++++++------------
unix/unix.h | 26 +++--
unix/ux_x11.c | 4 +-
unix/uxagentc.c | 20 ++--
unix/uxcfg.c | 4 +-
unix/uxcons.c | 8 +-
unix/uxfdsock.c | 2 +-
unix/uxmisc.c | 12 +-
unix/uxnet.c | 113 ++++++++++---------
unix/uxnoise.c | 12 +-
unix/uxpeer.c | 2 +-
unix/uxpgnt.c | 85 +++++++-------
unix/uxplink.c | 44 ++++----
unix/uxproxy.c | 4 +-
unix/uxpterm.c | 11 +-
unix/uxpty.c | 36 +++---
unix/uxputty.c | 12 +-
unix/uxser.c | 18 +--
unix/uxserver.c | 18 +--
unix/uxsftp.c | 18 +--
unix/uxsftpserver.c | 16 +--
unix/uxshare.c | 5 +-
unix/uxsignal.c | 4 +-
unix/uxstore.c | 4 +-
unix/uxucs.c | 13 ++-
wcwidth.c | 8 +-
wildcard.c | 16 +--
windows/sizetip.c | 4 +-
windows/wincapi.c | 6 +-
windows/wincapi.h | 2 +-
windows/wincfg.c | 4 +-
windows/wincons.c | 9 +-
windows/winctrls.c | 67 +++++------
windows/windefs.c | 4 +-
windows/windlg.c | 15 +--
windows/window.c | 266 +++++++++++++++++++++++---------------------
windows/winhandl.c | 37 +++---
windows/winhelp.c | 6 +-
windows/winhsock.c | 6 +-
windows/winjump.c | 6 +-
windows/winmisc.c | 15 ++-
windows/winnet.c | 131 +++++++++++-----------
windows/winnoise.c | 4 +-
windows/winnpc.c | 2 +-
windows/winnps.c | 6 +-
windows/winpgen.c | 34 +++---
windows/winpgnt.c | 16 +--
windows/winpgntc.c | 2 +-
windows/winplink.c | 34 +++---
windows/winprint.c | 12 +-
windows/winproxy.c | 6 +-
windows/winsecur.c | 26 ++---
windows/winsecur.h | 8 +-
windows/winser.c | 16 +--
windows/winsftp.c | 30 ++---
windows/winshare.c | 2 +-
windows/winstore.c | 10 +-
windows/winstuff.h | 60 +++++-----
windows/winucs.c | 10 +-
windows/winutils.c | 10 +-
windows/winx11.c | 2 +-
x11fwd.c | 41 +++----
164 files changed, 2914 insertions(+), 2805 deletions(-)
commit f9cb4eb568ac5527a47dc01bf364f0a963b4dc04
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=f9cb4eb568ac5527a47dc01bf364f0a963b4dc04;hp=3214563d8ed7469e20d4ffdddd55c430334ce803
Author: Simon Tatham <anakin at pobox.com>
Date: Fri Oct 26 23:08:50 2018 +0100
Make a few small helper functions inline.
Notably toint(), which ought to compile down to the identity function
in any case so you don't really want to put in a pointless call
overhead, and make_ptrlen() (and a couple of its wrappers) which is
standing in for what ought to be a struct-literal syntax.
misc.c | 41 -----------------------------------------
misc.h | 46 ++++++++++++++++++++++++++++++++++++++++++----
2 files changed, 42 insertions(+), 45 deletions(-)
commit 3933a27d932fd8ec4aa416d43a2ab8c69a8e7f52
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=3933a27d932fd8ec4aa416d43a2ab8c69a8e7f52;hp=f9cb4eb568ac5527a47dc01bf364f0a963b4dc04
Author: Simon Tatham <anakin at pobox.com>
Date: Sat Nov 3 08:17:44 2018 +0000
Make send_raw_mouse a field of GtkFrontend.
I came across this unexplained static variable in my boolification
trawl. It seems clearly unintentional that it has only one instance
instead of one per terminal window - the code in question closely
resembles the Windows front end, and I think this must just be a
variable that I never swept up into 'inst' in the very early days when
I was making gtkwin.c out of a cloned-and-hacked window.c in the first
place.
These days it's even a bug, now that the OS X port actually does run
multiple terminal windows in the same process: if one goes into mouse
reporting mode, I'm pretty sure this would have done confusing things
to the effects of mouse actions in the other.
unix/gtkwin.c | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
commit 650bfbb084f64a3d5e0dd87626eb7074dff536ec
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=650bfbb084f64a3d5e0dd87626eb7074dff536ec;hp=3933a27d932fd8ec4aa416d43a2ab8c69a8e7f52
Author: Simon Tatham <anakin at pobox.com>
Date: Sat Nov 3 08:28:35 2018 +0000
Nitpick: fix missing 'void' in one declaration.
Jumped out at me in my trawl of the whole code base:
set_explicit_app_user_model_id is declared and defined as () rather
than (void), but this isn't C++.
windows/winjump.c | 2 +-
windows/winstuff.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
commit 9248f5c994ae84daeeb5c1dc25d55c8c290581de
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=9248f5c994ae84daeeb5c1dc25d55c8c290581de;hp=650bfbb084f64a3d5e0dd87626eb7074dff536ec
Author: Simon Tatham <anakin at pobox.com>
Date: Sat Nov 3 08:32:25 2018 +0000
winnet.c: remove duplicated errstring system.
There's one of these centralised in win_strerror() in winmisc.c, and
it doesn't seem worth keeping an earlier iteration of the same idea
entirely separate in winsock_error_string.
This removal means that non-network-specific error codes received in a
network context will no longer have "Network error:" prefixed to them.
But I think that's OK, because it seems unlikely to be critically
important that such an error was received from a network function - if
anything like that comes up then it's probably some kind of systemwide
chaos.
windows/winnet.c | 71 ++------------------------------------------------------
1 file changed, 2 insertions(+), 69 deletions(-)
commit c089827ea0eda423fc7fbd98519f02185db89e99
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=c089827ea0eda423fc7fbd98519f02185db89e99;hp=9248f5c994ae84daeeb5c1dc25d55c8c290581de
Author: Simon Tatham <anakin at pobox.com>
Date: Sat Nov 3 08:58:41 2018 +0000
Rework mungestr() and unmungestr().
For a start, they now have different names on Windows and Unix,
reflecting their different roles: on Windows they apply escaping to
any string that's going to be used as a registry key (be it a session
name, or a host name for host key storage), whereas on Unix they're
for constructing saved-session file names in particular (and also
handle the special case of filling in "Default Settings" for NULL).
Also, they now produce output by writing to a strbuf, which simplifies
a lot of the call sites. In particular, the strbuf output idiom is
passed on to enum_settings_next, which is especially nice because its
only actual caller was doing an ad-hoc realloc loop that I can now get
rid of completely.
Thirdly, on Windows they're centralised into winmisc.c instead of
living in winstore.c, because that way Pageant can use the unescape
function too. (It was spotting the duplication there that made me
think of doing this in the first place, but once I'd started, I had to
keep unravelling the thread...)
settings.c | 26 +++-------
storage.h | 2 +-
unix/uxstore.c | 46 ++++++-----------
windows/winmisc.c | 38 ++++++++++++++
windows/winpgnt.c | 36 +++----------
windows/winstore.c | 146 +++++++++++++++++++----------------------------------
windows/winstuff.h | 2 +
7 files changed, 123 insertions(+), 173 deletions(-)
commit 91d16881abf19592737ae31471b9540aeac24e8d
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=91d16881abf19592737ae31471b9540aeac24e8d;hp=c089827ea0eda423fc7fbd98519f02185db89e99
Author: Simon Tatham <anakin at pobox.com>
Date: Sat Nov 3 08:25:28 2018 +0000
Add missing 'static' on file-internal declarations.
sk_startup and sk_nextaddr are entirely internal to winnet.c; nearly
all of import.c and minibidi.c's internal routines should have been
static and weren't; {read,write}_utf8 are internal to charset/utf8.c
(and didn't even need separate declarations at all); do_sftp_cleanup
is internal to psftp.c, and get_listitemheight to gtkdlg.c.
While I was editing those prototypes anyway, I've also added missing
'const' to the 'char *' passphrase parameters in import,c.
charset/utf8.c | 17 +++++--------
import.c | 74 +++++++++++++++++++++++++++-----------------------------
minibidi.c | 32 +++++++++++++-----------
psftp.c | 4 +--
unix/gtkdlg.c | 4 +--
windows/winnet.c | 4 +--
6 files changed, 65 insertions(+), 70 deletions(-)
commit c5895ec2928948a04f59004b75c934a2d99ac508
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=c5895ec2928948a04f59004b75c934a2d99ac508;hp=91d16881abf19592737ae31471b9540aeac24e8d
Author: Simon Tatham <anakin at pobox.com>
Date: Sat Nov 3 10:06:33 2018 +0000
Move all extern declarations into header files.
This is another cleanup I felt a need for while I was doing
boolification. If you define a function or variable in one .c file and
declare it extern in another, then nothing will check you haven't got
the types of the two declarations mismatched - so when you're
_changing_ the type, it's a pain to make sure you've caught all the
copies of it.
It's better to put all those extern declarations in header files, so
that the declaration in the header is also in scope for the
definition. Then the compiler will complain if they don't match, which
is what I want.
misc.c | 1 -
putty.h | 4 +++
sercfg.c | 2 --
ssh.h | 8 ++++++
ssh2connection.c | 7 -----
sshecdsag.c | 3 ---
sshppl.h | 7 +++++
sshrand.c | 3 ---
sshshare.c | 5 ----
terminal.c | 1 -
unix/gtkapp.c | 13 +++------
unix/gtkdlg.c | 12 +--------
unix/gtkmain.c | 14 +++-------
unix/gtkwin.c | 7 +----
unix/unix.h | 79 +++++++++++++++++++++++++++++++++++++++++++++++++-----
unix/uxpgnt.c | 4 ---
unix/uxpterm.c | 2 --
unix/uxserver.c | 2 --
unix/uxshare.c | 6 -----
windows/windlg.c | 3 ---
windows/window.c | 5 ++--
windows/winnet.c | 4 +--
windows/winnpc.c | 3 ---
windows/winnps.c | 9 -------
windows/winpgen.c | 2 --
windows/winpgnt.c | 2 --
windows/winplink.c | 1 -
windows/winproxy.c | 3 ---
windows/winsftp.c | 1 -
windows/winshare.c | 3 ---
windows/winstuff.h | 39 +++++++++++++++++++++++----
31 files changed, 136 insertions(+), 119 deletions(-)
More information about the tartarus-commits
mailing list