[Spice-devel] [PATCH spice-server 2/6] main-channel: Fix multimedia time argument type

Frediano Ziglio fziglio at redhat.com
Tue Aug 29 10:53:35 UTC 2017


The multimedia time is defined as uint32_t.
Use the proper type instead of int.
Currently no arithmetic is done on this value but
just copies so considering that on the architectures
we support sizeof(int) == sizeof(uint32_t) there's
no change in the resulting machine code.

Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 server/main-channel-client.c | 2 +-
 server/main-channel-client.h | 2 +-
 server/main-channel.c        | 2 +-
 server/main-channel.h        | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/server/main-channel-client.c b/server/main-channel-client.c
index 82b578c8..db8e4823 100644
--- a/server/main-channel-client.c
+++ b/server/main-channel-client.c
@@ -116,7 +116,7 @@ typedef struct RedMouseModePipeItem {
 
 typedef struct RedMultiMediaTimePipeItem {
     RedPipeItem base;
-    int time;
+    uint32_t time;
 } RedMultiMediaTimePipeItem;
 
 #define ZERO_BUF_SIZE 4096
diff --git a/server/main-channel-client.h b/server/main-channel-client.h
index a2e38c2f..0f8e4f49 100644
--- a/server/main-channel-client.h
+++ b/server/main-channel-client.h
@@ -132,7 +132,7 @@ typedef struct MainMouseModeItemInfo {
 RedPipeItem *main_mouse_mode_item_new(RedChannelClient *rcc, void *data, int num);
 
 typedef struct MainMultiMediaTimeItemInfo {
-    int time;
+    uint32_t time;
 } MainMultiMediaTimeItemInfo;
 
 RedPipeItem *main_multi_media_time_item_new(RedChannelClient *rcc,
diff --git a/server/main-channel.c b/server/main-channel.c
index f88eabee..186451f2 100644
--- a/server/main-channel.c
+++ b/server/main-channel.c
@@ -145,7 +145,7 @@ static bool main_channel_handle_migrate_data(RedChannelClient *rcc,
                                     size);
 }
 
-void main_channel_push_multi_media_time(MainChannel *main_chan, int time)
+void main_channel_push_multi_media_time(MainChannel *main_chan, uint32_t time)
 {
     MainMultiMediaTimeItemInfo info = {
         .time = time,
diff --git a/server/main-channel.h b/server/main-channel.h
index 833957dd..eb3bcec3 100644
--- a/server/main-channel.h
+++ b/server/main-channel.h
@@ -65,7 +65,7 @@ void main_channel_push_mouse_mode(MainChannel *main_chan, SpiceMouseMode current
                                   int is_client_mouse_allowed);
 void main_channel_push_agent_connected(MainChannel *main_chan);
 void main_channel_push_agent_disconnected(MainChannel *main_chan);
-void main_channel_push_multi_media_time(MainChannel *main_chan, int time);
+void main_channel_push_multi_media_time(MainChannel *main_chan, uint32_t time);
 
 int main_channel_is_connected(MainChannel *main_chan);
 
-- 
2.13.5



More information about the Spice-devel mailing list