--- old/src/java.desktop/unix/native/common/java2d/x11/X11SurfaceData.c 2016-06-23 12:14:25.812348768 +0530 +++ new/src/java.desktop/unix/native/common/java2d/x11/X11SurfaceData.c 2016-06-23 12:14:25.636348768 +0530 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1549,13 +1549,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 */ @@ -1574,7 +1574,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 */ } @@ -1600,7 +1600,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); @@ -1619,7 +1619,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 */ } @@ -1634,7 +1634,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 */ } @@ -1649,7 +1649,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 */ } @@ -1664,6 +1664,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 */ }