[PATCH] winemac: Cast format ids to UINT_PTR before casting to a void ptr.

Huw Davies huw at codeweavers.com
Mon Apr 25 07:46:38 CDT 2022


This avoids compiler warnings on 64-bit.

Signed-off-by: Huw Davies <huw at codeweavers.com>
---
 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..dc117db6b38 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, (void*)(UINT_PTR)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, (void*)(UINT_PTR)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, (void*)(UINT_PTR)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, (void*)(UINT_PTR)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, (void*)(UINT_PTR)format->format_id);
         formats[pos++] = format;
     }
 
-- 
2.23.0




More information about the wine-devel mailing list