0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-26 00:32:35 +01:00

Fix header compatibility with c++ dialects.

This allows the option of at least -std=gnu++14 for new translation units.
Changes are trivial.
This commit is contained in:
Jason Volk 2016-06-20 17:45:31 -07:00
parent de800bd3d7
commit acd516444a
9 changed files with 16 additions and 17 deletions

View file

@ -28,7 +28,6 @@
#include "defaults.h"
struct Client;
struct rb_dlink_list;
struct SetOptions
{

View file

@ -203,7 +203,7 @@ struct server_conf
#endif
char *class_name;
struct Class *class;
struct Class *_class;
rb_dlink_node node;
};

View file

@ -131,7 +131,7 @@ get_client_ping(struct Client *target_p)
if(IsServer(target_p))
{
struct server_conf *server_p = target_p->localClient->att_sconf;
ping = PingFreq(server_p->class);
ping = PingFreq(server_p->_class);
}
else
{
@ -325,7 +325,7 @@ get_sendq(struct Client *client_p)
{
struct server_conf *server_p;
server_p = client_p->localClient->att_sconf;
return MaxSendq(server_p->class);
return MaxSendq(server_p->_class);
}
else
{

View file

@ -2005,7 +2005,7 @@ close_connection(struct Client *client_p)
server_p->hold = time(NULL);
server_p->hold +=
(server_p->hold - client_p->localClient->lasttime >
HANGONGOODLINK) ? HANGONRETRYDELAY : ConFreq(server_p->class);
HANGONGOODLINK) ? HANGONRETRYDELAY : ConFreq(server_p->_class);
}
}

View file

@ -442,13 +442,13 @@ add_server_conf(struct server_conf *server_p)
if(EmptyString(server_p->class_name))
{
server_p->class_name = rb_strdup("default");
server_p->class = default_class;
server_p->_class = default_class;
return;
}
server_p->class = find_class(server_p->class_name);
server_p->_class = find_class(server_p->class_name);
if(server_p->class == default_class)
if(server_p->_class == default_class)
{
conf_report_error("Warning connect::class invalid for %s",
server_p->name);
@ -511,7 +511,7 @@ attach_server_conf(struct Client *client_p, struct server_conf *server_p)
detach_server_conf(client_p);
}
CurrUsers(server_p->class)++;
CurrUsers(server_p->_class)++;
client_p->localClient->att_sconf = server_p;
server_p->servers++;
@ -527,13 +527,13 @@ detach_server_conf(struct Client *client_p)
client_p->localClient->att_sconf = NULL;
server_p->servers--;
CurrUsers(server_p->class)--;
CurrUsers(server_p->_class)--;
if(ServerConfIllegal(server_p) && !server_p->servers)
{
/* the class this one is using may need destroying too */
if(MaxUsers(server_p->class) < 0 && CurrUsers(server_p->class) <= 0)
free_class(server_p->class);
if(MaxUsers(server_p->_class) < 0 && CurrUsers(server_p->_class) <= 0)
free_class(server_p->_class);
rb_dlinkDelete(&server_p->node, &server_conf_list);
free_server_conf(server_p);

View file

@ -272,7 +272,7 @@ try_connections(void *unused)
if(ServerConfSSL(tmp_p) && (!ircd_ssl_ok || !get_ssld_count()))
continue;
cltmp = tmp_p->class;
cltmp = tmp_p->_class;
/*
* Skip this entry if the use of it is still on hold until

View file

@ -191,6 +191,6 @@ rb_fde_t *rb_recv_fd(rb_fde_t *);
const char *rb_ssl_get_cipher(rb_fde_t *F);
int rb_ipv4_from_ipv6(const struct sockaddr_in6 *restrict ip6, struct sockaddr_in *restrict ip4);
int rb_ipv4_from_ipv6(const struct sockaddr_in6 *__restrict__ ip6, struct sockaddr_in *__restrict__ ip4);
#endif /* INCLUDED_commio_h */

View file

@ -278,7 +278,7 @@ rb_dlinkFindDestroy(void *data, rb_dlink_list *list)
if(ptr != NULL)
{
rb_free_rb_dlink_node(ptr);
rb_free_rb_dlink_node((rb_dlink_node *)ptr);
return 1;
}
return 0;

View file

@ -70,7 +70,7 @@ __attribute__((returns_nonnull))
static inline char *
rb_strndup(const char *x, size_t y)
{
char *ret = malloc(y);
char *ret = (char *)malloc(y);
if(rb_unlikely(ret == NULL))
rb_outofmemory();
rb_strlcpy(ret, x, y);
@ -81,7 +81,7 @@ __attribute__((returns_nonnull))
static inline char *
rb_strdup(const char *x)
{
char *ret = malloc(strlen(x) + 1);
char *ret = (char *)malloc(strlen(x) + 1);
if(rb_unlikely(ret == NULL))
rb_outofmemory();
strcpy(ret, x);