[Pkg-telepathy-commits] [libnice] 114/265: socket: Fix the formal parameter types of nice_turn_socket_parse_recv()
Simon McVittie
smcv at debian.org
Wed May 14 12:04:58 UTC 2014
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to branch debian
in repository libnice.
commit 899033492418725ccd17a1784529fd6634c7c2fe
Author: Philip Withnall <philip.withnall at collabora.co.uk>
Date: Thu Jan 16 16:00:42 2014 +0000
socket: Fix the formal parameter types of nice_turn_socket_parse_recv()
gsize and guint8 are more obviously for binary data than gint and gchar.
Note the signedness of the return type has changed: the function never
returns negative values.
---
socket/turn.c | 12 ++++++------
socket/turn.h | 6 +++---
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/socket/turn.c b/socket/turn.c
index 9592d0b..b153be7 100644
--- a/socket/turn.c
+++ b/socket/turn.c
@@ -356,8 +356,8 @@ socket_recv_messages (NiceSocket *sock,
/* Parse in-place. */
parsed_buffer_length = nice_turn_socket_parse_recv (sock, &dummy,
- &from, buffer_length, (gchar *) buffer,
- message->from, (gchar *) buffer, buffer_length);
+ &from, buffer_length, buffer,
+ message->from, buffer, buffer_length);
message->length = MAX (parsed_buffer_length, 0);
if (parsed_buffer_length < 0) {
@@ -822,10 +822,10 @@ priv_binding_timeout (gpointer data)
return FALSE;
}
-gint
+gsize
nice_turn_socket_parse_recv (NiceSocket *sock, NiceSocket **from_sock,
- NiceAddress *from, guint len, gchar *buf,
- NiceAddress *recv_from, gchar *_recv_buf, guint recv_len)
+ NiceAddress *from, gsize len, guint8 *buf,
+ NiceAddress *recv_from, guint8 *_recv_buf, gsize recv_len)
{
TurnPriv *priv = (TurnPriv *) sock->priv;
@@ -843,7 +843,7 @@ nice_turn_socket_parse_recv (NiceSocket *sock, NiceSocket **from_sock,
if (nice_address_equal (&priv->server_addr, recv_from)) {
valid = stun_agent_validate (&priv->agent, &msg,
- recv_buf.u8, (size_t) recv_len, NULL, NULL);
+ recv_buf.u8, recv_len, NULL, NULL);
if (valid == STUN_VALIDATION_SUCCESS) {
if (priv->compatibility != NICE_TURN_SOCKET_COMPATIBILITY_DRAFT9 &&
diff --git a/socket/turn.h b/socket/turn.h
index fee8108..b700430 100644
--- a/socket/turn.h
+++ b/socket/turn.h
@@ -52,10 +52,10 @@ typedef enum {
G_BEGIN_DECLS
-gint
+gsize
nice_turn_socket_parse_recv (NiceSocket *sock, NiceSocket **from_sock,
- NiceAddress *from, guint len, gchar *buf,
- NiceAddress *recv_from, gchar *recv_buf, guint recv_len);
+ NiceAddress *from, gsize len, guint8 *buf,
+ NiceAddress *recv_from, guint8 *recv_buf, gsize recv_len);
gboolean
nice_turn_socket_set_peer (NiceSocket *sock, NiceAddress *peer);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-telepathy/libnice.git
More information about the Pkg-telepathy-commits
mailing list