af32bd4
From e89edec497bac581ca9b614fb00c25365580f045 Mon Sep 17 00:00:00 2001
af32bd4
From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= <jexposit@redhat.com>
af32bd4
Date: Fri, 19 Jan 2024 13:05:51 +0100
af32bd4
Subject: [PATCH] ephyr: Fix incompatible pointer type build error
af32bd4
MIME-Version: 1.0
af32bd4
Content-Type: text/plain; charset=UTF-8
af32bd4
Content-Transfer-Encoding: 8bit
af32bd4
af32bd4
Fix a compilation error on 32 bits architectures with gcc 14:
af32bd4
af32bd4
  ephyr_glamor_xv.c: In function ‘ephyr_glamor_xv_init’:
af32bd4
  ephyr_glamor_xv.c:154:31: error: assignment to ‘SetPortAttributeFuncPtr’ {aka ‘int (*)(struct _KdScreenInfo *, long unsigned int,  int,  void *)’} from incompatible pointer type ‘int (*)(KdScreenInfo *, Atom,  INT32,  void *)’ {aka ‘int (*)(struct _KdScreenInfo *, long unsigned int,  long int,  void *)’} [-Wincompatible-pointer-types]
af32bd4
    154 |     adaptor->SetPortAttribute = ephyr_glamor_xv_set_port_attribute;
af32bd4
        |                               ^
af32bd4
  ephyr_glamor_xv.c:155:31: error: assignment to ‘GetPortAttributeFuncPtr’ {aka ‘int (*)(struct _KdScreenInfo *, long unsigned int,  int *, void *)’} from incompatible pointer type ‘int (*)(KdScreenInfo *, Atom,  INT32 *, void *)’ {aka ‘int (*)(struct _KdScreenInfo *, long unsigned int,  long int *, void *)’} [-Wincompatible-pointer-types]
af32bd4
    155 |     adaptor->GetPortAttribute = ephyr_glamor_xv_get_port_attribute;
af32bd4
        |                               ^
af32bd4
af32bd4
Build error logs:
af32bd4
https://koji.fedoraproject.org/koji/taskinfo?taskID=111964273
af32bd4
af32bd4
Signed-off-by: José Expósito <jexposit@redhat.com>
af32bd4
---
af32bd4
 hw/kdrive/ephyr/ephyr_glamor_xv.c | 8 ++++----
af32bd4
 1 file changed, 4 insertions(+), 4 deletions(-)
af32bd4
af32bd4
diff --git a/hw/kdrive/ephyr/ephyr_glamor_xv.c b/hw/kdrive/ephyr/ephyr_glamor_xv.c
af32bd4
index 4dd15cf41..b5eae48c8 100644
af32bd4
--- a/hw/kdrive/ephyr/ephyr_glamor_xv.c
af32bd4
+++ b/hw/kdrive/ephyr/ephyr_glamor_xv.c
af32bd4
@@ -50,16 +50,16 @@ ephyr_glamor_xv_stop_video(KdScreenInfo *screen, void *data, Bool cleanup)
af32bd4
 
af32bd4
 static int
af32bd4
 ephyr_glamor_xv_set_port_attribute(KdScreenInfo *screen,
af32bd4
-                                   Atom attribute, INT32 value, void *data)
af32bd4
+                                   Atom attribute, int value, void *data)
af32bd4
 {
af32bd4
-    return glamor_xv_set_port_attribute(data, attribute, value);
af32bd4
+    return glamor_xv_set_port_attribute(data, attribute, (INT32)value);
af32bd4
 }
af32bd4
 
af32bd4
 static int
af32bd4
 ephyr_glamor_xv_get_port_attribute(KdScreenInfo *screen,
af32bd4
-                                   Atom attribute, INT32 *value, void *data)
af32bd4
+                                   Atom attribute, int *value, void *data)
af32bd4
 {
af32bd4
-    return glamor_xv_get_port_attribute(data, attribute, value);
af32bd4
+    return glamor_xv_get_port_attribute(data, attribute, (INT32 *)value);
af32bd4
 }
af32bd4
 
af32bd4
 static void
af32bd4
-- 
af32bd4
2.43.0
af32bd4