mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
libdns: Avoid using compound literals (3).
* dirmngr/dns.h (dns_p_new): Remove.
* dirmngr/dns.c (dns_hosts_query): Use dns_p_init with automatic
variable.
(dns_hints_query, dns_res_glue, parse_packet, query_hosts)
(send_query, show_hints, echo_port): Likewise.
--
Implicit automatic allocation by compound literals is confusing
for C90 code.
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
(cherry picked from commit 72efb78402
)
This commit is contained in:
parent
ff7d01fc6d
commit
f0de4fc990
2 changed files with 18 additions and 12 deletions
|
@ -412,9 +412,6 @@ struct dns_packet {
|
|||
|
||||
#define dns_p_sizeof(P) dns_p_calcsize((P)->end)
|
||||
|
||||
/** takes size of maximum desired payload */
|
||||
#define dns_p_new(n) (dns_p_init((struct dns_packet *)&(union { unsigned char b[dns_p_calcsize((n))]; struct dns_packet p; }){ { 0 } }, dns_p_calcsize((n))))
|
||||
|
||||
/** takes size of entire packet structure as allocated */
|
||||
DNS_PUBLIC struct dns_packet *dns_p_init(struct dns_packet *, size_t);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue