< prev index next >

src/java.desktop/unix/native/common/java2d/x11/X11SurfaceData.c

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * 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
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -1547,17 +1547,17 @@
 #ifndef HEADLESS
     X11SDOps *xsdo;
 
     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 */
 
     return ret;

@@ -1572,11 +1572,11 @@
 Java_sun_java2d_x11_XSurfaceData_XResetClip
     (JNIEnv *env, jclass xsd, jlong xgc)
 {
 #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 */
 }
 
 /*
  * Class:     sun_java2d_x11_X11SurfaceData

@@ -1598,11 +1598,11 @@
 
     numrects = RegionToYXBandedRectangles(env,
             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);
     }
 #endif /* !HEADLESS */

@@ -1617,11 +1617,11 @@
 Java_sun_java2d_x11_X11SurfaceData_XSetCopyMode
     (JNIEnv *env, jclass xsd, jlong xgc)
 {
 #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 */
 }
 
 /*
  * Class:     sun_java2d_x11_X11SurfaceData

@@ -1632,11 +1632,11 @@
 Java_sun_java2d_x11_X11SurfaceData_XSetXorMode
     (JNIEnv *env, jclass xr, jlong xgc)
 {
 #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 */
 }
 
 /*
  * Class:     sun_java2d_x11_X11SurfaceData

@@ -1647,11 +1647,11 @@
 Java_sun_java2d_x11_X11SurfaceData_XSetForeground
     (JNIEnv *env, jclass xsd, jlong xgc, jint pixel)
 {
 #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 */
 }
 
 /*
  * Class:     sun_java2d_x11_X11SurfaceData

@@ -1662,8 +1662,8 @@
 Java_sun_java2d_x11_XSurfaceData_XSetGraphicsExposures
     (JNIEnv *env, jclass xsd, jlong xgc, jboolean needExposures)
 {
 #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 */
 }
< prev index next >