1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-20 21:08:08 +01:00

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.
This commit is contained in:
Carlos R. Mafra
2009-09-15 12:52:14 +02:00
parent ca2c1f900d
commit c7f2a189c4

View File

@@ -216,14 +216,14 @@ static void setMiniwindowTitle(WMWindow * win, const char *title)
static void setMiniwindow(WMWindow *win, RImage *image) static void setMiniwindow(WMWindow *win, RImage *image)
{ {
WMScreen *scr = win->view->screen; WMScreen *scr = win->view->screen;
CARD32 *data; long *data;
int x, y; int x, y;
int o; int o;
if (!image) if (!image)
return; return;
data = wmalloc((image->width * image->height + 2) * sizeof(CARD32)); data = wmalloc((image->width * image->height + 2) * sizeof(long));
o = 0; o = 0;
data[o++] = image->width; data[o++] = image->width;
@@ -231,7 +231,7 @@ static void setMiniwindow(WMWindow *win, RImage *image)
for (y = 0; y < image->height; y++) { for (y = 0; y < image->height; y++) {
for (x = 0; x < image->width; x++) { for (x = 0; x < image->width; x++) {
CARD32 pixel; long pixel;
int offs = (x + y * image->width); int offs = (x + y * image->width);
if (image->format == RRGBFormat) if (image->format == RRGBFormat)