[vlc-commits] access: mmstu: fix signedness

Francois Cartegnie git at videolan.org
Mon Dec 28 23:35:53 CET 2015


vlc/vlc-2.2 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sun Dec 27 23:34:45 2015 +0100| [ad600d5b9adb793964d2cf03eef0d2b5abe53214] | committer: Jean-Baptiste Kempf

access: mmstu: fix signedness

(cherry picked from commit 3524d9e534c5d1cacb6329798688c46741163c93)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=ad600d5b9adb793964d2cf03eef0d2b5abe53214
---

 modules/access/mms/mmstu.c |   16 ++++++++--------
 modules/access/mms/mmstu.h |    4 ++--
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/modules/access/mms/mmstu.c b/modules/access/mms/mmstu.c
index 5d1ce48..3d7e96e 100644
--- a/modules/access/mms/mmstu.c
+++ b/modules/access/mms/mmstu.c
@@ -1123,8 +1123,8 @@ static int NetFillBuffer( access_t *p_access )
     }
 #endif
 
-    if( i_tcp_read > 0 ) p_sys->i_buffer_tcp += i_tcp_read;
-    if( i_udp_read > 0 ) p_sys->i_buffer_udp += i_udp_read;
+    if( i_tcp_read > 0 ) p_sys->i_buffer_tcp += (size_t) i_tcp_read;
+    if( i_udp_read > 0 ) p_sys->i_buffer_udp += (size_t) i_udp_read;
 
     return i_tcp_read + i_udp_read;
 }
@@ -1132,7 +1132,7 @@ static int NetFillBuffer( access_t *p_access )
 static int  mms_ParseCommand( access_t *p_access,
                               uint8_t *p_data,
                               size_t i_data,
-                              int *pi_used )
+                              size_t *pi_used )
 {
  #define GET32( i_pos ) \
     ( p_sys->p_cmd[i_pos] + ( p_sys->p_cmd[i_pos +1] << 8 ) + \
@@ -1211,7 +1211,7 @@ static int  mms_ParseCommand( access_t *p_access,
 
 static int  mms_ParsePacket( access_t *p_access,
                              uint8_t *p_data, size_t i_data,
-                             int *pi_used )
+                             size_t *pi_used )
 {
     access_sys_t        *p_sys = p_access->p_sys;
     int i_packet_seq_num;
@@ -1327,7 +1327,7 @@ static int mms_ReceivePacket( access_t *p_access )
             if( GetDWLE( p_sys->buffer_tcp + 4 ) == 0xb00bface  )
             {
                 if( GetDWLE( p_sys->buffer_tcp + 8 ) + 16 <=
-                    (uint32_t)p_sys->i_buffer_tcp )
+                    (size_t)p_sys->i_buffer_tcp )
                 {
                     b_refill = false;
                 }
@@ -1354,7 +1354,7 @@ static int mms_ReceivePacket( access_t *p_access )
 
         if( p_sys->i_buffer_tcp > 0 )
         {
-            int i_used;
+            size_t i_used;
 
             if( GetDWLE( p_sys->buffer_tcp + 4 ) == 0xb00bface )
             {
@@ -1378,7 +1378,7 @@ static int mms_ReceivePacket( access_t *p_access )
         }
         else if( p_sys->i_buffer_udp > 0 )
         {
-            int i_used;
+            size_t i_used;
 
             i_packet_udp_type =
                 mms_ParsePacket( p_access, p_sys->buffer_udp,
@@ -1415,7 +1415,7 @@ static int mms_ReceiveCommand( access_t *p_access )
 
     for( ;; )
     {
-        int i_used;
+        size_t i_used;
         int i_status;
 
         if( NetFillBuffer( p_access ) < 0 )
diff --git a/modules/access/mms/mmstu.h b/modules/access/mms/mmstu.h
index 31593f9..afe9229 100644
--- a/modules/access/mms/mmstu.h
+++ b/modules/access/mms/mmstu.h
@@ -51,10 +51,10 @@ struct access_sys_t
 
     /* */
     uint8_t     buffer_tcp[MMS_BUFFER_SIZE];
-    int         i_buffer_tcp;
+    size_t      i_buffer_tcp;
 
     uint8_t     buffer_udp[MMS_BUFFER_SIZE];
-    int         i_buffer_udp;
+    size_t      i_buffer_udp;
 
     /* data necessary to send data to server */
     guid_t      guid;



More information about the vlc-commits mailing list