Commit fee8fdfa authored by Dafydd Harries's avatar Dafydd Harries
Browse files

add G_GNUC_WARN_UNUSED_RESULT to various functions

darcs-hash:20070202181157-c9803-5a63de6917664fe6855f9da9082d804795bcf536.gz
parent 18bc65fc
......@@ -40,6 +40,7 @@ nice_address_dup (NiceAddress *a);
void
nice_address_set_ipv4 (NiceAddress *addr, guint32 addr_ipv4);
G_GNUC_WARN_UNUSED_RESULT
gboolean
nice_address_set_ipv4_from_string (NiceAddress *addr, gchar *str);
......
......@@ -218,7 +218,10 @@ nice_agent_add_local_host_candidate (
sin.sin_addr.s_addr = htonl (address->addr_ipv4);
sin.sin_port = 0;
/* XXX: handle error */
nice_udp_socket_factory_make (agent->socket_factory, &(candidate->sock), &sin);
if (!nice_udp_socket_factory_make (agent->socket_factory,
&(candidate->sock), &sin))
g_assert_not_reached ();
candidate->addr.port = ntohs (candidate->sock.addr.sin_port);
candidate->base_addr.port = ntohs (candidate->sock.addr.sin_port);
}
......
......@@ -37,7 +37,7 @@ main (void)
/* set up agent */
agent = nice_agent_new (&factory);
nice_address_set_ipv4_from_string (&addr, "192.168.0.1");
g_assert (nice_address_set_ipv4_from_string (&addr, "192.168.0.1"));
nice_agent_add_local_address (agent, &addr);
nice_agent_add_stream (agent, handle_recv, NULL);
g_assert (agent->local_candidates != NULL);
......
......@@ -205,8 +205,8 @@ main (void)
nice_udp_fake_socket_factory_init (&factory);
nice_address_set_ipv4_from_string (&local_addr, "192.168.0.1");
nice_address_set_ipv4_from_string (&remote_addr, "192.168.0.5");
g_assert (nice_address_set_ipv4_from_string (&local_addr, "192.168.0.1"));
g_assert (nice_address_set_ipv4_from_string (&remote_addr, "192.168.0.5"));
remote_addr.port = 5678;
from.sin_family = AF_INET;
......
......@@ -26,10 +26,10 @@ main (void)
nice_udp_fake_socket_factory_init (&factory);
nice_address_set_ipv4_from_string (&addr_local, "192.168.0.1");
g_assert (nice_address_set_ipv4_from_string (&addr_local, "192.168.0.1"));
/* fake socket manager uses incremental port numbers starting at 1 */
addr_local.port = 1;
nice_address_set_ipv4_from_string (&addr_remote, "192.168.0.2");
g_assert (nice_address_set_ipv4_from_string (&addr_remote, "192.168.0.2"));
addr_remote.port = 2345;
agent = nice_agent_new (&factory);
......
......@@ -35,9 +35,10 @@ make_agent (
agent = nice_agent_new (factory);
nice_address_set_ipv4_from_string (&addr_local, ip);
nice_agent_add_local_address (agent, &addr_local);
if (!nice_address_set_ipv4_from_string (&addr_local, ip))
g_assert_not_reached ();
nice_agent_add_local_address (agent, &addr_local);
nice_agent_add_stream (agent, handle_recv, NULL);
g_assert (agent->local_candidates != NULL);
......
......@@ -21,7 +21,9 @@ main (void)
sin.sin_addr.s_addr = INADDR_ANY;
sin.sin_port = 0;
nice_udp_socket_factory_make (&man, &sock, &sin);
if (!nice_udp_socket_factory_make (&man, &sock, &sin))
g_assert_not_reached ();
/* test recv */
......
......@@ -41,6 +41,7 @@ struct _UDPSocketManager
* If sin->sin_port is 0, a port will be assigned at random. In all cases, the
* address bound to will be set in sock->addr.
*/
G_GNUC_WARN_UNUSED_RESULT
gboolean
nice_udp_socket_factory_make (
NiceUDPSocketFactory *man,
......@@ -50,6 +51,7 @@ nice_udp_socket_factory_make (
void
nice_udp_socket_factory_close (NiceUDPSocketFactory *man);
G_GNUC_WARN_UNUSED_RESULT
guint
nice_udp_socket_recv (
NiceUDPSocket *sock,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment