diff --git a/jdk/src/windows/native/sun/windows/awt.h b/jdk/src/windows/native/sun/windows/awt.h index 5ce4d22a3aa..83c3fcbeb8f 100644 --- a/jdk/src/windows/native/sun/windows/awt.h +++ b/jdk/src/windows/native/sun/windows/awt.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2014, 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 @@ -47,6 +47,8 @@ extern COLORREF DesktopColor2RGB(int colorIndex); class AwtObject; typedef AwtObject* PDATA; +#define JNI_IS_TRUE(obj) ((obj) ? JNI_TRUE : JNI_FALSE) + #define JNI_CHECK_NULL_GOTO(obj, msg, where) { \ if (obj == NULL) { \ env->ExceptionClear(); \ diff --git a/jdk/src/windows/native/sun/windows/awt_Component.cpp b/jdk/src/windows/native/sun/windows/awt_Component.cpp index 88d091807a0..24240beef05 100644 --- a/jdk/src/windows/native/sun/windows/awt_Component.cpp +++ b/jdk/src/windows/native/sun/windows/awt_Component.cpp @@ -6112,7 +6112,7 @@ jboolean AwtComponent::_NativeHandlesWheelScrolling(void *param) c = (AwtComponent *)pData; if (::IsWindow(c->GetHWnd())) { - result = (jboolean)c->InheritsNativeMouseWheelBehavior(); + result = JNI_IS_TRUE(c->InheritsNativeMouseWheelBehavior()); } ret: env->DeleteGlobalRef(self); @@ -6928,9 +6928,9 @@ Java_sun_awt_windows_WComponentPeer_nativeHandlesWheelScrolling (JNIEnv* env, { TRY; - return (jboolean)AwtToolkit::GetInstance().SyncCall( + return JNI_IS_TRUE(AwtToolkit::GetInstance().SyncCall( (void *(*)(void *))AwtComponent::_NativeHandlesWheelScrolling, - env->NewGlobalRef(self)); + env->NewGlobalRef(self))); // global ref is deleted in _NativeHandlesWheelScrolling CATCH_BAD_ALLOC_RET(NULL); @@ -6949,9 +6949,9 @@ Java_sun_awt_windows_WComponentPeer_isObscured(JNIEnv* env, jobject selfGlobalRef = env->NewGlobalRef(self); - return (jboolean)AwtToolkit::GetInstance().SyncCall( + return JNI_IS_TRUE(AwtToolkit::GetInstance().SyncCall( (void*(*)(void*))AwtComponent::_IsObscured, - (void *)selfGlobalRef); + (void *)selfGlobalRef)); // selfGlobalRef is deleted in _IsObscured CATCH_BAD_ALLOC_RET(NULL);