simon-git: putty (master): Simon Tatham
Commits to Tartarus hosted VCS
tartarus-commits at lists.tartarus.org
Sat Dec 8 20:50:12 GMT 2018
TL;DR:
e08641c9 Start using C99 variadic macros.
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-12-08 20:50:12
commit e08641c912e4a6144ea61b38e9896953ca4b0dda
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=e08641c912e4a6144ea61b38e9896953ca4b0dda;hp=383a16d5e54ae2563e630511a6e275833c4dfcc0
Author: Simon Tatham <anakin at pobox.com>
Date: Sat Dec 8 20:32:31 2018 +0000
Start using C99 variadic macros.
In the past, I've had a lot of macros which you call with double
parentheses, along the lines of debug(("format string", params)), so
that the inner parens protect the commas and permit the macro to treat
the whole printf-style argument list as one macro argument.
That's all very well, but it's a bit inconvenient (it doesn't leave
you any way to implement such a macro by prepending another argument
to the list), and now this code base's rules allow C99isms, I can
switch all those macros to using a single pair of parens, using the
C99 ability to say '...' in the parameter list of the #define and get
at the corresponding suffix of the arguments as __VA_ARGS__.
So I'm doing it. I've made the following printf-style macros variadic:
bpp_logevent, ppl_logevent, ppl_printf and debug.
While I'm here, I've also fixed up a collection of conditioned-out
calls to debug() in the Windows front end which were clearly expecting
a macro with a different calling syntax, because they had an integer
parameter first. If I ever have a need to condition those back in,
they should actually work now.
mainchan.c | 56 ++++++++---------
misc.h | 6 +-
ssh1bpp.c | 4 +-
ssh1connection-client.c | 26 ++++----
ssh1connection-server.c | 24 ++++----
ssh1connection.c | 6 +-
ssh1login-server.c | 8 +--
ssh1login.c | 150 ++++++++++++++++++++++-----------------------
ssh2bpp.c | 56 ++++++++---------
ssh2connection-client.c | 34 +++++------
ssh2connection-server.c | 22 +++----
ssh2connection.c | 9 ++-
ssh2kex-client.c | 84 ++++++++++++-------------
ssh2kex-server.c | 20 +++---
ssh2transport.c | 26 ++++----
ssh2userauth.c | 158 ++++++++++++++++++++++++------------------------
sshbn.c | 9 ++-
sshbpp.h | 8 +--
sshcommon.c | 2 +-
sshppl.h | 14 ++---
sshverstring.c | 44 +++++++-------
unix/gtkwin.c | 158 ++++++++++++++++++++++++------------------------
unix/uxnet.c | 2 +-
windows/window.c | 102 +++++++++++++++----------------
windows/winpgnt.c | 20 +++---
windows/winucs.c | 9 ++-
26 files changed, 525 insertions(+), 532 deletions(-)
More information about the tartarus-commits
mailing list