fix build on x86 with gcc4 (from gentoo via freebsd)

This commit is contained in:
espie 2010-05-20 10:58:08 +00:00
parent fd0e92b339
commit a6bf3dc5ff
9 changed files with 160 additions and 29 deletions

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-WINGs_array_c,v 1.1 2007/04/25 11:32:30 wilfried Exp $
$OpenBSD: patch-WINGs_array_c,v 1.2 2010/05/20 10:58:08 espie Exp $
--- WINGs/array.c.orig Tue Oct 12 20:28:08 2004
+++ WINGs/array.c Wed Mar 14 21:16:40 2007
@@ -230,6 +230,8 @@ WMGetFromArray(WMArray *array, int index
+++ WINGs/array.c Thu May 20 12:50:56 2010
@@ -230,6 +230,8 @@ WMGetFromArray(WMArray *array, int index)
void*
WMPopFromArray(WMArray *array)
{

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-WINGs_wapplication_c,v 1.3 2005/11/01 17:28:34 wilfried Exp $
$OpenBSD: patch-WINGs_wapplication_c,v 1.4 2010/05/20 10:58:08 espie Exp $
--- WINGs/wapplication.c.orig Sun Oct 24 05:13:29 2004
+++ WINGs/wapplication.c Mon Oct 31 18:54:57 2005
@@ -175,7 +175,7 @@ WMPathForResourceOfType(char *resource,
+++ WINGs/wapplication.c Thu May 20 12:50:56 2010
@@ -175,7 +175,7 @@ WMPathForResourceOfType(char *resource, char *ext)
}
}

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-WINGs_wwindow_c,v 1.2 2005/12/27 23:12:24 naddy Exp $
$OpenBSD: patch-WINGs_wwindow_c,v 1.3 2010/05/20 10:58:08 espie Exp $
--- WINGs/wwindow.c.orig Sun Oct 24 04:58:20 2004
+++ WINGs/wwindow.c Tue Dec 27 22:18:30 2005
+++ WINGs/wwindow.c Thu May 20 12:50:56 2010
@@ -254,14 +254,14 @@ static void
setMiniwindow(WMWindow *win, RImage *image)
{
@ -18,7 +18,7 @@ $OpenBSD: patch-WINGs_wwindow_c,v 1.2 2005/12/27 23:12:24 naddy Exp $
o= 0;
data[o++] = image->width;
@@ -269,7 +269,7 @@ setMiniwindow(WMWindow *win, RImage *ima
@@ -269,7 +269,7 @@ setMiniwindow(WMWindow *win, RImage *image)
for (y= 0; y < image->height; y++) {
for (x= 0; x < image->width; x++) {

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-WindowMaker_Makefile_in,v 1.5 2005/11/01 17:28:34 wilfried Exp $
$OpenBSD: patch-WindowMaker_Makefile_in,v 1.6 2010/05/20 10:58:08 espie Exp $
--- WindowMaker/Makefile.in.orig Sun Jun 19 05:23:01 2005
+++ WindowMaker/Makefile.in Mon Oct 31 18:58:06 2005
@@ -116,7 +116,7 @@ SUBDIRS = Backgrounds Defaults IconSets
+++ WindowMaker/Makefile.in Thu May 20 12:50:56 2010
@@ -116,7 +116,7 @@ SUBDIRS = Backgrounds Defaults IconSets Icons Pixmaps
prefsdatadir = $(pkgdatadir)

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-src_dock_c,v 1.1 2007/04/25 11:33:21 wilfried Exp $
$OpenBSD: patch-src_dock_c,v 1.2 2010/05/20 10:58:08 espie Exp $
--- src/dock.c.orig Sat Oct 23 05:10:40 2004
+++ src/dock.c Wed Mar 14 21:17:01 2007
@@ -2977,7 +2977,7 @@ execCommand(WAppIcon *btn, char *command
+++ src/dock.c Thu May 20 12:50:56 2010
@@ -2977,7 +2977,7 @@ execCommand(WAppIcon *btn, char *command, WSavedState
wtokensplit(cmdline, &argv, &argc);

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-src_main_c,v 1.1 2007/04/25 11:34:47 wilfried Exp $
$OpenBSD: patch-src_main_c,v 1.2 2010/05/20 10:58:08 espie Exp $
--- src/main.c.orig Mon Oct 25 03:32:51 2004
+++ src/main.c Wed Mar 14 22:50:36 2007
@@ -331,6 +331,7 @@ ExecuteShellCommand(WScreen *scr, char *
+++ src/main.c Thu May 20 12:50:56 2010
@@ -331,6 +331,7 @@ ExecuteShellCommand(WScreen *scr, char *command)
* forked by wmaker.
*---------------------------------------------------------------------------
*/

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-src_session_c,v 1.1 2007/04/25 11:34:00 wilfried Exp $
$OpenBSD: patch-src_session_c,v 1.2 2010/05/20 10:58:08 espie Exp $
--- src/session.c.orig Fri Mar 11 22:35:38 2005
+++ src/session.c Wed Mar 14 21:17:06 2007
@@ -381,7 +381,7 @@ execCommand(WScreen *scr, char *command,
+++ src/session.c Thu May 20 12:50:56 2010
@@ -381,7 +381,7 @@ execCommand(WScreen *scr, char *command, char *host)
wtokensplit(command, &argv, &argc);

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-src_wmspec_c,v 1.2 2005/12/27 23:12:24 naddy Exp $
$OpenBSD: patch-src_wmspec_c,v 1.3 2010/05/20 10:58:08 espie Exp $
--- src/wmspec.c.orig Sun May 15 18:41:09 2005
+++ src/wmspec.c Tue Dec 27 22:18:30 2005
+++ src/wmspec.c Thu May 20 12:50:56 2010
@@ -322,14 +322,14 @@ setSupportedHints(WScreen *scr)
void
wNETWMUpdateDesktop(WScreen *scr)
@ -18,7 +18,7 @@ $OpenBSD: patch-src_wmspec_c,v 1.2 2005/12/27 23:12:24 naddy Exp $
/*memset(views, 0, sizeof(CARD32) * count);*/
#ifdef VIRTUAL_DESKTOP
@@ -487,7 +487,7 @@ updateIconImage(WScreen *scr, WWindow *w
@@ -487,7 +487,7 @@ updateIconImage(WScreen *scr, WWindow *wwin)
static void
updateShowDesktop(WScreen * scr, Bool show)
{
@ -27,7 +27,7 @@ $OpenBSD: patch-src_wmspec_c,v 1.2 2005/12/27 23:12:24 naddy Exp $
foo = (show == True);
XChangeProperty(dpy, scr->root_win, net_showing_desktop, XA_CARDINAL, 32,
@@ -660,7 +660,7 @@ wNETWMUpdateActions(WWindow *wwin, Bool
@@ -660,7 +660,7 @@ wNETWMUpdateActions(WWindow *wwin, Bool del)
void
wNETWMUpdateWorkarea(WScreen *scr, WArea usableArea)
{
@ -36,7 +36,7 @@ $OpenBSD: patch-src_wmspec_c,v 1.2 2005/12/27 23:12:24 naddy Exp $
int count, i;
/* XXX: not Xinerama compatible,
@@ -670,7 +670,7 @@ wNETWMUpdateWorkarea(WScreen *scr, WArea
@@ -670,7 +670,7 @@ wNETWMUpdateWorkarea(WScreen *scr, WArea usableArea)
return;
count = scr->workspace_count * 4;
@ -45,7 +45,7 @@ $OpenBSD: patch-src_wmspec_c,v 1.2 2005/12/27 23:12:24 naddy Exp $
for (i=0; i<scr->workspace_count; i++) {
area[4*i + 0] = usableArea.x1;
area[4*i + 1] = usableArea.y1;
@@ -793,7 +793,7 @@ updateClientListStacking(WScreen *scr, W
@@ -793,7 +793,7 @@ updateClientListStacking(WScreen *scr, WWindow *wwin_e
static void
updateWorkspaceCount(WScreen *scr) /* changeable */
{
@ -54,7 +54,7 @@ $OpenBSD: patch-src_wmspec_c,v 1.2 2005/12/27 23:12:24 naddy Exp $
count = scr->workspace_count;
@@ -805,7 +805,7 @@ updateWorkspaceCount(WScreen *scr) /* ch
@@ -805,7 +805,7 @@ updateWorkspaceCount(WScreen *scr) /* changeable */
static void
updateCurrentWorkspace(WScreen *scr) /* changeable */
{
@ -63,7 +63,7 @@ $OpenBSD: patch-src_wmspec_c,v 1.2 2005/12/27 23:12:24 naddy Exp $
count = scr->current_workspace;
@@ -852,7 +852,7 @@ updateFocusHint(WScreen *scr, WWindow *w
@@ -852,7 +852,7 @@ updateFocusHint(WScreen *scr, WWindow *wwin) /* change
static void
updateWorkspaceHint(WWindow *wwin, Bool fake, Bool del)
{

View File

@ -0,0 +1,131 @@
$OpenBSD: patch-wrlib_x86_specific_c,v 1.1 2010/05/20 10:58:08 espie Exp $
--- wrlib/x86_specific.c.orig Sun Oct 31 02:44:01 2004
+++ wrlib/x86_specific.c Thu May 20 12:50:56 2010
@@ -98,15 +98,23 @@ x86_mmx_TrueColor_32_to_16(unsigned char *image,
int height,
int line_offset)
{
- long long rrggbbaa;
- long long pixel;
+ union {
+ long long rrggbbaa;
+ struct {short int rr, gg, bb, aa;} words;
+ } rrggbbaa;
+
+ union {
+ long long pixel;
+ struct {short int rr, gg, bb, aa;} words;
+ } pixel;
+
short *tmp_err;
short *tmp_nerr;
int x;
asm volatile
(
- "pushal \n\t"
+ "pushl %%ebx \n\t"
// pack dr, dg and db into mm6
"movl %7, %%eax \n\t"
@@ -290,7 +298,7 @@ x86_mmx_TrueColor_32_to_16(unsigned char *image,
".Enda: \n\t" // THE END
"emms \n\t"
- "popal \n\t"
+ "popl %%ebx \n\t"
:
:
"m" (image), // %0
@@ -309,17 +317,18 @@ x86_mmx_TrueColor_32_to_16(unsigned char *image,
"m" (width), // %13
"m" (height), // %14
"m" (line_offset), // %15
- "m" (rrggbbaa), // %16 (access to rr)
- "m" ((*((short*)(&rrggbbaa)+1))), // %17 (access to gg)
- "m" ((*((short*)(&rrggbbaa)+2))), // %18 (access to bb)
- "m" ((*((short*)(&rrggbbaa)+3))), // %19 (access to aa)
- "m" (pixel), // %20 (access to pixel.r)
- "m" ((*((short*)(&pixel)+1))), // %21 (access to pixel.g)
- "m" ((*((short*)(&pixel)+2))), // %22 (access to pixel.b)
- "m" ((*((short*)(&pixel)+3))), // %23 (access to pixel.a)
+ "m" (rrggbbaa.rrggbbaa), // %16 (access to rr)
+ "m" (rrggbbaa.words.gg), // %17 (access to gg)
+ "m" (rrggbbaa.words.bb), // %18 (access to bb)
+ "m" (rrggbbaa.words.aa), // %19 (access to aa)
+ "m" (pixel.pixel), // %20 (access to pixel.r)
+ "m" (pixel.words.gg), // %21 (access to pixel.g)
+ "m" (pixel.words.bb), // %22 (access to pixel.b)
+ "m" (pixel.words.aa), // %23 (access to pixel.a)
"m" (tmp_err), // %24
"m" (tmp_nerr), // %25
"m" (x) // %26
+ : "eax", "ecx", "edx", "esi", "edi"
);
}
@@ -342,8 +351,15 @@ x86_mmx_TrueColor_24_to_16(unsigned char *image,
int height,
int line_offset)
{
- long long rrggbbaa;
- long long pixel;
+ union {
+ long long rrggbbaa;
+ struct {short int rr, gg, bb, aa;} words;
+ } rrggbbaa;
+
+ union {
+ long long pixel;
+ struct {short int rr, gg, bb, aa;} words;
+ } pixel;
short *tmp_err;
short *tmp_nerr;
@@ -354,7 +370,7 @@ x86_mmx_TrueColor_24_to_16(unsigned char *image,
asm volatile
(
- "pushal \n\t"
+ "pushl %%ebx \n\t"
"movl %13, %%eax \n\t" // eax = width
"movl %%eax, %%ebx \n\t"
@@ -424,7 +440,7 @@ x86_mmx_TrueColor_24_to_16(unsigned char *image,
".Endc: \n\t" // THE END
"emms \n\t"
- "popal \n\t"
+ "popl %%ebx \n\t"
:
:
"m" (image), // %0
@@ -443,19 +459,20 @@ x86_mmx_TrueColor_24_to_16(unsigned char *image,
"m" (width), // %13
"m" (height), // %14
"m" (line_offset), // %15
- "m" (rrggbbaa), // %16 (access to rr)
- "m" ((*((short*)(&rrggbbaa)+1))), // %17 (access to gg)
- "m" ((*((short*)(&rrggbbaa)+2))), // %18 (access to bb)
- "m" ((*((short*)(&rrggbbaa)+3))), // %19 (access to aa)
- "m" (pixel), // %20 (access to pixel.r)
- "m" ((*((short*)(&pixel)+1))), // %21 (access to pixel.g)
- "m" ((*((short*)(&pixel)+2))), // %22 (access to pixel.b)
- "m" ((*((short*)(&pixel)+3))), // %23 (access to pixel.a)
+ "m" (rrggbbaa.rrggbbaa), // %16 (access to rr)
+ "m" (rrggbbaa.words.gg), // %17 (access to gg)
+ "m" (rrggbbaa.words.bb), // %18 (access to bb)
+ "m" (rrggbbaa.words.aa), // %19 (access to aa)
+ "m" (pixel.pixel), // %20 (access to pixel.r)
+ "m" (pixel.words.gg), // %21 (access to pixel.g)
+ "m" (pixel.words.bb), // %22 (access to pixel.b)
+ "m" (pixel.words.aa), // %23 (access to pixel.a)
"m" (tmp_err), // %24
"m" (tmp_nerr), // %25
"m" (x), // %26
"m" (w1), // %27
"m" (w2) // %28
+ : "eax", "ecx", "edx", "esi", "edi"
);
}