8198895: Compilation errors in java.desktop with VS 2017

Reviewed-by: prr
This commit is contained in:
Sergey Bylokhov 2018-03-19 14:16:23 -07:00
parent 89776a373c
commit 78121145bd
7 changed files with 19 additions and 19 deletions

View File

@ -219,7 +219,7 @@ JNIEXPORT void JNICALL Java_sun_font_StrikeCache_freeIntPointer
* accelerated glyph cache cells as we do in freeInt/LongMemory().
*/
if (ptr != 0) {
free((void*)ptr);
free((void*)((intptr_t)ptr));
}
}
@ -257,13 +257,13 @@ JNIEXPORT void JNICALL Java_sun_font_StrikeCache_freeIntMemory
if (ptrs) {
for (i=0; i< len; i++) {
if (ptrs[i] != 0) {
GlyphInfo *ginfo = (GlyphInfo *)ptrs[i];
GlyphInfo *ginfo = (GlyphInfo *)((intptr_t)ptrs[i]);
if (ginfo->cellInfo != NULL &&
ginfo->managed == MANAGED_GLYPH) {
// invalidate this glyph's accelerated cache cell
AccelGlyphCache_RemoveAllCellInfos(ginfo);
}
free((void*)ginfo);
free(ginfo);
}
}
(*env)->ReleasePrimitiveArrayCritical(env, jmemArray, ptrs, JNI_ABORT);

View File

@ -7127,9 +7127,9 @@ Java_sun_awt_windows_WComponentPeer_nativeHandlesWheelScrolling (JNIEnv* env,
{
TRY;
return (jboolean)AwtToolkit::GetInstance().SyncCall(
return (jboolean)((intptr_t)AwtToolkit::GetInstance().SyncCall(
(void *(*)(void *))AwtComponent::_NativeHandlesWheelScrolling,
env->NewGlobalRef(self));
env->NewGlobalRef(self)));
// global ref is deleted in _NativeHandlesWheelScrolling
CATCH_BAD_ALLOC_RET(NULL);
@ -7148,9 +7148,9 @@ Java_sun_awt_windows_WComponentPeer_isObscured(JNIEnv* env,
jobject selfGlobalRef = env->NewGlobalRef(self);
return (jboolean)AwtToolkit::GetInstance().SyncCall(
return (jboolean)((intptr_t)AwtToolkit::GetInstance().SyncCall(
(void*(*)(void*))AwtComponent::_IsObscured,
(void *)selfGlobalRef);
(void *)selfGlobalRef));
// selfGlobalRef is deleted in _IsObscured
CATCH_BAD_ALLOC_RET(NULL);

View File

@ -92,7 +92,7 @@ JNIEXPORT jstring JNICALL Java_sun_awt_windows_WDesktopPeer_ShellExecute
JNU_ReleaseStringPlatformChars(env, fileOrUri_j, fileOrUri_c);
JNU_ReleaseStringPlatformChars(env, verb_j, verb_c);
if ((int)retval <= 32) {
if ((int)((intptr_t)retval) <= 32) {
// ShellExecute failed.
LPTSTR buffer = NULL;
int len = ::FormatMessage(

View File

@ -1607,7 +1607,7 @@ void AwtFrame::_NotifyModalBlocked(void *param)
DWORD fThread = ::GetWindowThreadProcessId(fHWnd, NULL);
if (fThread != AwtToolkit::GetInstance().MainThread()) {
// check if this thread has been already blocked
BlockedThreadStruct *blockedThread = (BlockedThreadStruct *)sm_BlockedThreads.get((void *)fThread);
BlockedThreadStruct *blockedThread = (BlockedThreadStruct *)sm_BlockedThreads.get((void *)((intptr_t)fThread));
if (blocked) {
if (blockedThread == NULL) {
blockedThread = new BlockedThreadStruct;
@ -1616,7 +1616,7 @@ void AwtFrame::_NotifyModalBlocked(void *param)
0, fThread);
blockedThread->mouseHook = ::SetWindowsHookEx(WH_MOUSE, (HOOKPROC)AwtDialog::MouseHookProc_NonTT,
0, fThread);
sm_BlockedThreads.put((void *)fThread, blockedThread);
sm_BlockedThreads.put((void *)((intptr_t)fThread), blockedThread);
} else {
blockedThread->framesCount++;
}
@ -1628,7 +1628,7 @@ void AwtFrame::_NotifyModalBlocked(void *param)
if ((blockedThread->framesCount) == 1) {
::UnhookWindowsHookEx(blockedThread->modalHook);
::UnhookWindowsHookEx(blockedThread->mouseHook);
sm_BlockedThreads.remove((void *)fThread);
sm_BlockedThreads.remove((void *)((intptr_t)fThread));
delete blockedThread;
} else {
blockedThread->framesCount--;

View File

@ -823,9 +823,9 @@ Java_sun_awt_windows_WListPeer_getMaxWidth(JNIEnv *env, jobject self)
jobject selfGlobalRef = env->NewGlobalRef(self);
return (jint)AwtToolkit::GetInstance().SyncCall(
return (jint)((intptr_t)AwtToolkit::GetInstance().SyncCall(
(void *(*)(void *))AwtList::_GetMaxWidth,
(void *)selfGlobalRef);
(void *)selfGlobalRef));
// selfGlobalRef is deleted in _GetMaxWidth
CATCH_BAD_ALLOC_RET(0);
@ -1011,8 +1011,8 @@ Java_sun_awt_windows_WListPeer_isSelected(JNIEnv *env, jobject self,
ses->list = env->NewGlobalRef(self);
ses->index = index;
return (jboolean)AwtToolkit::GetInstance().SyncCall(
(void *(*)(void *))AwtList::_IsSelected, ses);
return (jboolean)((intptr_t)AwtToolkit::GetInstance().SyncCall(
(void *(*)(void *))AwtList::_IsSelected, ses));
// global ref and ses are deleted in _IsSelected
CATCH_BAD_ALLOC_RET(FALSE);

View File

@ -1106,7 +1106,7 @@ LRESULT CALLBACK AwtToolkit::WndProc(HWND hWnd, UINT message,
if (comp != NULL)
{
comp->SetInputMethod(self, useNativeCompWindow);
comp->ImmAssociateContext((HIMC)context);
comp->ImmAssociateContext((HIMC)((intptr_t)context));
}
if (peer != NULL) {
@ -3139,7 +3139,7 @@ void AwtToolkit::ShowTouchKeyboard() {
(m_touchKbrdExeFilePath != NULL)) {
HINSTANCE retVal = ::ShellExecute(NULL, _T("open"),
m_touchKbrdExeFilePath, NULL, NULL, SW_SHOW);
if ((int)retVal <= 32) {
if ((int)((intptr_t)retVal) <= 32) {
DTRACE_PRINTLN1("AwtToolkit::ShowTouchKeyboard: Failed"
", retVal='%d'", (int)retVal);
}

View File

@ -3915,8 +3915,8 @@ JNIEXPORT jboolean JNICALL Java_sun_awt_windows_WWindowPeer_requestWindowFocus
rfs->component = selfGlobalRef;
rfs->isMouseEventCause = isMouseEventCause;
return (jboolean)AwtToolkit::GetInstance().SyncCall(
(void*(*)(void*))AwtWindow::_RequestWindowFocus, rfs);
return (jboolean)((intptr_t)AwtToolkit::GetInstance().SyncCall(
(void*(*)(void*))AwtWindow::_RequestWindowFocus, rfs));
// global refs and rfs are deleted in _RequestWindowFocus
CATCH_BAD_ALLOC_RET(JNI_FALSE);