Module Name:    xsrc
Committed By:   tsutsui
Date:           Thu Jul 23 18:14:36 UTC 2020

Modified Files:
        xsrc/external/mit/xorg-server/dist/hw/sun: sunCfb.c

Log Message:
Use proper ANSI offsetof(3) to specify framebuffer offset in struct.

Fixes build error on sparc64.  No binary change on sun3.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 xsrc/external/mit/xorg-server/dist/hw/sun/sunCfb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/external/mit/xorg-server/dist/hw/sun/sunCfb.c
diff -u xsrc/external/mit/xorg-server/dist/hw/sun/sunCfb.c:1.1 xsrc/external/mit/xorg-server/dist/hw/sun/sunCfb.c:1.2
--- xsrc/external/mit/xorg-server/dist/hw/sun/sunCfb.c:1.1	Wed Jul 22 20:38:29 2020
+++ xsrc/external/mit/xorg-server/dist/hw/sun/sunCfb.c	Thu Jul 23 18:14:36 2020
@@ -418,7 +418,7 @@ sunCG2Init(
 	ret = sunInitCommon (screen, pScreen, (off_t) 0,
 			sunCfbScreenInit, CG2ScreenInit,
 			fbCreateDefColormap, CG2SaveScreen,
-			(int) &((struct cg2memfb *) 0)->pixplane);
+			offsetof(struct cg2memfb, pixplane));
 	((CG2Ptr) sunFbs[screen].fb)->regs.ppmask.reg = 0xFF;
 #ifndef LOWMEMFTPT
     }
@@ -436,7 +436,7 @@ typedef struct {
     u_char mpixel[CG4_MELEN];		/* bit-per-pixel memory */
     u_char epixel[CG4_MELEN];		/* enable plane */
     u_char cpixel[CG4_HEIGHT][CG4_WIDTH];	/* byte-per-pixel memory */
-} *CG4Ptr;
+} *CG4Ptr, CG4Rec;
 
 static void
 CG4Switch(ScreenPtr pScreen, int select)
@@ -462,7 +462,7 @@ sunCG4Init(
 	sunFbs[screen].EnterLeave = CG4Switch;
     return sunInitCommon (screen, pScreen, (off_t) 0,
 	sunCfbScreenInit, CGScreenInit,
-	fbCreateDefColormap, sunSaveScreen, (int) ((CG4Ptr) 0)->cpixel);
+	fbCreateDefColormap, sunSaveScreen, offsetof(CG4Rec, cpixel));
 }
 
 #ifdef FBTYPE_SUNFAST_COLOR /* { */

Reply via email to