[Spice-devel,10/18] server/tests/test_display_base: fix two int to pointer cast warnings

Submitted by Yonit Halperin on May 2, 2012, 2:01 p.m.

Details

Message ID 1335967313-24747-10-git-send-email-yhalperi@redhat.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Yonit Halperin May 2, 2012, 2:01 p.m.
From: Alon Levy <alevy@redhat.com>

---
 server/tests/test_display_base.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/server/tests/test_display_base.c b/server/tests/test_display_base.c
index e376195..d060f3f 100644
--- a/server/tests/test_display_base.c
+++ b/server/tests/test_display_base.c
@@ -533,7 +533,7 @@  static void do_wakeup(void *opaque)
 
 static void release_resource(QXLInstance *qin, struct QXLReleaseInfoExt release_info)
 {
-    QXLCommandExt *ext = (unsigned long)release_info.info->id;
+    QXLCommandExt *ext = (QXLCommandExt *)(unsigned long)release_info.info->id;
     //printf("%s\n", __func__);
     ASSERT(release_info.group_id == MEM_SLOT_GROUP_ID);
     switch (ext->cmd.type) {
@@ -544,7 +544,7 @@  static void release_resource(QXLInstance *qin, struct QXLReleaseInfoExt release_
             free(ext);
             break;
         case QXL_CMD_CURSOR: {
-            QXLCursorCmd *cmd = (unsigned long)ext->cmd.data;
+            QXLCursorCmd *cmd = (QXLCursorCmd *)(unsigned long)ext->cmd.data;
             if (cmd->type == QXL_CURSOR_SET) {
                 free(cmd);
             }

Comments

On Wed, May 02, 2012 at 05:01:45PM +0300, Yonit Halperin wrote:
> From: Alon Levy <alevy@redhat.com>

No longer required, superceded by 39565707a9b9b6460ca18c5c9749ae565d583e2a
(minus a missing space but de nada).

> 
> ---
>  server/tests/test_display_base.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/server/tests/test_display_base.c b/server/tests/test_display_base.c
> index e376195..d060f3f 100644
> --- a/server/tests/test_display_base.c
> +++ b/server/tests/test_display_base.c
> @@ -533,7 +533,7 @@ static void do_wakeup(void *opaque)
>  
>  static void release_resource(QXLInstance *qin, struct QXLReleaseInfoExt release_info)
>  {
> -    QXLCommandExt *ext = (unsigned long)release_info.info->id;
> +    QXLCommandExt *ext = (QXLCommandExt *)(unsigned long)release_info.info->id;
>      //printf("%s\n", __func__);
>      ASSERT(release_info.group_id == MEM_SLOT_GROUP_ID);
>      switch (ext->cmd.type) {
> @@ -544,7 +544,7 @@ static void release_resource(QXLInstance *qin, struct QXLReleaseInfoExt release_
>              free(ext);
>              break;
>          case QXL_CMD_CURSOR: {
> -            QXLCursorCmd *cmd = (unsigned long)ext->cmd.data;
> +            QXLCursorCmd *cmd = (QXLCursorCmd *)(unsigned long)ext->cmd.data;
>              if (cmd->type == QXL_CURSOR_SET) {
>                  free(cmd);
>              }
> -- 
> 1.7.7.6
>