1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 09:27:59 +00:00

Remove duplicate coroutine macros.

pageant.c and sshshare.c each had an extra copy of crBegin and
crFinishV, dating from when the main versions were kept in ssh.c where
they couldn't be conveniently #included by other modules. Now they're
in sshcr.h, where they can be, so there's no need to have extra copies
of them anywhere.

(But I've left the crGetChar macro in each of those files, because
those really are specific to the particular context, referring to an
extra variable that clients of the more general sshcr.h macros won't
all have.)
This commit is contained in:
Simon Tatham 2019-02-28 18:05:38 +00:00
parent 4ecc3f3c09
commit 59c8df4130
2 changed files with 6 additions and 6 deletions

View File

@ -9,6 +9,7 @@
#include "putty.h"
#include "mpint.h"
#include "ssh.h"
#include "sshcr.h"
#include "pageant.h"
/*
@ -703,10 +704,9 @@ bool pageant_delete_ssh2_key(ssh2_userkey *skey)
*/
/*
* Coroutine macros similar to, but simplified from, those in ssh.c.
* An extra coroutine macro, specific to this code which is consuming
* 'const char *data'.
*/
#define crBegin(v) { int *crLine = &v; switch(v) { case 0:;
#define crFinishV } *crLine = 0; return; }
#define crGetChar(c) do \
{ \
while (len == 0) { \

View File

@ -138,6 +138,7 @@
#include "putty.h"
#include "tree234.h"
#include "ssh.h"
#include "sshcr.h"
struct ssh_sharing_state {
char *sockname; /* the socket name, kept for cleanup */
@ -1741,10 +1742,9 @@ static void share_got_pkt_from_downstream(struct ssh_sharing_connstate *cs,
}
/*
* Coroutine macros similar to, but simplified from, those in ssh.c.
* An extra coroutine macro, specific to this code which is consuming
* 'const char *data'.
*/
#define crBegin(v) { int *crLine = &v; switch(v) { case 0:;
#define crFinishV } *crLine = 0; return; }
#define crGetChar(c) do \
{ \
while (len == 0) { \