1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-02 15:53:12 +02:00

relay: remove local variables used only for sizeof

This commit is contained in:
Simmo Saan
2017-06-03 12:28:00 +03:00
parent ec13a66af3
commit 996aaf0613
2 changed files with 4 additions and 9 deletions
+2 -5
View File
@@ -1773,13 +1773,12 @@ relay_irc_close_connection (struct t_relay_client *client)
void
relay_irc_alloc (struct t_relay_client *client)
{
struct t_relay_irc_data *irc_data;
char *password;
password = weechat_string_eval_expression (weechat_config_string (relay_config_network_password),
NULL, NULL, NULL);
client->protocol_data = malloc (sizeof (*irc_data));
client->protocol_data = malloc (sizeof (struct t_relay_irc_data));
if (client->protocol_data)
{
RELAY_IRC_DATA(client, address) = strdup ("weechat.relay.irc");
@@ -1810,9 +1809,7 @@ void
relay_irc_alloc_with_infolist (struct t_relay_client *client,
struct t_infolist *infolist)
{
struct t_relay_irc_data *irc_data;
client->protocol_data = malloc (sizeof (*irc_data));
client->protocol_data = malloc (sizeof (struct t_relay_irc_data));
if (client->protocol_data)
{
RELAY_IRC_DATA(client, address) = strdup (weechat_infolist_string (infolist, "address"));
+2 -4
View File
@@ -166,13 +166,12 @@ relay_weechat_free_buffers_nicklist (struct t_hashtable *hashtable,
void
relay_weechat_alloc (struct t_relay_client *client)
{
struct t_relay_weechat_data *weechat_data;
char *password;
password = weechat_string_eval_expression (weechat_config_string (relay_config_network_password),
NULL, NULL, NULL);
client->protocol_data = malloc (sizeof (*weechat_data));
client->protocol_data = malloc (sizeof (struct t_relay_weechat_data));
if (client->protocol_data)
{
RELAY_WEECHAT_DATA(client, password_ok) = (password && password[0]) ? 0 : 1;
@@ -212,12 +211,11 @@ void
relay_weechat_alloc_with_infolist (struct t_relay_client *client,
struct t_infolist *infolist)
{
struct t_relay_weechat_data *weechat_data;
int index, value;
char name[64];
const char *key;
client->protocol_data = malloc (sizeof (*weechat_data));
client->protocol_data = malloc (sizeof (struct t_relay_weechat_data));
if (client->protocol_data)
{
/* general stuff */