summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2011-09-22 16:16:41 +0200
committerSebastien Helleu <flashcode@flashtux.org>2011-09-22 16:16:41 +0200
commit893485ba5fcf791ceed99ab122e336402624b872 (patch)
treee395f6326eb4c166b78fc7aae180a3a7ba343558
parent0602bc105b8f90b09e94bbbdfcb829841141d3ed (diff)
downloadweechat-893485ba5fcf791ceed99ab122e336402624b872.zip
core: remove compilation warnings about unused return values of functions
-rw-r--r--src/core/wee-command.c8
-rw-r--r--src/core/wee-network.c52
-rw-r--r--src/plugins/plugin-api.c3
-rw-r--r--src/plugins/scripts/script.c5
-rw-r--r--src/plugins/xfer/xfer-network.c4
5 files changed, 51 insertions, 21 deletions
diff --git a/src/core/wee-command.c b/src/core/wee-command.c
index 071f30820..fef274fdc 100644
--- a/src/core/wee-command.c
+++ b/src/core/wee-command.c
@@ -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 */
diff --git a/src/core/wee-network.c b/src/core/wee-network.c
index 468f94c82..7cb018132 100644
--- a/src/core/wee-network.c
+++ b/src/core/wee-network.c
@@ -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)
diff --git a/src/plugins/plugin-api.c b/src/plugins/plugin-api.c
index 7ac39977e..95de05b7c 100644
--- a/src/plugins/plugin-api.c
+++ b/src/plugins/plugin-api.c
@@ -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;
diff --git a/src/plugins/scripts/script.c b/src/plugins/scripts/script.c
index b87c4bad7..44d3d1dda 100644
--- a/src/plugins/scripts/script.c
+++ b/src/plugins/scripts/script.c
@@ -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);
diff --git a/src/plugins/xfer/xfer-network.c b/src/plugins/xfer/xfer-network.c
index 88443f76c..f588aa022 100644
--- a/src/plugins/xfer/xfer-network.c
+++ b/src/plugins/xfer/xfer-network.c
@@ -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;
}
/*