diff --git a/.gitattributes b/.gitattributes index 77450626296..409e8b248bd 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,2 @@ -* -text +* -text +* binary diff --git a/jdk/src/share/classes/com/sun/media/sound/WaveFloatFileReader.java b/jdk/src/share/classes/com/sun/media/sound/WaveFloatFileReader.java index 5c816587f34..62eb120f352 100644 --- a/jdk/src/share/classes/com/sun/media/sound/WaveFloatFileReader.java +++ b/jdk/src/share/classes/com/sun/media/sound/WaveFloatFileReader.java @@ -160,12 +160,23 @@ public AudioFileFormat getAudioFileFormat(File file) public AudioInputStream getAudioInputStream(URL url) throws UnsupportedAudioFileException, IOException { - return getAudioInputStream(new BufferedInputStream(url.openStream())); + InputStream stream = url.openStream(); + try { + return getAudioInputStream(new BufferedInputStream(stream)); + } catch (Exception e) { + stream.close(); + throw e; + } } public AudioInputStream getAudioInputStream(File file) throws UnsupportedAudioFileException, IOException { - return getAudioInputStream(new BufferedInputStream(new FileInputStream( - file))); + InputStream stream = new FileInputStream(file); + try { + return getAudioInputStream(new BufferedInputStream(stream)); + } catch (Exception e) { + stream.close(); + throw e; + } } } diff --git a/jdk/src/share/native/java/net/net_util.h b/jdk/src/share/native/java/net/net_util.h index c8a5e68c49f..e422453f256 100644 --- a/jdk/src/share/native/java/net/net_util.h +++ b/jdk/src/share/native/java/net/net_util.h @@ -131,7 +131,7 @@ jfieldID NET_GetFileDescriptorID(JNIEnv *env); JNIEXPORT jint JNICALL ipv6_available() ; -void +JNIEXPORT void JNICALL NET_AllocSockaddr(struct sockaddr **him, int *len); JNIEXPORT int JNICALL diff --git a/jdk/src/solaris/native/sun/xawt/XToolkit.c b/jdk/src/solaris/native/sun/xawt/XToolkit.c index 24557cba416..20e8921837c 100644 --- a/jdk/src/solaris/native/sun/xawt/XToolkit.c +++ b/jdk/src/solaris/native/sun/xawt/XToolkit.c @@ -27,7 +27,7 @@ #include #include #include -#ifdef __linux__ +#if defined __linux__ && !__MUSL__ #include #endif @@ -796,7 +796,7 @@ JNIEXPORT jstring JNICALL Java_sun_awt_X11_XToolkit_getEnv return ret; } -#ifdef __linux__ +#if defined __linux__ && !__MUSL__ void print_stack(void) { void *array[10]; diff --git a/jdk/src/windows/native/sun/java2d/d3d/D3DPipeline.h b/jdk/src/windows/native/sun/java2d/d3d/D3DPipeline.h index 20019851ebf..fcf7f038e8c 100644 --- a/jdk/src/windows/native/sun/java2d/d3d/D3DPipeline.h +++ b/jdk/src/windows/native/sun/java2d/d3d/D3DPipeline.h @@ -67,7 +67,7 @@ #include "Trace.h" #define DebugPrintD3DError(res, msg) \ - J2dTraceLn1(J2D_TRACE_ERROR, "D3D Error: " ## msg ## " res=%d", res) + J2dTraceLn1(J2D_TRACE_ERROR, "D3D Error: " msg " res=%d", res) #endif /*D3D_PPL_DLL*/ @@ -92,9 +92,9 @@ do { \ #define SAFE_PRINTLN(RES) \ do { \ if ((RES)!= NULL) { \ - J2dTraceLn1(J2D_TRACE_VERBOSE, " " ## #RES ## "=0x%x", (RES)); \ + J2dTraceLn1(J2D_TRACE_VERBOSE, " " #RES "=0x%x", (RES)); \ } else { \ - J2dTraceLn(J2D_TRACE_VERBOSE, " " ## #RES ## "=NULL"); \ + J2dTraceLn(J2D_TRACE_VERBOSE, " " #RES "=NULL"); \ } \ } while (0); #else // DEBUG @@ -109,7 +109,7 @@ do { \ #define ACT_IF_NULL(ACTION, value) \ if ((value) == NULL) { \ J2dTraceLn3(J2D_TRACE_ERROR, \ - "%s is null in %s:%d", #value, THIS_FILE, __LINE__); \ + "%s is null in %s:%d", #value, __FILE__, __LINE__); \ ACTION; \ } else do { } while (0) #define RETURN_IF_NULL(value) ACT_IF_NULL(return, value) @@ -119,12 +119,12 @@ do { \ #define RETURN_STATUS_IF_EXP_FAILED(EXPR) \ if (FAILED(res = (EXPR))) { \ - DebugPrintD3DError(res, " " ## #EXPR ## " failed in " ## THIS_FILE); \ + DebugPrintD3DError(res, " " #EXPR " failed in " __FILE__); \ return res; \ } else do { } while (0) #define RETURN_STATUS_IF_FAILED(status) \ if (FAILED((status))) { \ - DebugPrintD3DError((status), " failed in " ## THIS_FILE ## ", return;");\ + DebugPrintD3DError((status), " failed in " __FILE__ ", return;");\ return (status); \ } else do { } while (0) diff --git a/jdk/src/windows/native/sun/nio/fs/WindowsNativeDispatcher.c b/jdk/src/windows/native/sun/nio/fs/WindowsNativeDispatcher.c index 0a18e0b607b..2b52b8148bf 100644 --- a/jdk/src/windows/native/sun/nio/fs/WindowsNativeDispatcher.c +++ b/jdk/src/windows/native/sun/nio/fs/WindowsNativeDispatcher.c @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include "jni.h" #include "jni_util.h" diff --git a/jdk/src/windows/native/sun/security/jgss/sspi_bridge/sspi.cpp b/jdk/src/windows/native/sun/security/jgss/sspi_bridge/sspi.cpp index b1de9934a00..66808655b31 100644 --- a/jdk/src/windows/native/sun/security/jgss/sspi_bridge/sspi.cpp +++ b/jdk/src/windows/native/sun/security/jgss/sspi_bridge/sspi.cpp @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include @@ -648,7 +648,7 @@ gss_acquire_cred(OM_uint32 *minor_status, if (cred->phCredK == NULL) { goto err; } - ss = AcquireCredentialsHandle( + ss = ::AcquireCredentialsHandle( NULL, L"Kerberos", cred_usage == 0 ? SECPKG_CRED_BOTH : @@ -678,7 +678,7 @@ gss_acquire_cred(OM_uint32 *minor_status, auth.Flags = SEC_WINNT_AUTH_IDENTITY_UNICODE; auth.PackageList = (unsigned short*)L"Kerberos"; auth.PackageListLength = 8; - ss = AcquireCredentialsHandle( + ss = ::AcquireCredentialsHandle( NULL, L"Negotiate", cred_usage == 0 ? SECPKG_CRED_BOTH : @@ -936,9 +936,9 @@ gss_init_sec_context(OM_uint32 *minor_status, auth.Flags = SEC_WINNT_AUTH_IDENTITY_UNICODE; auth.PackageList = (unsigned short*)L"Kerberos"; auth.PackageListLength = 8; - ss = AcquireCredentialsHandle( + ss = ::AcquireCredentialsHandle( NULL, - isSPNEGO ? L"Negotiate" : L"Kerberos", + isSPNEGO ? (LPTSTR)L"Negotiate" : (LPTSTR)L"Kerberos", SECPKG_CRED_OUTBOUND, NULL, isSPNEGO ? &auth : NULL, diff --git a/jdk/src/windows/native/sun/security/mscapi/security.cpp b/jdk/src/windows/native/sun/security/mscapi/security.cpp index 73488cbcc3c..b85077860ec 100644 --- a/jdk/src/windows/native/sun/security/mscapi/security.cpp +++ b/jdk/src/windows/native/sun/security/mscapi/security.cpp @@ -1247,7 +1247,7 @@ void showProperty(NCRYPT_HANDLE hKey) { BCryptBuffer bb; bb.BufferType = NCRYPTBUFFER_PKCS_SECRET; bb.cbBuffer = 18; - bb.pvBuffer = L"changeit"; + bb.pvBuffer = (PVOID)L"changeit"; BCryptBufferDesc bbd; bbd.ulVersion = 0; bbd.cBuffers = 1; diff --git a/jdk/src/windows/native/sun/security/pkcs11/j2secmod_md.c b/jdk/src/windows/native/sun/security/pkcs11/j2secmod_md.c index 33b11bfd07e..b7f9303a992 100644 --- a/jdk/src/windows/native/sun/security/pkcs11/j2secmod_md.c +++ b/jdk/src/windows/native/sun/security/pkcs11/j2secmod_md.c @@ -30,6 +30,7 @@ #include #include "j2secmod.h" +#include "wrapper/pkcs11wrapper.h" void *findFunction(JNIEnv *env, jlong jHandle, const char *functionName) { HINSTANCE hModule = (HINSTANCE)jHandle; diff --git a/jdk/src/windows/native/sun/security/pkcs11/wrapper/p11_md.h b/jdk/src/windows/native/sun/security/pkcs11/wrapper/p11_md.h index 7cff0c7c249..3e578366366 100644 --- a/jdk/src/windows/native/sun/security/pkcs11/wrapper/p11_md.h +++ b/jdk/src/windows/native/sun/security/pkcs11/wrapper/p11_md.h @@ -60,6 +60,9 @@ /* defines for WIN32 platform *************************************************/ +#ifndef _P11_MD_H +#define _P11_MD_H 1 + #include /* statement according to PKCS11 docu */ @@ -101,3 +104,5 @@ struct ModuleData { }; typedef struct ModuleData ModuleData; + +#endif /* _P11_MD_H */ diff --git a/jdk/src/windows/native/sun/windows/awt.h b/jdk/src/windows/native/sun/windows/awt.h index 95b0e1ed568..9af043348d5 100644 --- a/jdk/src/windows/native/sun/windows/awt.h +++ b/jdk/src/windows/native/sun/windows/awt.h @@ -339,7 +339,7 @@ class JavaStringBuffer jsize m_dwSize; LPWSTR getNonEmptyString() { return (NULL==m_pStr) - ? L"" + ? (LPWSTR)L"" : m_pStr; } diff --git a/jdk/src/windows/native/sun/windows/awt_Component.cpp b/jdk/src/windows/native/sun/windows/awt_Component.cpp index c0553af57c7..9486de3bfae 100644 --- a/jdk/src/windows/native/sun/windows/awt_Component.cpp +++ b/jdk/src/windows/native/sun/windows/awt_Component.cpp @@ -3579,7 +3579,7 @@ UINT AwtComponent::WindowsKeyToJavaChar(UINT wkey, UINT modifiers, TransOps ops, } else { UINT scancode = ::MapVirtualKey(wkey, 0); converted = ::ToUnicodeEx(wkey, scancode, keyboardState, - wChar, 2, 0, GetKeyboardLayout()); + (LPWSTR)&wChar, 2, 0, GetKeyboardLayout()); } UINT translation; diff --git a/jdk/src/windows/native/sun/windows/awt_PrintControl.cpp b/jdk/src/windows/native/sun/windows/awt_PrintControl.cpp index 5772cff66f8..711aa5843c1 100644 --- a/jdk/src/windows/native/sun/windows/awt_PrintControl.cpp +++ b/jdk/src/windows/native/sun/windows/awt_PrintControl.cpp @@ -1019,7 +1019,7 @@ BOOL AwtPrintControl::UpdateAttributes(JNIEnv *env, DASSERT(!IsBadReadPtr(devnames, sizeof(DEVNAMES))); LPTSTR lpcNames = (LPTSTR)devnames; LPTSTR pbuf = (_tcslen(lpcNames + devnames->wDeviceOffset) == 0 ? - TEXT("") : lpcNames + devnames->wDeviceOffset); + (LPTSTR)TEXT("") : lpcNames + devnames->wDeviceOffset); if (pbuf != NULL) { jstring jstr = JNU_NewStringPlatform(env, pbuf); env->CallVoidMethod(printCtrl, @@ -1028,7 +1028,7 @@ BOOL AwtPrintControl::UpdateAttributes(JNIEnv *env, env->DeleteLocalRef(jstr); } pbuf = (_tcslen(lpcNames + devnames->wOutputOffset) == 0 ? - TEXT("") : lpcNames + devnames->wOutputOffset); + (LPTSTR)TEXT("") : lpcNames + devnames->wOutputOffset); if (pbuf != NULL) { if (wcscmp(pbuf, L"FILE:") == 0) { pdFlags |= PD_PRINTTOFILE; diff --git a/jdk/src/windows/native/sun/windows/awt_new.cpp b/jdk/src/windows/native/sun/windows/awt_new.cpp index b2d133f2350..1636bdc2be6 100644 --- a/jdk/src/windows/native/sun/windows/awt_new.cpp +++ b/jdk/src/windows/native/sun/windows/awt_new.cpp @@ -114,17 +114,6 @@ void *safe_Realloc(void *memblock, size_t size) throw (std::bad_alloc) { return ret_val; } -#if !defined(DEBUG) -// This function exists because VC++ 5.0 currently does not conform to the -// Standard C++ specification which requires that operator new throw -// std::bad_alloc in an out of memory situation. Instead, VC++ 5.0 returns 0. -// -// This function can be safely removed when the problem is corrected. -void * CDECL operator new(size_t size) throw (std::bad_alloc) { - return safe_Malloc(size); -} -#endif - // This function is called at the beginning of an entry point. // Entry points are functions which are declared: // 1. CALLBACK, diff --git a/jdk/test/TEST.ROOT b/jdk/test/TEST.ROOT index b2d2ba1bcc3..de2a0d587f0 100644 --- a/jdk/test/TEST.ROOT +++ b/jdk/test/TEST.ROOT @@ -12,7 +12,7 @@ # A "headful" test requires a graphical environment to meaningfully # run. Tests that are not headful are "headless." -keys=2d dnd i18n intermittent randomness headful jfr +keys=2d dnd i18n intermittent randomness headful jfr printer # Tests that must run in othervm mode othervm.dirs=java/awt java/beans java/rmi javax/accessibility javax/imageio javax/sound javax/print javax/management com/sun/awt sun/awt sun/java2d sun/pisces sun/rmi