From 5c2560d47ff79afb96b1304d3995706403bfea35 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 22 May 2006 15:47:46 +0000 Subject: Bug #6924: Restore the ABI for DrawableRec and ColormapRec to the state they were in prior to the fix for #6438. Based on a patch from Andy Ritger. --- ChangeLog | 11 +++++++++++ dix/colormap.c | 9 ++++++++- dix/pixmap.c | 8 ++++++++ dix/window.c | 6 +++++- include/colormapst.h | 17 +++++++++++++++-- include/pixmapstr.h | 11 +++++++++++ 6 files changed, 58 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index d9b0f83d3..e0474b94e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2006-05-22 Adam Jackson + + * dix/colormap.c: + * dix/pixmap.c: + * dix/window.c: + * include/colormapst.h: + * include/pixmapstr.h: + Bug #6924: Restore the ABI for DrawableRec and ColormapRec to + the state they were in prior to the fix for #6438. Based on a + patch from Andy Ritger. + 2006-05-19 Adam Jackson * include/os.h: diff --git a/dix/colormap.c b/dix/colormap.c index 900949c81..a448010ea 100644 --- a/dix/colormap.c +++ b/dix/colormap.c @@ -1,4 +1,4 @@ -/* $XdotOrg: xserver/xorg/dix/colormap.c,v 1.11 2005/09/05 07:40:50 daniels Exp $ */ +/* $XdotOrg: xserver/xorg/dix/colormap.c,v 1.12 2006/02/15 20:44:12 ajax Exp $ */ /* $XFree86: xc/programs/Xserver/dix/colormap.c,v 3.11 2003/11/03 05:10:59 tsi Exp $ */ /*********************************************************** @@ -280,6 +280,13 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual, pmap = (ColormapPtr) xalloc(sizebytes); if (!pmap) return (BadAlloc); +#if defined(_XSERVER64) + pmap->pad0 = 0; + pmap->pad1 = 0; +#if (X_BYTE_ORDER == X_LITTLE_ENDIAN) + pmap->pad2 = 0; +#endif +#endif pmap->red = (EntryPtr)((char *)pmap + sizeof(ColormapRec)); sizebytes = size * sizeof(Entry); pmap->clientPixelsRed = (Pixel **)((char *)pmap->red + sizebytes); diff --git a/dix/pixmap.c b/dix/pixmap.c index 527b0f0b2..1c3d49fc5 100644 --- a/dix/pixmap.c +++ b/dix/pixmap.c @@ -141,5 +141,13 @@ AllocatePixmap(ScreenPtr pScreen, int pixDataSize) #else pPixmap = (PixmapPtr)xalloc(sizeof(PixmapRec) + pixDataSize); #endif + +#ifdef _XSERVER64 + if (pPixmap) { + pPixmap->drawable.pad0 = 0; + pPixmap->drawable.pad1 = 0; + } +#endif + return pPixmap; } diff --git a/dix/window.c b/dix/window.c index f00f63714..9fba5f832 100644 --- a/dix/window.c +++ b/dix/window.c @@ -1,4 +1,4 @@ -/* $XdotOrg: xserver/xorg/dix/window.c,v 1.16 2006/03/29 17:51:54 deronj Exp $ */ +/* $XdotOrg: xserver/xorg/dix/window.c,v 1.17 2006/03/31 17:39:35 sandmann Exp $ */ /* $Xorg: window.c,v 1.4 2001/02/09 02:04:41 xorgcvs Exp $ */ /* @@ -384,6 +384,10 @@ AllocateWindow(ScreenPtr pScreen) else ppriv->ptr = (pointer)NULL; } +#if _XSERVER64 + pWin->drawable.pad0 = 0; + pWin->drawable.pad1 = 0; +#endif } return pWin; } diff --git a/include/colormapst.h b/include/colormapst.h index d2422ea85..fdfc8f397 100644 --- a/include/colormapst.h +++ b/include/colormapst.h @@ -49,6 +49,8 @@ SOFTWARE. #ifndef CMAPSTRUCT_H #define CMAPSTRUCT_H 1 +#include + #include "colormap.h" #include "screenint.h" @@ -89,15 +91,26 @@ typedef struct _CMEntry Bool fShared; } Entry; -/* COLORMAPs can be used for either Direct or Pseudo color. PseudoColor +/* + * COLORMAPs can be used for either Direct or Pseudo color. PseudoColor * only needs one cell table, we arbitrarily pick red. We keep track - * of that table with freeRed, numPixelsRed, and clientPixelsRed */ + * of that table with freeRed, numPixelsRed, and clientPixelsRed + * + * The padN variables are unfortunate ABI BC. See fdo bug #6924. + */ typedef struct _ColormapRec { VisualPtr pVisual; short class; /* PseudoColor or DirectColor */ +#if defined(_XSERVER64) + short pad0; + XID pad1; +#endif XID mid; /* client's name for colormap */ +#if defined(_XSERVER64) && (X_BYTE_ORDER == X_LITTLE_ENDIAN) + XID pad2; +#endif ScreenPtr pScreen; /* screen map is associated with */ short flags; /* 1 = IsDefault * 2 = AllAllocated */ diff --git a/include/pixmapstr.h b/include/pixmapstr.h index 272ce6869..291f2a2e9 100644 --- a/include/pixmapstr.h +++ b/include/pixmapstr.h @@ -49,16 +49,27 @@ SOFTWARE. #ifndef PIXMAPSTRUCT_H #define PIXMAPSTRUCT_H +#include #include "pixmap.h" #include "screenint.h" #include "regionstr.h" +/* + * The padN members are unfortunate ABI BC. See fdo bug #6924. + */ + typedef struct _Drawable { unsigned char type; /* DRAWABLE_ */ unsigned char class; /* specific to type */ unsigned char depth; unsigned char bitsPerPixel; +#if defined(_XSERVER64) + XID pad0; +#endif XID id; /* resource id */ +#if defined(_XSERVER64) + XID pad1; +#endif short x; /* window: screen absolute, pixmap: 0 */ short y; /* window: screen absolute, pixmap: 0 */ unsigned short width; -- cgit v1.2.3