Huw Davies : winemac: Use ULongToPtr() to cast format ids to void ptrs.

Alexandre Julliard julliard at winehq.org
Mon Apr 25 16:30:33 CDT 2022


Module: wine
Branch: master
Commit: fb0af5d9adae3ce751fc680d7bf47b53f94c207e
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=fb0af5d9adae3ce751fc680d7bf47b53f94c207e

Author: Huw Davies <huw at codeweavers.com>
Date:   Mon Apr 25 14:17:02 2022 +0100

winemac: Use ULongToPtr() to cast format ids to void ptrs.

This avoids compiler warnings on 64-bit.

Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winemac.drv/clipboard.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/dlls/winemac.drv/clipboard.c b/dlls/winemac.drv/clipboard.c
index 70b087846e9..63c8bc76e75 100644
--- a/dlls/winemac.drv/clipboard.c
+++ b/dlls/winemac.drv/clipboard.c
@@ -1514,7 +1514,7 @@ static WINE_CLIPFORMAT** get_formats_for_pasteboard_types(CFArrayRef types, UINT
         if (!format->synthesized)
         {
             TRACE("for type %s got format %p/%s\n", debugstr_cf(type), format, debugstr_format(format->format_id));
-            CFSetAddValue(seen_formats, (void*)format->format_id);
+            CFSetAddValue(seen_formats, ULongToPtr(format->format_id));
             formats[pos++] = format;
         }
         else if (format->natural_format &&
@@ -1523,7 +1523,7 @@ static WINE_CLIPFORMAT** get_formats_for_pasteboard_types(CFArrayRef types, UINT
             TRACE("for type %s deferring synthesized formats because type %s is also present\n",
                   debugstr_cf(type), debugstr_cf(format->natural_format->type));
         }
-        else if (CFSetContainsValue(seen_formats, (void*)format->format_id))
+        else if (CFSetContainsValue(seen_formats, ULongToPtr(format->format_id)))
         {
             TRACE("for type %s got duplicate synthesized format %p/%s; skipping\n", debugstr_cf(type), format,
                   debugstr_format(format->format_id));
@@ -1531,7 +1531,7 @@ static WINE_CLIPFORMAT** get_formats_for_pasteboard_types(CFArrayRef types, UINT
         else
         {
             TRACE("for type %s got synthesized format %p/%s\n", debugstr_cf(type), format, debugstr_format(format->format_id));
-            CFSetAddValue(seen_formats, (void*)format->format_id);
+            CFSetAddValue(seen_formats, ULongToPtr(format->format_id));
             formats[pos++] = format;
         }
     }
@@ -1546,10 +1546,10 @@ static WINE_CLIPFORMAT** get_formats_for_pasteboard_types(CFArrayRef types, UINT
         if (!format->synthesized) continue;
 
         /* Don't duplicate a real value with a synthesized value. */
-        if (CFSetContainsValue(seen_formats, (void*)format->format_id)) continue;
+        if (CFSetContainsValue(seen_formats, ULongToPtr(format->format_id))) continue;
 
         TRACE("for type %s got synthesized format %p/%s\n", debugstr_cf(type), format, debugstr_format(format->format_id));
-        CFSetAddValue(seen_formats, (void*)format->format_id);
+        CFSetAddValue(seen_formats, ULongToPtr(format->format_id));
         formats[pos++] = format;
     }
 




More information about the wine-cvs mailing list