The man page of XChangeProperty() says:

      "If the specified format is 32, the property data must be a
       long array."

    And as we call it with format 32, the type of 'data' must
    be 'long'. It happens to work nowadays in 32-bit architectures
    because sizeof(CARD32) = sizeof(long), but that is no longer
    true in 64-bit mode.

    This patch was downloaded from
    
www.openbsd.org/cgi-bin/cvsweb/ports/x11/windowmaker/patches/patch-WINGs_wwindow_c
    and I thank Alexey I. Frolov and Vladimir Nadvornik for helping me
    to understand it on a wmaker-dev thread.

Transplanted from git://repo.or.cz/wmaker-crm.git
commit c7f2a189c48bd4c9eb87958fff66b52e0fdcb7ce
(transplanted from 9420959defee1a8936a715d6b5b42183eaef2e2c)


 WINGs/wwindow.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)


# HG changeset patch
# User Carlos R. Mafra <[email protected]>
# Date 1253011934 -7200
# Branch wm_0_92
# Node ID 44cfccd32043fdcff739c665e0f1b75780ca8b5b
# Parent  633e562f084948880162f7a4d4c2aa5ae08bcb59
Fix the call to XChangeProperty() in 64-bit mode

    The man page of XChangeProperty() says:

      "If the specified format is 32, the property data must be a
       long array."

    And as we call it with format 32, the type of 'data' must
    be 'long'. It happens to work nowadays in 32-bit architectures
    because sizeof(CARD32) = sizeof(long), but that is no longer
    true in 64-bit mode.

    This patch was downloaded from
    www.openbsd.org/cgi-bin/cvsweb/ports/x11/windowmaker/patches/patch-WINGs_wwindow_c
    and I thank Alexey I. Frolov and Vladimir Nadvornik for helping me
    to understand it on a wmaker-dev thread.

Transplanted from git://repo.or.cz/wmaker-crm.git
commit c7f2a189c48bd4c9eb87958fff66b52e0fdcb7ce
(transplanted from 9420959defee1a8936a715d6b5b42183eaef2e2c)

diff --git a/WINGs/wwindow.c b/WINGs/wwindow.c
--- a/WINGs/wwindow.c
+++ b/WINGs/wwindow.c
@@ -254,14 +254,14 @@
 setMiniwindow(WMWindow *win, RImage *image)
 {
     WMScreen *scr= win->view->screen;
-    CARD32 *data;
+    long *data;
     int x, y;
     int o;
 
     if (!image)
       return;
 
-    data = wmalloc((image->width * image->height + 2) * sizeof(CARD32));
+    data = wmalloc((image->width * image->height + 2) * sizeof(long));
 
     o= 0;
     data[o++] = image->width;
@@ -269,7 +269,7 @@
 
     for (y= 0; y < image->height; y++) {
         for (x= 0; x < image->width; x++) {
-            CARD32 pixel;
+            long pixel;
             int offs= (x+y*image->width);
             
             if (image->format == RRGBFormat)

Reply via email to