summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'x11-wm/windowmaker/files/0.91.0/64bit+endian-fixes-0.9x.patch')
-rw-r--r--x11-wm/windowmaker/files/0.91.0/64bit+endian-fixes-0.9x.patch166
1 files changed, 166 insertions, 0 deletions
diff --git a/x11-wm/windowmaker/files/0.91.0/64bit+endian-fixes-0.9x.patch b/x11-wm/windowmaker/files/0.91.0/64bit+endian-fixes-0.9x.patch
new file mode 100644
index 000000000000..c922fc965789
--- /dev/null
+++ b/x11-wm/windowmaker/files/0.91.0/64bit+endian-fixes-0.9x.patch
@@ -0,0 +1,166 @@
+diff -ur WindowMaker-0.91.0/src/wmspec.c WindowMaker-0.91.0-test/src/wmspec.c
+--- WindowMaker-0.91.0/src/wmspec.c 2004-10-24 15:36:15.000000000 -0400
++++ WindowMaker-0.91.0-test/src/wmspec.c 2005-03-13 14:25:18.860008096 -0500
+@@ -27,6 +27,7 @@
+
+ #include <X11/Xlib.h>
+ #include <X11/Xatom.h>
++#include <X11/Xarch.h>
+ #include <string.h>
+
+ #include "WindowMaker.h"
+@@ -314,15 +315,15 @@
+ void
+ wNETWMUpdateDesktop(WScreen *scr)
+ {
+- CARD32 *views, sizes[2];
++ long *views, sizes[2];
+ int count, i;
+
+ if (scr->workspace_count==0)
+ return;
+
+ count = scr->workspace_count * 2;
+- views = wmalloc(sizeof(CARD32) * count);
+- /*memset(views, 0, sizeof(CARD32) * count);*/
++ views = wmalloc(sizeof(long) * count);
++ /*memset(views, 0, sizeof(long) * count);*/
+
+ #ifdef VIRTUAL_DESKTOP
+ sizes[0] = scr->workspaces[scr->current_workspace]->width;
+@@ -362,7 +363,7 @@
+ 0, 1, &count);
+ if (prop)
+ {
+- int desktop= *(CARD32*)prop;
++ int desktop= *(long*)prop;
+ XFree(prop);
+ return desktop;
+ }
+@@ -382,40 +383,54 @@
+ &nitems_return, &bytes_after_return, &prop_return);
+
+ if (rc==Success && prop_return) {
+- unsigned int *data = (unsigned int *)prop_return;
++ unsigned long *data = (unsigned long *)prop_return;
+ unsigned int pos = 0, len = 0;
+ unsigned int best_pos = 0, best_tmp = ~0;
++ unsigned int tmp;
+ extern WPreferences wPreferences;
+ unsigned int pref_size = wPreferences.icon_size;
+ unsigned int pref_sq = pref_size*pref_size;
+- char *src, *dst;
++ unsigned char *src, *dst;
+ RImage *new_rimage;
+
+ do {
+ len = data[pos+0]*data[pos+1];
+- unsigned int tmp = pref_sq-len;
++ tmp = pref_sq-len;
+ if (tmp < best_tmp && tmp > 0) {
+ best_tmp = tmp;
+- best_pos = pos;
++ best_pos = pos+2;
+ }
+ pos += 2+len;
+ } while (pos < nitems_return && len != 0);
+
+- new_rimage = RCreateImage(data[best_pos+0], data[best_pos+1], True);
+- len = data[best_pos+0] * data[best_pos+1];
+- src = (char*)&data[best_pos+2];
+- dst = new_rimage->data;
+- for (pos=0; pos<len; ++pos, src+=4, dst+=4) {
+- dst[0] = src[2]; /* R */
+- dst[1] = src[1]; /* G */
+- dst[2] = src[0]; /* B */
+- dst[3] = src[3]; /* A */
+- }
++ if ( best_pos < 2 ) best_pos = 2;
++
++ new_rimage = RCreateImage(data[best_pos-2], data[best_pos-1], True);
+
+ if (new_rimage) {
+- if (wwin->net_icon_image)
+- RReleaseImage(wwin->net_icon_image);
+- wwin->net_icon_image = new_rimage;
++ len = data[best_pos-2] * data[best_pos-1];
++ dst = new_rimage->data;
++
++ for (pos = best_pos; pos < best_pos + len; pos++, dst += 4) {
++ src = (unsigned char *) &data[pos];
++
++#if BYTE_ORDER == BIG_ENDIAN
++ src += sizeof(unsigned long) - 4;
++ dst[0] = src[1]; /* R */
++ dst[1] = src[2]; /* G */
++ dst[2] = src[3]; /* B */
++ dst[3] = src[0]; /* A */
++#else /* Little endian */
++ dst[0] = src[2]; /* R */
++ dst[1] = src[1]; /* G */
++ dst[2] = src[0]; /* B */
++ dst[3] = src[3]; /* A */
++#endif /* endianness */
++ }
++
++ if (wwin->net_icon_image)
++ RReleaseImage(wwin->net_icon_image);
++ wwin->net_icon_image = new_rimage;
+ }
+
+ XFree(prop_return);
+@@ -426,7 +441,7 @@
+ static void
+ updateShowDesktop(WScreen * scr, Bool show)
+ {
+- CARD32 foo;
++ long foo;
+
+ foo = (show == True);
+ XChangeProperty(dpy, scr->root_win, net_showing_desktop, XA_CARDINAL, 32,
+@@ -599,7 +614,7 @@
+ void
+ wNETWMUpdateWorkarea(WScreen *scr, WArea usableArea)
+ {
+- CARD32 *area;
++ long *area;
+ int count, i;
+
+ /* XXX: not Xinerama compatible,
+@@ -609,7 +624,7 @@
+ return;
+
+ count = scr->workspace_count * 4;
+- area = wmalloc(sizeof(CARD32) * count);
++ area = wmalloc(sizeof(long) * count);
+ for (i=0; i<scr->workspace_count; i++) {
+ area[4*i + 0] = usableArea.x1;
+ area[4*i + 1] = usableArea.y1;
+@@ -732,7 +747,7 @@
+ static void
+ updateWorkspaceCount(WScreen *scr) /* changeable */
+ {
+- CARD32 count;
++ long count;
+
+ count = scr->workspace_count;
+
+@@ -744,7 +759,7 @@
+ static void
+ updateCurrentWorkspace(WScreen *scr) /* changeable */
+ {
+- CARD32 count;
++ long count;
+
+ count = scr->current_workspace;
+
+@@ -791,7 +806,7 @@
+ static void
+ updateWorkspaceHint(WWindow *wwin, Bool fake, Bool del)
+ {
+- CARD32 l;
++ long l;
+
+ if (del) {
+ XDeleteProperty(dpy, wwin->client_win, net_wm_desktop);
+Only in WindowMaker-0.91.0-test/src: wmspec.c.orig