[Pkg-telepathy-commits] [libnice] 194/265: pseudotcp: Don't mix "long" and guint, one is signed, the other is unsigned

Simon McVittie smcv at debian.org
Wed May 14 12:05:07 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 f55c780eb9649c0a3de77e98a8fe7696b1df24fe
Author: Olivier Crête <olivier.crete at collabora.com>
Date:   Mon Mar 31 17:44:45 2014 -0400

    pseudotcp: Don't mix "long" and guint, one is signed, the other is unsigned
    
    So use guint64 everywhere, this is never supposed to be negative.
---
 agent/agent.c          | 2 +-
 agent/component.h      | 2 +-
 agent/pseudotcp.c      | 2 +-
 agent/pseudotcp.h      | 3 ++-
 tests/test-pseudotcp.c | 3 ++-
 5 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/agent/agent.c b/agent/agent.c
index b9253a1..61617cb 100644
--- a/agent/agent.c
+++ b/agent/agent.c
@@ -1454,7 +1454,7 @@ static void
 adjust_tcp_clock (NiceAgent *agent, Stream *stream, Component *component)
 {
   if (component->tcp) {
-    long timeout = component->last_clock_timeout;
+    guint64 timeout = component->last_clock_timeout;
 
     if (pseudo_tcp_socket_get_next_clock (component->tcp, &timeout)) {
       if (timeout != component->last_clock_timeout) {
diff --git a/agent/component.h b/agent/component.h
index 143c212..13466c9 100644
--- a/agent/component.h
+++ b/agent/component.h
@@ -190,7 +190,7 @@ struct _Component
 
   PseudoTcpSocket *tcp;
   GSource* tcp_clock;
-  long last_clock_timeout;
+  guint64 last_clock_timeout;
   gboolean tcp_readable;
   GCancellable *tcp_writable_cancellable;
 
diff --git a/agent/pseudotcp.c b/agent/pseudotcp.c
index 013b666..2f511c3 100644
--- a/agent/pseudotcp.c
+++ b/agent/pseudotcp.c
@@ -936,7 +936,7 @@ pseudo_tcp_socket_notify_message (PseudoTcpSocket *self,
 }
 
 gboolean
-pseudo_tcp_socket_get_next_clock(PseudoTcpSocket *self, long *timeout)
+pseudo_tcp_socket_get_next_clock(PseudoTcpSocket *self, guint64 *timeout)
 {
   PseudoTcpSocketPrivate *priv = self->priv;
   guint32 now = get_current_time ();
diff --git a/agent/pseudotcp.h b/agent/pseudotcp.h
index 5082c15..ca7cb95 100644
--- a/agent/pseudotcp.h
+++ b/agent/pseudotcp.h
@@ -357,7 +357,8 @@ int pseudo_tcp_socket_get_error(PseudoTcpSocket *self);
  *
  * Since: 0.0.11
  */
-gboolean pseudo_tcp_socket_get_next_clock(PseudoTcpSocket *self, long *timeout);
+gboolean pseudo_tcp_socket_get_next_clock(PseudoTcpSocket *self,
+    guint64 *timeout);
 
 
 /**
diff --git a/tests/test-pseudotcp.c b/tests/test-pseudotcp.c
index 642c18e..1d8707c 100644
--- a/tests/test-pseudotcp.c
+++ b/tests/test-pseudotcp.c
@@ -220,7 +220,8 @@ static gboolean notify_clock (gpointer data)
 
 static void adjust_clock (PseudoTcpSocket *sock)
 {
-  long timeout = 0;
+  guint64 timeout = 0;
+
   if (pseudo_tcp_socket_get_next_clock (sock, &timeout)) {
     timeout -= g_get_monotonic_time () / 1000;
     g_debug ("Socket %p: Adjuting clock to %ld ms", sock, timeout);

-- 
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