simon-git: putty (main): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Wed Aug 3 20:54:34 BST 2022


TL;DR:
  3a42a09d Formatting: normalise back to 4-space indentation.
  4fa34804 Formatting: realign run-on parenthesised stuff.
  04c1617f Formatting: realign labels and case/default statements.
  14203bc5 Formatting: standardise on "func(\n", not "func\n(".
  4b8dc562 Formatting: remove spurious spaces in 'type * var'.
  9cac2794 Formatting: miscellaneous.
  61a877cc Comment typo in supdup.c.

Repository:     https://git.tartarus.org/simon/putty.git
On the web:     https://git.tartarus.org/?p=simon/putty.git
Branch updated: main
Committer:      Simon Tatham <anakin at pobox.com>
Date:           2022-08-03 20:54:34

commit 3a42a09dadcb38e4f3481a4dd8b4c2bad5b6de4b
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=3a42a09dadcb38e4f3481a4dd8b4c2bad5b6de4b;hp=b6d7c81d43a7d54cbdd4dcee75099248227627f9
Author: Simon Tatham <anakin at pobox.com>
Date:   Wed Aug 3 20:48:46 2022 +0100

    Formatting: normalise back to 4-space indentation.
    
    In several pieces of development recently I've run across the
    occasional code block in the middle of a function which suddenly
    switched to 2-space indent from this code base's usual 4. I decided I
    was tired of it, so I ran the whole code base through a re-indenter,
    which made a huge mess, and then manually sifted out the changes that
    actually made sense from that pass.
    
    Indeed, this caught quite a few large sections with 2-space indent
    level, a couple with 8, and a handful of even weirder things like 3
    spaces or 12. This commit fixes them all.

 charset/localenc.c       |   2 +-
 charset/mimeenc.c        |   2 +-
 charset/xenc.c           |   2 +-
 cmdgen.c                 | 202 +++++++++++------------
 crypto/blowfish.c        |   2 +-
 import.c                 |   4 +-
 otherbackends/supdup.c   |  18 +--
 otherbackends/telnet.c   |   2 +-
 proxy/sshproxy.c         |   8 +-
 proxy/telnet.c           |  48 +++---
 pscp.c                   |   4 +-
 psftp.c                  |   8 +-
 putty.h                  |   4 +-
 ssh/channel.h            |   4 +-
 ssh/connection1-server.c |  10 +-
 ssh/connection2.c        |   4 +-
 terminal/terminal.c      |   2 +-
 test/fuzzterm.c          |  52 +++---
 test/sclog/sclog.c       |  28 ++--
 unix/network.c           |  10 +-
 unix/plink.c             |  96 +++++------
 windows/dialog.c         |   4 +-
 windows/jump-list.c      |   8 +-
 windows/network.c        |  12 +-
 windows/pageant.c        |  58 +++----
 windows/puttygen.c       |   8 +-
 windows/utils/security.c |   2 +-
 windows/window.c         | 410 +++++++++++++++++++++++------------------------
 28 files changed, 507 insertions(+), 507 deletions(-)

commit 4fa3480444a64a5be3055cf27d96d8e68d0a1d12
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=4fa3480444a64a5be3055cf27d96d8e68d0a1d12;hp=3a42a09dadcb38e4f3481a4dd8b4c2bad5b6de4b
Author: Simon Tatham <anakin at pobox.com>
Date:   Wed Aug 3 20:48:46 2022 +0100

    Formatting: realign run-on parenthesised stuff.
    
    My bulk indentation check also turned up a lot of cases where a run-on
    function call or if statement didn't have its later lines aligned
    correctly relative to the open paren.
    
    I think this is quite easy to do by getting things out of
    sync (editing the first line of the function call and forgetting to
    update the rest, perhaps even because you never _saw_ the rest during
    a search-replace). But a few didn't quite fit into that pattern, in
    particular an outright misleading case in unix/askpass.c where the
    second line of a call was aligned neatly below the _wrong_ one of the
    open parens on the opening line.
    
    Restored as many alignments as I could easily find.

 config.c               | 24 ++++++++++++------------
 crypto/aes-neon.c      |  2 +-
 crypto/des.c           |  2 +-
 crypto/dsa.c           |  4 ++--
 crypto/ecc-ssh.c       |  2 +-
 crypto/ntru.c          |  2 +-
 crypto/rsa.c           |  2 +-
 import.c               |  4 ++--
 marshal.h              |  2 +-
 otherbackends/telnet.c | 12 ++++++------
 proxy/proxy.c          | 12 ++++++------
 ssh.h                  | 10 +++++-----
 ssh/common.c           |  2 +-
 ssh/login1-server.c    |  2 +-
 ssh/login1.c           |  4 ++--
 ssh/mainchan.c         |  2 +-
 ssh/sftp.c             |  2 +-
 ssh/sharing.c          |  2 +-
 ssh/verstring.c        |  2 +-
 ssh/x11fwd.c           |  2 +-
 ssh/zlib.c             |  6 +++---
 sshpubk.c              |  2 +-
 terminal/terminal.c    |  2 +-
 test/testcrypt.c       |  6 +++---
 unix/askpass.c         |  2 +-
 unix/main-gtk-simple.c |  2 +-
 unix/sftpserver.c      |  2 +-
 unix/unifont.c         |  2 +-
 unix/window.c          |  4 ++--
 utils/conf.c           |  2 +-
 utils/debug.c          |  4 ++--
 windows/controls.c     |  6 +++---
 windows/dialog.c       |  2 +-
 windows/gss.c          |  4 ++--
 windows/pageant.c      | 10 +++++-----
 windows/puttygen.c     | 10 +++++-----
 windows/storage.c      |  2 +-
 windows/window.c       | 20 ++++++++++----------
 38 files changed, 92 insertions(+), 92 deletions(-)

commit 04c1617f207241a543d9f0084c4df577d65f1cf4
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=04c1617f207241a543d9f0084c4df577d65f1cf4;hp=4fa3480444a64a5be3055cf27d96d8e68d0a1d12
Author: Simon Tatham <anakin at pobox.com>
Date:   Wed Aug 3 20:48:46 2022 +0100

    Formatting: realign labels and case/default statements.
    
    My aim has always been to have those back-dented by 2 spaces (half an
    indent level) compared to the statements around them, so that in
    particular switch statements have distinct alignment for the
    statement, the cases and the interior code without consuming two whole
    indent levels.
    
    This patch sweeps up all the violations of that principle found by my
    bulk-reindentation exercise.

 import.c                 | 20 +++++------
 ldisc.c                  |  2 +-
 otherbackends/supdup.c   | 94 ++++++++++++++++++++++++------------------------
 unix/agent-client.c      |  2 +-
 unix/network.c           |  4 +--
 unix/pty.c               |  2 +-
 unix/sftp.c              |  8 ++---
 unix/storage.c           |  2 +-
 unix/window.c            |  2 +-
 windows/network.c        |  2 +-
 windows/printing.c       |  4 +--
 windows/sftp.c           |  8 ++---
 windows/utils/security.c |  2 +-
 windows/window.c         |  2 +-
 14 files changed, 77 insertions(+), 77 deletions(-)

commit 14203bc54ff09fad1f4c0e568ee77ea86aedaf34
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=14203bc54ff09fad1f4c0e568ee77ea86aedaf34;hp=04c1617f207241a543d9f0084c4df577d65f1cf4
Author: Simon Tatham <anakin at pobox.com>
Date:   Wed Aug 3 20:48:46 2022 +0100

    Formatting: standardise on "func(\n", not "func\n(".
    
    If the function name (or expression) in a function call or declaration
    is itself so long that even the first argument doesn't fit after it on
    the same line, or if that would leave so little space that it would be
    silly to try to wrap all the run-on lines into a tall thin column,
    then I used to do this
    
        ludicrously_long_function_name
            (arg1, arg2, arg3);
    
    and now prefer this
    
        ludicrously_long_function_name(
            arg1, arg2, arg3);
    
    I picked up the habit from Python, where the latter idiom is required
    by Python's syntactic significance of newlines (you can write the
    former if you use a backslash-continuation, but pretty much everyone
    seems to agree that that's much uglier). But I've found it works well
    in C as well: it makes it more obvious that the previous line is
    incomplete, it gives you a tiny bit more space to wrap the following
    lines into (the old idiom indents the _third_ line one space beyond
    the second), and I generally turn out to agree with the knock-on
    indentation decisions made by at least Emacs if you do it in the
    middle of a complex expression. Plus, of course, using the _same_
    idiom between C and Python means less state-switching.
    
    So, while I'm making annoying indentation changes in general, this
    seems like a good time to dig out all the cases of the old idiom in
    this code, and switch them over to the new.

 pscp.c                      |   4 +-
 ssh/sftp.c                  |   4 +-
 ssh/sharing.c               |  64 +++++++------
 ssh/userauth2-client.c      |  18 ++--
 unix/askpass.c              |   8 +-
 unix/dialog.c               | 219 ++++++++++++++++++++++----------------------
 unix/unifont.c              |  91 +++++++++---------
 unix/utils/our_dialog.c     |   6 +-
 unix/window.c               |   9 +-
 windows/agent-client.c      |   4 +-
 windows/dialog.c            |   8 +-
 windows/jump-list.c         |  24 ++---
 windows/named-pipe-server.c |  38 ++++----
 windows/pageant.c           |   8 +-
 windows/puttygen.c          |  22 ++---
 windows/storage.c           |   4 +-
 windows/utils/security.c    |   8 +-
 17 files changed, 268 insertions(+), 271 deletions(-)

commit 4b8dc562844a4ea0fdfda53a05a275c50a23d94a
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=4b8dc562844a4ea0fdfda53a05a275c50a23d94a;hp=14203bc54ff09fad1f4c0e568ee77ea86aedaf34
Author: Simon Tatham <anakin at pobox.com>
Date:   Wed Aug 3 20:48:46 2022 +0100

    Formatting: remove spurious spaces in 'type * var'.
    
    I think a lot of these were inserted by a prior run through GNU indent
    many years ago. I noticed in a more recent experiment that that tool
    doesn't always correctly distinguish which instances of 'id * id' are
    pointer variable declarations and which are multiplications, so it
    spaces some of the former as if they were the latter.

 crypto/blowfish.c   | 18 +++++++++---------
 proxy/proxy.c       |  2 +-
 putty.h             |  4 ++--
 ssh/pgssapi.h       |  6 +++---
 ssh/zlib.c          |  4 ++--
 terminal/terminal.c |  2 +-
 tree234.h           | 22 +++++++++++-----------
 utils/tree234.c     | 32 ++++++++++++++++----------------
 windows/network.c   |  4 ++--
 windows/unicode.c   |  6 +++---
 windows/window.c    |  4 ++--
 11 files changed, 52 insertions(+), 52 deletions(-)

commit 9cac27946ac59e5954db1f6d4a41f63accc9bcb6
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=9cac27946ac59e5954db1f6d4a41f63accc9bcb6;hp=4b8dc562844a4ea0fdfda53a05a275c50a23d94a
Author: Simon Tatham <anakin at pobox.com>
Date:   Wed Aug 3 20:48:46 2022 +0100

    Formatting: miscellaneous.
    
    This patch fixes a few other whitespace and formatting issues which
    were pointed out by the bulk-reindent or which I spotted in passing,
    some involving manual editing to break lines more nicely.
    
    I think the weirdest hunk in here is the one in windows/window.c
    TranslateKey() where _half_ of an assignment statement inside an 'if'
    was on the same line as the trailing paren of the if condition. No
    idea at all how that one managed to happen!

 otherbackends/supdup.c | 44 ++++++++++++++++++++++----------------------
 otherbackends/telnet.c |  2 +-
 pscp.c                 |  3 +--
 ssh/pgssapi.c          |  4 ++--
 ssh/portfwd.c          |  2 +-
 ssh/sftp.c             |  3 +--
 ssh/transport2.c       |  6 +++---
 ssh/userauth2-client.c |  7 ++++---
 terminal/terminal.c    |  6 +++---
 test/sclog/sclog.c     |  2 +-
 test/testcrypt.c       |  2 +-
 unix/uppity.c          |  2 +-
 unix/window.c          | 18 ++++++++----------
 utils/conf.c           |  2 +-
 windows/jump-list.c    |  9 +++------
 windows/pageant.c      |  3 +--
 windows/unicode.c      |  4 ++--
 windows/window.c       | 21 +++++++++------------
 18 files changed, 65 insertions(+), 75 deletions(-)

commit 61a877cce40467cd30cfc1178af3d157cc19ea10
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=61a877cce40467cd30cfc1178af3d157cc19ea10;hp=9cac27946ac59e5954db1f6d4a41f63accc9bcb6
Author: Simon Tatham <anakin at pobox.com>
Date:   Wed Aug 3 20:48:46 2022 +0100

    Comment typo in supdup.c.
    
    Spotted in passing during all this indentation work: it had misspelled
    its own protocol name :-)

 otherbackends/supdup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



More information about the tartarus-commits mailing list