back on C99 initializer syntax. I don't think this will be a huge
problem in practice: all the currently supported platforms use GCC as
their default compiler, and all vaguely recent versions of GCC support
this feature.
const char *dumpfile = 0;
static const struct addrinfo prefs = {
const char *dumpfile = 0;
static const struct addrinfo prefs = {
- AI_PASSIVE,
- PF_INET,
- SOCK_DGRAM,
- IPPROTO_UDP,
- 0,
- 0,
- 0,
- 0
+ .ai_flags = AI_PASSIVE,
+ .ai_family = PF_INET,
+ .ai_socktype = SOCK_DGRAM,
+ .ai_protocol = IPPROTO_UDP
socklen_t len;
static const struct addrinfo pref = {
socklen_t len;
static const struct addrinfo pref = {
- 0,
- PF_INET,
- SOCK_STREAM,
- IPPROTO_TCP,
- 0,
- 0,
- 0,
- 0
+ .ai_flags = 0,
+ .ai_family = PF_INET,
+ .ai_socktype = SOCK_STREAM,
+ .ai_protocol = IPPROTO_TCP,
};
if(config->connect.n) {
};
if(config->connect.n) {
FILE *in, *out;
static const struct addrinfo pref = {
FILE *in, *out;
static const struct addrinfo pref = {
- 0,
- PF_INET,
- SOCK_STREAM,
- IPPROTO_TCP,
- 0,
- 0,
- 0,
- 0
+ .ai_flags = 0,
+ .ai_family = PF_INET,
+ .ai_socktype = SOCK_STREAM,
+ .ai_protocol = IPPROTO_TCP,
};
/* Find the SMTP server */
};
/* Find the SMTP server */
struct sockaddr_un su;
static const struct addrinfo pref = {
struct sockaddr_un su;
static const struct addrinfo pref = {
- AI_PASSIVE,
- PF_INET,
- SOCK_STREAM,
- 0,
- 0,
- 0,
- 0,
- 0
+ .ai_flags = AI_PASSIVE,
+ .ai_family = PF_INET,
+ .ai_socktype = SOCK_STREAM,
};
struct sockaddr_in a1 = {
};
struct sockaddr_in a1 = {
static void network_init(void) {
struct addrinfo *res, *sres;
static const struct addrinfo pref = {
static void network_init(void) {
struct addrinfo *res, *sres;
static const struct addrinfo pref = {
- 0,
- PF_INET,
- SOCK_DGRAM,
- IPPROTO_UDP,
- 0,
- 0,
- 0,
- 0
+ .ai_flags = 0,
+ .ai_family = PF_INET,
+ .ai_socktype = SOCK_DGRAM,
+ .ai_protocol = IPPROTO_UDP,
};
static const struct addrinfo prefbind = {
};
static const struct addrinfo prefbind = {
- AI_PASSIVE,
- PF_INET,
- SOCK_DGRAM,
- IPPROTO_UDP,
- 0,
- 0,
- 0,
- 0
+ .ai_flags = AI_PASSIVE,
+ .ai_family = PF_INET,
+ .ai_socktype = SOCK_DGRAM,
+ .ai_protocol = IPPROTO_UDP,
};
static const int one = 1;
int sndbuf, target_sndbuf = 131072;
};
static const int one = 1;
int sndbuf, target_sndbuf = 131072;
char *name;
static const struct addrinfo pref = {
char *name;
static const struct addrinfo pref = {
- AI_PASSIVE,
- PF_INET,
- SOCK_STREAM,
- IPPROTO_TCP,
- 0,
- 0,
- 0,
- 0
+ .ai_flags = AI_PASSIVE,
+ .ai_family = PF_INET,
+ .ai_socktype = SOCK_STREAM,
+ .ai_protocol = IPPROTO_TCP,
fd_set fds;
struct timeval tv;
static const struct addrinfo pref = {
fd_set fds;
struct timeval tv;
static const struct addrinfo pref = {
- 0, /* ai_flags */
- AF_UNSPEC, /* ai_family */
- SOCK_DGRAM, /* ai_socktype */
- IPPROTO_UDP, /* ai_protocol */
- 0,
- 0,
- 0,
- 0
+ .ai_flags = 0,
+ .ai_family = AF_UNSPEC,
+ .ai_socktype = SOCK_DGRAM,
+ .ai_protocol = IPPROTO_UDP,