Skip to content

Commit

Permalink
Fix the build with Clang 11
Browse files Browse the repository at this point in the history
* Xsynchronize returns a pointer, so use jlong rather than jint in the
  wrapper prototype

Authored by: dim@FreeBSD.org
  • Loading branch information
battleblow committed Oct 13, 2020
1 parent 11c638e commit 0874ad9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/java.desktop/unix/classes/sun/awt/X11/XlibWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ static native void XChangeActivePointerGrab(long display, int mask,
display Specifies the connection to the X server.
onoff Specifies a Boolean value that indicates whether to enable or disable synchronization.
*/
static native int XSynchronize(long display, boolean onoff);
static native long XSynchronize(long display, boolean onoff);

/**
* Extracts an X event that can be processed in a secondary loop.
Expand Down
4 changes: 2 additions & 2 deletions src/java.desktop/unix/native/libawt_xawt/xawt/XlibWrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -2180,10 +2180,10 @@ Java_sun_awt_X11_XlibWrapper_copyLongArray(JNIEnv *env,
}
}

JNIEXPORT jint JNICALL
JNIEXPORT jlong JNICALL
Java_sun_awt_X11_XlibWrapper_XSynchronize(JNIEnv *env, jclass clazz, jlong display, jboolean onoff)
{
return (jint) XSynchronize((Display*)jlong_to_ptr(display), (onoff == JNI_TRUE ? True : False));
return ptr_to_jlong(XSynchronize((Display*)jlong_to_ptr(display), (onoff == JNI_TRUE ? True : False)));
}

JNIEXPORT jboolean JNICALL
Expand Down

0 comments on commit 0874ad9

Please sign in to comment.