mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-01 03:22:48 -05:00
Rename FROMFIELD to 'container_of'.
Ian Jackson points out that the Linux kernel has a macro of this name with the same purpose, and suggests that it's a good idea to use the same name as they do, so that at least some people reading one code base might recognise it from the other. I never really thought very hard about what order FROMFIELD's parameters should go in, and therefore I'm pleasantly surprised to find that my order agrees with the kernel's, so I don't have to permute every call site as part of making this change :-)
This commit is contained in:
2
import.c
2
import.c
@ -916,7 +916,7 @@ int openssh_pem_write(const Filename *filename, struct ssh2_userkey *key,
|
||||
ssh_key_alg(key->key) == &ssh_ecdsa_nistp384 ||
|
||||
ssh_key_alg(key->key) == &ssh_ecdsa_nistp521) {
|
||||
const unsigned char *oid;
|
||||
struct ec_key *ec = FROMFIELD(key->key, struct ec_key, sshk);
|
||||
struct ec_key *ec = container_of(key->key, struct ec_key, sshk);
|
||||
int oidlen;
|
||||
int pointlen;
|
||||
strbuf *seq, *sub;
|
||||
|
Reference in New Issue
Block a user