--- old/src/java.desktop/unix/native/common/java2d/x11/X11SurfaceData.c 2017-10-13 18:36:20.320559355 -0700 +++ new/src/java.desktop/unix/native/common/java2d/x11/X11SurfaceData.c 2017-10-13 18:36:20.148557685 -0700 @@ -1394,13 +1394,13 @@ J2dTraceLn(J2D_TRACE_INFO, "in X11SurfaceData_XCreateGC"); - xsdo = (X11SDOps *) pXSData; + xsdo = (X11SDOps *) jlong_to_ptr(pXSData); if (xsdo == NULL) { return 0L; } xsdo->javaGC = XCreateGC(awt_display, xsdo->drawable, 0, NULL); - ret = (jlong) xsdo->javaGC; + ret = ptr_to_jlong(xsdo->javaGC); #else /* !HEADLESS */ ret = 0L; #endif /* !HEADLESS */ @@ -1419,7 +1419,7 @@ { #ifndef HEADLESS J2dTraceLn(J2D_TRACE_INFO, "in X11SurfaceData_XResetClip"); - XSetClipMask(awt_display, (GC) xgc, None); + XSetClipMask(awt_display, (GC) jlong_to_ptr(xgc), None); #endif /* !HEADLESS */ } @@ -1445,7 +1445,7 @@ x1, y1, x2, y2, complexclip, &pRect, 256); - XSetClipRectangles(awt_display, (GC) xgc, 0, 0, pRect, numrects, YXBanded); + XSetClipRectangles(awt_display, (GC) jlong_to_ptr(xgc), 0, 0, pRect, numrects, YXBanded); if (pRect != rects) { free(pRect); @@ -1464,7 +1464,7 @@ { #ifndef HEADLESS J2dTraceLn(J2D_TRACE_INFO, "in X11SurfaceData_XSetCopyMode"); - XSetFunction(awt_display, (GC) xgc, GXcopy); + XSetFunction(awt_display, (GC) jlong_to_ptr(xgc), GXcopy); #endif /* !HEADLESS */ } @@ -1479,7 +1479,7 @@ { #ifndef HEADLESS J2dTraceLn(J2D_TRACE_INFO, "in X11SurfaceData_XSetXorMode"); - XSetFunction(awt_display, (GC) xgc, GXxor); + XSetFunction(awt_display, (GC) jlong_to_ptr(xgc), GXxor); #endif /* !HEADLESS */ } @@ -1494,7 +1494,7 @@ { #ifndef HEADLESS J2dTraceLn(J2D_TRACE_INFO, "in X11SurfaceData_XSetForeground"); - XSetForeground(awt_display, (GC) xgc, pixel); + XSetForeground(awt_display, (GC) jlong_to_ptr(xgc), pixel); #endif /* !HEADLESS */ } @@ -1509,6 +1509,6 @@ { #ifndef HEADLESS J2dTraceLn(J2D_TRACE_INFO, "in X11SurfaceData_XSetGraphicsExposures"); - XSetGraphicsExposures(awt_display, (GC) xgc, needExposures ? True : False); + XSetGraphicsExposures(awt_display, (GC) jlong_to_ptr(xgc), needExposures ? True : False); #endif /* !HEADLESS */ }