File: 0009_dix-Fix-a-warning-about-GetTimeInMillis-return-value.patch

package info (click to toggle)
nx-libs 2%3A3.5.99.27-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 32,548 kB
  • sloc: ansic: 504,490; cpp: 66,774; makefile: 1,436; sh: 625; perl: 501; asm: 419; python: 208
file content (60 lines) | stat: -rw-r--r-- 2,322 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
From 244a89097e04462f1dd6e449603c0b61168e3d6b Mon Sep 17 00:00:00 2001
From: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
Date: Wed, 15 Jan 2025 22:03:00 +0000
Subject: [PATCH] dix: Fix a warning about GetTimeInMillis return value in
 XFont2.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Ported over from XOrg Server:

    commit e1ccd0fa0e1081edf8a2c69ce6e8e3f67a4aecba
    Author: Emma Anholt <emma@anholt.net>
    Date:   Mon May 7 16:46:15 2018 -0700

        dix: Fix a warning about GetTimeInMillis return value in XFont2.

        Signed-off-by: Eric Anholt <eric@anholt.net>
        Reviewed-by: Adam Jackson <ajax@redhat.com>

This resolves the following issue when built with GCC-14 (and beyond):

    ../../dix/dixfonts.c: At top level:
    ../../dix/dixfonts.c:2485:27: error: initialization of âuint32_t (*)(void)â {aka âunsigned int (*)(void)â} from incompatible pointer type âCARD32 (*)(void)â {aka âlong unsigned int (*)(void)â} [-Wincompatible-pointer-types]
     2485 |     .get_time_in_millis = GetTimeInMillis,
          |

Signed-off-by: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
---
 nx-X11/programs/Xserver/dix/dixfonts.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/nx-X11/programs/Xserver/dix/dixfonts.c b/nx-X11/programs/Xserver/dix/dixfonts.c
index e3e90b163..77f2e551b 100644
--- a/nx-X11/programs/Xserver/dix/dixfonts.c
+++ b/nx-X11/programs/Xserver/dix/dixfonts.c
@@ -2471,6 +2471,11 @@ remove_fs_handlers(FontPathElementPtr fpe, BlockHandlerProcPtr block_handler, Bo
     RemoveFontWakeup(fpe);
 }
 
+static uint32_t wrap_time_in_millis(void)
+{
+    return GetTimeInMillis();
+}
+
 #ifdef HAS_XFONT2
 static const xfont2_client_funcs_rec xfont2_client_funcs = {
     .version = XFONT2_CLIENT_FUNCS_VERSION,
@@ -2482,7 +2487,7 @@ static const xfont2_client_funcs_rec xfont2_client_funcs = {
     .get_client_resolutions = get_client_resolutions,
     .get_default_point_size = get_default_point_size,
     .get_new_font_client_id = get_new_font_client_id,
-    .get_time_in_millis = GetTimeInMillis,
+    .get_time_in_millis = wrap_time_in_millis,
     .init_fs_handlers = _init_fs_handlers,
     .register_fpe_funcs = register_fpe_funcs,
     .remove_fs_handlers = _remove_fs_handlers,
-- 
2.39.5