1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-09 19:23:13 +02:00

core: remove compilation warnings about unused return values of functions

This commit is contained in:
Sebastien Helleu
2011-09-22 16:16:41 +02:00
parent 0602bc105b
commit 893485ba5f
5 changed files with 51 additions and 21 deletions
+6 -2
View File
@@ -156,6 +156,7 @@ command_bar_list (int full)
COMMAND_CALLBACK(bar)
{
int i, type, position, number;
long value;
char *error, *str_type, *pos_condition;
struct t_gui_bar *ptr_bar;
struct t_gui_bar_item *ptr_item;
@@ -254,7 +255,8 @@ COMMAND_CALLBACK(bar)
return WEECHAT_RC_OK;
}
error = NULL;
(void) strtol (argv[5], &error, 10);
value = strtol (argv[5], &error, 10);
(void) value;
if (error && !error[0])
{
/* create bar */
@@ -3621,6 +3623,7 @@ command_proxy_list ()
COMMAND_CALLBACK(proxy)
{
int type;
long value;
char *error;
struct t_proxy *ptr_proxy;
@@ -3658,7 +3661,8 @@ COMMAND_CALLBACK(proxy)
return WEECHAT_RC_OK;
}
error = NULL;
(void) strtol (argv[5], &error, 10);
value = strtol (argv[5], &error, 10);
(void) value;
if (error && !error[0])
{
/* create proxy */
+37 -15
View File
@@ -519,7 +519,7 @@ network_connect_child (struct t_hook *hook_connect)
char status_str[2], *ptr_address, *status_ok_with_address;
char ipv4_address[INET_ADDRSTRLEN + 1], ipv6_address[INET6_ADDRSTRLEN + 1];
char status_ok_without_address[1 + 5 + 1];
int rc, length;
int rc, length, num_written;
res = NULL;
res_local = NULL;
@@ -535,7 +535,9 @@ network_connect_child (struct t_hook *hook_connect)
{
/* proxy not found */
status_str[0] = '0' + WEECHAT_HOOK_CONNECT_PROXY_ERROR;
write (HOOK_CONNECT(hook_connect, child_write), status_str, 1);
num_written = write (HOOK_CONNECT(hook_connect, child_write),
status_str, 1);
(void) num_written;
return;
}
}
@@ -551,14 +553,18 @@ network_connect_child (struct t_hook *hook_connect)
{
/* address not found */
status_str[0] = '0' + WEECHAT_HOOK_CONNECT_ADDRESS_NOT_FOUND;
write (HOOK_CONNECT(hook_connect, child_write), status_str, 1);
num_written = write (HOOK_CONNECT(hook_connect, child_write),
status_str, 1);
(void) num_written;
return;
}
if (!res)
{
/* adddress not found */
status_str[0] = '0' + WEECHAT_HOOK_CONNECT_ADDRESS_NOT_FOUND;
write (HOOK_CONNECT(hook_connect, child_write), status_str, 1);
num_written = write (HOOK_CONNECT(hook_connect, child_write),
status_str, 1);
(void) num_written;
return;
}
if ((CONFIG_BOOLEAN(ptr_proxy->options[PROXY_OPTION_IPV6]) && (res->ai_family != AF_INET6))
@@ -566,7 +572,9 @@ network_connect_child (struct t_hook *hook_connect)
{
/* IP address not found */
status_str[0] = '0' + WEECHAT_HOOK_CONNECT_IP_ADDRESS_NOT_FOUND;
write (HOOK_CONNECT(hook_connect, child_write), status_str, 1);
num_written = write (HOOK_CONNECT(hook_connect, child_write),
status_str, 1);
(void) num_written;
freeaddrinfo (res);
return;
}
@@ -582,7 +590,9 @@ network_connect_child (struct t_hook *hook_connect)
{
/* connection refused */
status_str[0] = '0' + WEECHAT_HOOK_CONNECT_CONNECTION_REFUSED;
write (HOOK_CONNECT(hook_connect, child_write), status_str, 1);
num_written = write (HOOK_CONNECT(hook_connect, child_write),
status_str, 1);
(void) num_written;
freeaddrinfo (res);
return;
}
@@ -594,7 +604,9 @@ network_connect_child (struct t_hook *hook_connect)
{
/* proxy fails to connect to peer */
status_str[0] = '0' + WEECHAT_HOOK_CONNECT_PROXY_ERROR;
write (HOOK_CONNECT(hook_connect, child_write), status_str, 1);
num_written = write (HOOK_CONNECT(hook_connect, child_write),
status_str, 1);
(void) num_written;
freeaddrinfo (res);
return;
}
@@ -620,7 +632,9 @@ network_connect_child (struct t_hook *hook_connect)
{
/* fails to set local hostname/IP */
status_str[0] = '0' + WEECHAT_HOOK_CONNECT_LOCAL_HOSTNAME_ERROR;
write (HOOK_CONNECT(hook_connect, child_write), status_str, 1);
num_written = write (HOOK_CONNECT(hook_connect, child_write),
status_str, 1);
(void) num_written;
if (res_local)
freeaddrinfo (res_local);
return;
@@ -630,7 +644,9 @@ network_connect_child (struct t_hook *hook_connect)
{
/* fails to set local hostname/IP */
status_str[0] = '0' + WEECHAT_HOOK_CONNECT_LOCAL_HOSTNAME_ERROR;
write (HOOK_CONNECT(hook_connect, child_write), status_str, 1);
num_written = write (HOOK_CONNECT(hook_connect, child_write),
status_str, 1);
(void) num_written;
if (res_local)
freeaddrinfo (res_local);
return;
@@ -647,7 +663,9 @@ network_connect_child (struct t_hook *hook_connect)
{
/* address not found */
status_str[0] = '0' + WEECHAT_HOOK_CONNECT_ADDRESS_NOT_FOUND;
write (HOOK_CONNECT(hook_connect, child_write), status_str, 1);
num_written = write (HOOK_CONNECT(hook_connect, child_write),
status_str, 1);
(void) num_written;
if (res)
freeaddrinfo (res);
if (res_local)
@@ -721,21 +739,25 @@ network_connect_child (struct t_hook *hook_connect)
if (status_ok_with_address)
{
write (HOOK_CONNECT(hook_connect, child_write),
status_ok_with_address, strlen (status_ok_with_address));
num_written = write (HOOK_CONNECT(hook_connect, child_write),
status_ok_with_address, strlen (status_ok_with_address));
(void) num_written;
free (status_ok_with_address);
}
else
{
snprintf (status_ok_without_address, sizeof (status_ok_without_address),
"%s%05d", status_str, 0);
write (HOOK_CONNECT(hook_connect, child_write),
status_ok_without_address, strlen (status_ok_without_address));
num_written = write (HOOK_CONNECT(hook_connect, child_write),
status_ok_without_address, strlen (status_ok_without_address));
(void) num_written;
}
}
else
{
write (HOOK_CONNECT(hook_connect, child_write), status_str, 1);
num_written = write (HOOK_CONNECT(hook_connect, child_write),
status_str, 1);
(void) num_written;
}
if (res)
+2 -1
View File
@@ -314,7 +314,8 @@ plugin_api_info_get_internal (void *data, const char *info_name,
{
if (!weechat_dir_absolute_path[0])
{
realpath (weechat_home, weechat_dir_absolute_path);
if (!realpath (weechat_home, weechat_dir_absolute_path))
return NULL;
}
return (weechat_dir_absolute_path[0]) ?
weechat_dir_absolute_path : weechat_home;
+3 -2
View File
@@ -913,7 +913,7 @@ script_action_install (struct t_weechat_plugin *weechat_plugin,
char **argv, *name, *ptr_base_name, *base_name, *new_path, *autoload_path;
char *symlink_path;
const char *dir_home, *dir_separator;
int argc, i, length;
int argc, i, length, rc;
struct t_plugin_script *ptr_script;
if (*list)
@@ -968,7 +968,8 @@ script_action_install (struct t_weechat_plugin *weechat_plugin,
{
snprintf (symlink_path, length, "..%s%s",
dir_separator, base_name);
symlink (symlink_path, autoload_path);
rc = symlink (symlink_path, autoload_path);
(void) rc;
free (symlink_path);
}
free (autoload_path);
+3 -1
View File
@@ -76,10 +76,12 @@ void
xfer_network_write_pipe (struct t_xfer *xfer, int status, int error)
{
char buffer[1 + 1 + 32 + 1]; /* status + error + pos + \0 */
int num_written;
snprintf (buffer, sizeof (buffer), "%c%c%032llu",
status + '0', error + '0', xfer->pos);
write (xfer->child_write, buffer, sizeof (buffer));
num_written = write (xfer->child_write, buffer, sizeof (buffer));
(void) num_written;
}
/*