diff options
Diffstat (limited to 'dev-java/openjdk/files')
4 files changed, 188 insertions, 0 deletions
diff --git a/dev-java/openjdk/files/openjdk-8.402_p06-0001-Fix-Wint-conversion.patch b/dev-java/openjdk/files/openjdk-8.402_p06-0001-Fix-Wint-conversion.patch new file mode 100644 index 000000000000..317f1aa226b3 --- /dev/null +++ b/dev-java/openjdk/files/openjdk-8.402_p06-0001-Fix-Wint-conversion.patch @@ -0,0 +1,41 @@ +From cc568d4d246ffc9bf08a96db0889d3b89c852718 Mon Sep 17 00:00:00 2001 +From: Sam James <sam@gentoo.org> +Date: Wed, 6 Mar 2024 11:22:11 +0000 +Subject: [PATCH 1/4] Fix -Wint-conversion +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Backport of upstream commit https://github.com/openjdk/jdk21u-dev/commit/7b1455163ed893639059b3d62b71b2ff347c2e3f. + +Fixes the following warning/error: +``` +jdk8u-jdk8u402-ga/jdk/src/share/bin/splashscreen_stubs.c:64:5: error: returning ‘void *’ from a function with return type ‘int’ makes integer from pointer without a cast [-Wint-conversion] +``` + +Signed-off-by: Sam James <sam@gentoo.org> +--- + jdk/src/share/bin/splashscreen_stubs.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/jdk/src/share/bin/splashscreen_stubs.c b/jdk/src/share/bin/splashscreen_stubs.c +index 9c1f514..666634f 100644 +--- a/jdk/src/share/bin/splashscreen_stubs.c ++++ b/jdk/src/share/bin/splashscreen_stubs.c +@@ -61,11 +61,11 @@ typedef char* (*SplashGetScaledImageName_t)(const char* fileName, + #define INVOKEV(name) _INVOKE(name, ,;) + + int DoSplashLoadMemory(void* pdata, int size) { +- INVOKE(SplashLoadMemory, NULL)(pdata, size); ++ INVOKE(SplashLoadMemory, 0)(pdata, size); + } + + int DoSplashLoadFile(const char* filename) { +- INVOKE(SplashLoadFile, NULL)(filename); ++ INVOKE(SplashLoadFile, 0)(filename); + } + + void DoSplashInit(void) { +-- +2.44.0 + diff --git a/dev-java/openjdk/files/openjdk-8.402_p06-0002-Fix-Wincompatible-pointer-types.patch b/dev-java/openjdk/files/openjdk-8.402_p06-0002-Fix-Wincompatible-pointer-types.patch new file mode 100644 index 000000000000..3e8a5d17113c --- /dev/null +++ b/dev-java/openjdk/files/openjdk-8.402_p06-0002-Fix-Wincompatible-pointer-types.patch @@ -0,0 +1,48 @@ +From 57b8fef20b090ffdf99bcf2c3f5fc8d0d4472788 Mon Sep 17 00:00:00 2001 +From: Sam James <sam@gentoo.org> +Date: Wed, 6 Mar 2024 11:54:24 +0000 +Subject: [PATCH 2/4] Fix -Wincompatible-pointer-types +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Backport https://github.com/openjdk/jdk17u/commit/6632e6c6ca74101b45b052fb7962376fbe97605e. + +``` +jdk8u-jdk8u402-ga/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c: In function ‘Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_writeImage’: +jdk8u-jdk8u402-ga/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c:2853:19: error: passing argument 1 of ‘freeArray’ from incompatible pointer type [-Wincompatible-pointer-types] + 2853 | freeArray(scale, numBands); + | ^~~~~ + | | + | UINT8 ** {aka unsigned char **} +jdk8u-jdk8u402-ga/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c:2689:30: note: expected ‘void **’ but argument is of type ‘UINT8 **’ {aka ‘unsigned char **’} + 2689 | static void freeArray(void** arr, jint size) { + | ~~~~~~~^~~ +jdk8u-jdk8u402-ga/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c:2860:19: error: passing argument 1 of ‘freeArray’ from incompatible pointer type [-Wincompatible-pointer-types] + 2860 | freeArray(scale, numBands); + | ^~~~~ + | | + | UINT8 ** {aka unsigned char **} +``` + +Signed-off-by: Sam James <sam@gentoo.org> +--- + jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c b/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c +index 7e1d8c9..163003c 100644 +--- a/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c ++++ b/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c +@@ -2686,7 +2686,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_writeTables + RELEASE_ARRAYS(env, data, NULL); + } + +-static void freeArray(void** arr, jint size) { ++static void freeArray(UINT8** arr, jint size) { + int i; + if (arr != NULL) { + for (i = 0; i < size; i++) { +-- +2.44.0 + diff --git a/dev-java/openjdk/files/openjdk-8.402_p06-0003-Fix-negative-value-left-shift.patch b/dev-java/openjdk/files/openjdk-8.402_p06-0003-Fix-negative-value-left-shift.patch new file mode 100644 index 000000000000..3e4296d21aac --- /dev/null +++ b/dev-java/openjdk/files/openjdk-8.402_p06-0003-Fix-negative-value-left-shift.patch @@ -0,0 +1,38 @@ +From 685bf942bdf5b265a3b343c2b682b01b11b6e58a Mon Sep 17 00:00:00 2001 +From: Sam James <sam@gentoo.org> +Date: Wed, 6 Mar 2024 12:20:03 +0000 +Subject: [PATCH 3/4] Fix negative value left shift +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Backport of https://github.com/openjdk/jdk17u/commit/51be7db96f3fc32a7ddb24f8af19fb4fc0577aaf. + +``` +jdk/src/share/native/com/sun/java/util/jar/pack/constants.h:226:37: error: left operand of shift expression ‘(-1 << 13)’ is negative [-fpermissive] +jdk/src/share/native/com/sun/java/util/jar/pack/constants.h:226:39: error: enumerator value for ‘AO_UNUSED_MBZ’ is not an integer constant + 226 | AO_UNUSED_MBZ = (-1)<<13, // options bits reserved for future use. + | ^~ +``` + +Signed-off-by: Sam James <sam@gentoo.org> +--- + jdk/src/share/native/com/sun/java/util/jar/pack/constants.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/jdk/src/share/native/com/sun/java/util/jar/pack/constants.h b/jdk/src/share/native/com/sun/java/util/jar/pack/constants.h +index f1a1f73..536003b 100644 +--- a/jdk/src/share/native/com/sun/java/util/jar/pack/constants.h ++++ b/jdk/src/share/native/com/sun/java/util/jar/pack/constants.h +@@ -223,7 +223,7 @@ enum { + AO_HAVE_FIELD_FLAGS_HI = 1<<10, + AO_HAVE_METHOD_FLAGS_HI = 1<<11, + AO_HAVE_CODE_FLAGS_HI = 1<<12, +- AO_UNUSED_MBZ = (-1)<<13, // options bits reserved for future use. ++ AO_UNUSED_MBZ = (int)((~0U)<<13), // options bits reserved for future use. + + #define ARCHIVE_BIT_DO(F) \ + F(AO_HAVE_SPECIAL_FORMATS) \ +-- +2.44.0 + diff --git a/dev-java/openjdk/files/openjdk-8.402_p06-0004-Fix-misc.-warnings.patch b/dev-java/openjdk/files/openjdk-8.402_p06-0004-Fix-misc.-warnings.patch new file mode 100644 index 000000000000..44c5268646d8 --- /dev/null +++ b/dev-java/openjdk/files/openjdk-8.402_p06-0004-Fix-misc.-warnings.patch @@ -0,0 +1,61 @@ +From 24f51a75b79aec29bd1631d320e051a646b9fae4 Mon Sep 17 00:00:00 2001 +From: Sam James <sam@gentoo.org> +Date: Wed, 6 Mar 2024 12:23:41 +0000 +Subject: [PATCH 4/4] Fix misc. warnings +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Backport of https://github.com/openjdk/jdk11u/commit/49dec121161c162f4aa94caf8c09413253d89377. + +``` +jdk8u-jdk8u402-ga/jdk/src/share/native/com/sun/java/util/jar/pack/jni.cpp: In function ‘_jobject* Java_com_sun_java_util_jar_Unpack_getUnusedInput(JNIEnv*, jobject)’: +jdk8u-jdk8u402-ga/jdk/src/share/native/com/sun/java/util/jar/pack/jni.cpp:295:12: error: cannot convert ‘bool’ to ‘jobject’ {aka ‘_jobject*’} in return + 295 | return false; + | ^~~~~ +jdk8u-jdk8u402-ga/jdk/src/share/native/com/sun/java/util/jar/pack/jni.cpp: In function ‘jlong Java_com_sun_java_util_jar_pack_NativeUnpack_finish(JNIEnv*, jobject)’: +jdk8u-jdk8u402-ga/jdk/src/share/native/com/sun/java/util/jar/pack/jni.cpp:315:3: warning: converting to non-pointer type ‘long int’ from NULL [-Wconversion-null] + 315 | CHECK_EXCEPTION_RETURN_VALUE(uPtr, NULL); + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ +jdk8u-jdk8u402-ga/jdk/src/share/native/com/sun/java/util/jar/pack/jni.cpp:315:3: warning: converting to non-pointer type ‘long int’ from NULL [-Wconversion-null] +[...] +``` + +Signed-off-by: Sam James <sam@gentoo.org> +--- + jdk/src/share/native/com/sun/java/util/jar/pack/jni.cpp | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/jdk/src/share/native/com/sun/java/util/jar/pack/jni.cpp b/jdk/src/share/native/com/sun/java/util/jar/pack/jni.cpp +index 5fbc726..4c002e7 100644 +--- a/jdk/src/share/native/com/sun/java/util/jar/pack/jni.cpp ++++ b/jdk/src/share/native/com/sun/java/util/jar/pack/jni.cpp +@@ -292,7 +292,7 @@ Java_com_sun_java_util_jar_pack_NativeUnpack_getUnusedInput(JNIEnv *env, jobject + + if (uPtr->aborting()) { + THROW_IOE(uPtr->get_abort_message()); +- return false; ++ return null; + } + + // We have fetched all the files. +@@ -312,7 +312,7 @@ Java_com_sun_java_util_jar_pack_NativeUnpack_finish(JNIEnv *env, jobject pObj) { + // There's no need to create a new unpacker here if we don't already have one + // just to immediatly free it afterwards. + unpacker* uPtr = get_unpacker(env, pObj, /* noCreate= */ true); +- CHECK_EXCEPTION_RETURN_VALUE(uPtr, NULL); ++ CHECK_EXCEPTION_RETURN_VALUE(uPtr, 0); + size_t consumed = uPtr->input_consumed(); + // free_unpacker() will set the unpacker field on 'pObj' to null + free_unpacker(env, pObj, uPtr); +@@ -323,6 +323,7 @@ JNIEXPORT jboolean JNICALL + Java_com_sun_java_util_jar_pack_NativeUnpack_setOption(JNIEnv *env, jobject pObj, + jstring pProp, jstring pValue) { + unpacker* uPtr = get_unpacker(env, pObj); ++ CHECK_EXCEPTION_RETURN_VALUE(uPtr, false); + const char* prop = env->GetStringUTFChars(pProp, JNI_FALSE); + CHECK_EXCEPTION_RETURN_VALUE(prop, false); + const char* value = env->GetStringUTFChars(pValue, JNI_FALSE); +-- +2.44.0 + |