diff --git a/hotspot/make/bsd/makefiles/adlc.make b/hotspot/make/bsd/makefiles/adlc.make index e37e60ca97..4731f8404d 100644 --- a/hotspot/make/bsd/makefiles/adlc.make +++ b/hotspot/make/bsd/makefiles/adlc.make @@ -71,6 +71,10 @@ ifneq ($(COMPILER_WARNINGS_FATAL),false) endif CFLAGS += $(CFLAGS_WARN) +ifeq ($(OS_VENDOR), Darwin) + CFLAGS += -Wno-tautological-compare +endif + OBJECTNAMES = \ adlparse.o \ archDesc.o \ diff --git a/hotspot/make/bsd/makefiles/vm.make b/hotspot/make/bsd/makefiles/vm.make index 60d3a204bf..ee83947712 100644 --- a/hotspot/make/bsd/makefiles/vm.make +++ b/hotspot/make/bsd/makefiles/vm.make @@ -150,6 +150,11 @@ JVM = jvm ifeq ($(OS_VENDOR), Darwin) LIBJVM = lib$(JVM).dylib CFLAGS += -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE + CFLAGS += -Wno-tautological-compare \ + -Wno-undefined-var-template -Wno-sometimes-uninitialized -Wno-unknown-pragmas \ + -Wno-delete-non-virtual-dtor -Wno-missing-braces -Wno-char-subscripts \ + -Wno-ignored-qualifiers -Wno-missing-field-initializers -Wno-mismatched-tags \ + -Wno-shift-negative-value -Wno-misleading-indentation ifeq (${VERSION}, $(filter ${VERSION}, debug fastdebug)) CFLAGS += -DALLOW_OPERATOR_NEW_USAGE endif diff --git a/jdk/make/CompileDemos.gmk b/jdk/make/CompileDemos.gmk index aab0aafef5..c580609d39 100644 --- a/jdk/make/CompileDemos.gmk +++ b/jdk/make/CompileDemos.gmk @@ -78,6 +78,11 @@ ifneq ($(OPENJDK_TARGET_OS), solaris) endif endif +DISABLED_WARNINGS_clang := +ifeq ($(TOOLCHAIN_TYPE), clang) + DISABLED_WARNINGS_clang := -Wno-format-nonliteral +endif + ################################################################################################## PATTERNS_TO_COPY = .html .txt .properties .js .gif .jpg .theme .data .opt README .c .h .png .ttf .xyz .obj @@ -242,7 +247,7 @@ define SetupJVMTIDemo # Workaround for CFLAGS_JDKLIB containing ',' on solaris. If this is added as 'CFLAGS' to the # eval call below, the comma gets expanded too early. BUILD_DEMO_JVMTI_$1_CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_DEBUG_SYMBOLS) \ - -I$(JDK_TOPDIR)/src/share/demo/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_INC) $3 + -I$(JDK_TOPDIR)/src/share/demo/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_INC) $3 $(DISABLED_WARNINGS_clang) # Remove the -incremental:no setting to get .ilk-files like in the old build. $$(eval $$(call SetupNativeCompilation,BUILD_DEMO_JVMTI_$1, \ diff --git a/jdk/make/CompileLaunchers.gmk b/jdk/make/CompileLaunchers.gmk index ba645e5dad..28c8734682 100644 --- a/jdk/make/CompileLaunchers.gmk +++ b/jdk/make/CompileLaunchers.gmk @@ -478,6 +478,11 @@ else UNPACK_MAPFILE = $(JDK_TOPDIR)/make/mapfiles/libunpack/mapfile-vers-unpack200 endif +DISABLED_WARNINGS_macosx := +ifeq ($(OPENJDK_TARGET_OS), macosx) + DISABLED_WARNINGS_macosx := -Wno-format-nonliteral +endif + $(eval $(call SetupNativeCompilation,BUILD_UNPACKEXE, \ SRC := $(JDK_TOPDIR)/src/share/native/com/sun/java/util/jar/pack, \ EXCLUDE_FILES := jni.cpp, \ @@ -488,7 +493,7 @@ $(eval $(call SetupNativeCompilation,BUILD_UNPACKEXE, \ CFLAGS_release := -DPRODUCT, \ CFLAGS_linux := -fPIC, \ CFLAGS_solaris := -KPIC, \ - CFLAGS_macosx := -fPIC, \ + CFLAGS_macosx := -fPIC $(DISABLED_WARNINGS_macosx), \ MAPFILE := $(UNPACK_MAPFILE),\ LDFLAGS := $(UNPACKEXE_ZIPOBJS), \ LDFLAGS_windows := $(CXXFLAGS_JDKEXE), \ diff --git a/jdk/make/closed/lib/ServiceabilityLibraries.gmk b/jdk/make/closed/lib/ServiceabilityLibraries.gmk index dcff762f3b..2aa5de7dc3 100644 --- a/jdk/make/closed/lib/ServiceabilityLibraries.gmk +++ b/jdk/make/closed/lib/ServiceabilityLibraries.gmk @@ -26,6 +26,11 @@ endif ################################################################################ +DISABLED_WARNINGS_macosx := +ifeq ($(OPENJDK_TARGET_OS), macosx) + DISABLED_WARNINGS_macosx := -Wno-format-nonliteral +endif + ifndef OPENJDK $(eval $(call SetupNativeCompilation,BUILD_LIBBCI, \ @@ -34,7 +39,7 @@ ifndef OPENJDK SRC := $(JDK_TOPDIR)/src/closed/share/native/jdk/internal/instrumentation, \ LANG := C, \ OPTIMIZATION := LOW, \ - CFLAGS := $(CFLAGS_JDKLIB) \ + CFLAGS := $(CFLAGS_JDKLIB) $(DISABLED_WARNINGS_macosx) \ -I$(JDK_TOPDIR)/src/closed/share/javavm/export, \ MAPFILE := $(JDK_TOPDIR)/make/closed/mapfiles/libbci/mapfile-vers, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ diff --git a/jdk/make/lib/Awt2dLibraries.gmk b/jdk/make/lib/Awt2dLibraries.gmk index 5765c3865b..f88df58a0d 100644 --- a/jdk/make/lib/Awt2dLibraries.gmk +++ b/jdk/make/lib/Awt2dLibraries.gmk @@ -463,6 +463,11 @@ ifeq ($(OPENJDK_TARGET_OS), linux) LIBAWT_MAPFILE := endif +DISABLED_WARNINGS_clang := +ifeq ($(TOOLCHAIN_TYPE), clang) + DISABLED_WARNINGS_clang := -Wno-logical-op-parentheses -Wno-extern-initializer -Wno-sign-compare -Wno-format-nonliteral +endif + $(eval $(call SetupNativeCompilation,BUILD_LIBAWT, \ LIBRARY := awt, \ OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ @@ -470,7 +475,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBAWT, \ INCLUDE_FILES := $(LIBAWT_FILES), \ LANG := $(LIBAWT_LANG), \ OPTIMIZATION := LOW, \ - CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_CFLAGS), \ + CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_CFLAGS) $(DISABLED_WARNINGS_clang), \ ASFLAGS := $(LIBAWT_ASFLAGS), \ MAPFILE := $(LIBAWT_MAPFILE), \ LDFLAGS := $(LDFLAGS_JDKLIB) $(call SET_SHARED_LIBRARY_ORIGIN), \ @@ -623,6 +628,11 @@ ifeq ($(findstring $(OPENJDK_TARGET_OS),windows macosx),) LIBAWT_XAWT_LDFLAGS += -lpthread endif + DISABLED_WARNINGS_clang := + ifeq ($(TOOLCHAIN_TYPE), clang) + DISABLED_WARNINGS_clang := -Wno-parentheses -Wno-format -Wno-undef -Wno-logical-op-parentheses -Wno-format-nonliteral -Wno-int-conversion + endif + $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_XAWT, \ LIBRARY := awt_xawt, \ OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ @@ -631,8 +641,7 @@ ifeq ($(findstring $(OPENJDK_TARGET_OS),windows macosx),) LANG := C, \ OPTIMIZATION := LOW, \ CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_XAWT_CFLAGS) \ - $(X_CFLAGS) \ - $(FONTCONFIG_CFLAGS), \ + $(X_CFLAGS) $(FONTCONFIG_CFLAGS) $(DISABLED_WARNINGS_clang), \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libawt_xawt/mapfile-vers, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ $(X_LIBS) $(LIBAWT_XAWT_LDFLAGS) \ @@ -658,11 +667,13 @@ endif ########################################################################################## +DISABLED_WARNINGS_clang := ifeq ($(TOOLCHAIN_TYPE), clang) ifeq ($(TOOLCHAIN_VERSION), 10.1) # Work around an optimizer bug seen with Xcode 10.1, but fixed by 10.3 BUILD_LIBLCMS_cmsopt.c_CFLAGS := -O0 endif + DISABLED_WARNINGS_clang := -Wno-tautological-compare -Wno-format-nonliteral -Wno-undef -Wno-unused-but-set-parameter endif # TODO: Update awt lib path when awt is converted @@ -675,6 +686,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBLCMS, \ CFLAGS := $(filter-out -xc99=%none, $(CFLAGS_JDKLIB)) \ -DCMS_DONT_USE_FAST_FLOOR \ $(SHARED_LIBRARY_FLAGS) \ + $(DISABLED_WARNINGS_clang) \ -I$(JDK_TOPDIR)/src/share/native/sun/java2d \ -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug, \ CFLAGS_solaris := -xc99=no_lib, \ @@ -901,6 +913,14 @@ ifeq ($(OPENJDK_TARGET_OS), linux) BUILD_LIBFONTMANAGER_ExtensionSubtables.cpp_CXXFLAGS := -fno-strict-aliasing endif +DISABLED_WARNINGS_clang := +ifeq ($(TOOLCHAIN_TYPE), clang) + DISABLED_WARNINGS_clang := -Wno-unused-value -Wno-incompatible-pointer-types \ + -Wno-tautological-constant-out-of-range-compare -Wno-int-to-pointer-cast \ + -Wno-undef -Wno-missing-field-initializers -Wno-range-loop-analysis \ + -Wno-deprecated-declarations -Wno-c++11-narrowing +endif + # LDFLAGS clarification: # Filter relevant linker flags disallowing unresolved symbols as we cannot # build-time decide to which library to link against (libawt_headless or @@ -913,7 +933,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER, \ EXCLUDE_FILES := $(LIBFONTMANAGER_EXCLUDE_FILES) \ AccelGlyphCache.c, \ LANG := C++, \ - CFLAGS := $(CFLAGS_JDKLIB) $(BUILD_LIBFONTMANAGER_CFLAGS_COMMON), \ + CFLAGS := $(CFLAGS_JDKLIB) $(BUILD_LIBFONTMANAGER_CFLAGS_COMMON) $(DISABLED_WARNINGS_clang), \ CXXFLAGS := $(CXXFLAGS_JDKLIB) $(BUILD_LIBFONTMANAGER_CFLAGS_COMMON), \ OPTIMIZATION := $(LIBFONTMANAGER_OPTIMIZATION), \ CFLAGS_windows = -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/windows \ @@ -1069,7 +1089,7 @@ else # OPENJDK_TARGET_OS not windows OPTIMIZATION := LOW, \ CFLAGS := $(CFLAGS_JDKLIB), \ CFLAGS_linux := $(HEADLESS_CFLAG), \ - CFLAGS_macosx := -I$(JDK_TOPDIR)/src/solaris/native/sun/awt, \ + CFLAGS_macosx := -Wno-sign-compare -I$(JDK_TOPDIR)/src/solaris/native/sun/awt, \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjawt/mapfile-vers, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ @@ -1158,12 +1178,16 @@ ifndef BUILD_HEADLESS_ONLY -DPNG_ARM_NEON_OPT=0 -DPNG_ARM_NEON_IMPLEMENTATION=0 \ $(foreach dir, $(LIBSPLASHSCREEN_DIRS), -I$(dir)) + DISABLED_WARNINGS_clang := + ifeq ($(OPENJDK_TARGET_OS), macosx) LIBSPLASHSCREEN_CFLAGS := -I$(JDK_TOPDIR)/src/macosx/native/sun/awt/splashscreen \ $(LIBSPLASHSCREEN_CFLAGS) LIBSPLASHSCREEN_CFLAGS += -DWITH_MACOSX LIBSPLASHSCREEN_CFLAGS += -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp + DISABLED_WARNINGS_clang := -Wno-unknown-warning-option -Wno-unused-parameter -Wno-unused -Wno-incompatible-pointer-types -Wno-sign-compare -Wno-deprecated-declarations -Wno-null-pointer-subtraction + LIBSPLASHSCREEN_java_awt_SplashScreen.c_CFLAGS := -x objective-c -O0 LIBSPLASHSCREEN_splashscreen_gfx_impl.c_CFLAGS := -x objective-c -O0 LIBSPLASHSCREEN_splashscreen_gif.c_CFLAGS := -x objective-c -O0 @@ -1204,7 +1228,7 @@ ifndef BUILD_HEADLESS_ONLY EXCLUDE_FILES := imageioJPEG.c jpegdecoder.c pngtest.c, \ LANG := C, \ OPTIMIZATION := LOW, \ - CFLAGS := $(LIBSPLASHSCREEN_CFLAGS) $(CFLAGS_JDKLIB) $(GIFLIB_CFLAGS), \ + CFLAGS := $(LIBSPLASHSCREEN_CFLAGS) $(CFLAGS_JDKLIB) $(GIFLIB_CFLAGS) $(DISABLED_WARNINGS_clang), \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libsplashscreen/mapfile-vers, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ @@ -1388,6 +1412,15 @@ ifeq ($(OPENJDK_TARGET_OS), macosx) $(JDK_TOPDIR)/src/share/native/sun/font \ $(JDK_TOPDIR)/src/share/native/sun/java2d/opengl \ + DISABLED_WARNINGS_clang := + ifeq ($(TOOLCHAIN_TYPE), clang) + DISABLED_WARNINGS_clang := -Wno-incomplete-implementation -Wno-enum-conversion \ + -Wno-deprecated-declarations -Wno-objc-method-access -Wno-bitwise-op-parentheses \ + -Wno-incompatible-pointer-types -Wno-parentheses-equality -Wno-extra-tokens \ + -Wno-sign-compare -Wno-semicolon-before-method-body -Wno-format-nonliteral -Wno-undef \ + -Wno-pointer-arith + endif + $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_LWAWT, \ LIBRARY := awt_lwawt, \ OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ @@ -1395,7 +1428,7 @@ ifeq ($(OPENJDK_TARGET_OS), macosx) LANG := C, \ INCLUDE_FILES := $(LIBAWT_LWAWT_FILES), \ OPTIMIZATION := LOW, \ - CFLAGS := $(CFLAGS_JDKLIB) \ + CFLAGS := $(CFLAGS_JDKLIB) $(DISABLED_WARNINGS_clang) \ $(X_CFLAGS) \ $(X_LIBS) \ $(foreach dir, $(LIBAWT_LWAWT_DIRS), -I$(dir)) \ @@ -1445,7 +1478,7 @@ ifeq ($(OPENJDK_TARGET_OS), macosx) SRC := $(JDK_TOPDIR)/src/macosx/native/com/apple/laf, \ LANG := C, \ OPTIMIZATION := LOW, \ - CFLAGS := $(CFLAGS_JDKLIB) \ + CFLAGS := $(CFLAGS_JDKLIB) -Wno-deprecated-declarations -Wno-sign-compare \ -I$(JDK_TOPDIR)/src/macosx/native/com/apple/laf \ -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \ -I$(JDK_TOPDIR)/src/macosx/native/sun/awt, \ diff --git a/jdk/make/lib/CoreLibraries.gmk b/jdk/make/lib/CoreLibraries.gmk index 8aa11c875c..d89c50c535 100644 --- a/jdk/make/lib/CoreLibraries.gmk +++ b/jdk/make/lib/CoreLibraries.gmk @@ -75,7 +75,7 @@ else OUTPUT_DIR := $(JDK_OUTPUTDIR)/objs/libfdlibm, \ SRC := $(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/src, \ LANG := C, \ - CFLAGS := $(CFLAGS_JDKLIB) \ + CFLAGS := $(CFLAGS_JDKLIB) -Wno-sign-compare -Wno-misleading-indentation \ -I$(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/include, \ LDFLAGS := -nostdlib -r -mmacosx-version-min=$(MACOSX_VERSION_MIN), \ OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libfdlibm, \ @@ -316,6 +316,11 @@ BUILD_LIBRARIES += $(BUILD_LIBZIP) ########################################################################################## +DISABLED_WARNINGS_macosx := +ifeq ($(OPENJDK_TARGET_OS), macosx) + DISABLED_WARNINGS_macosx := -Wno-format-nonliteral +endif + $(eval $(call SetupNativeCompilation,BUILD_LIBUNPACK, \ LIBRARY := unpack, \ OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ @@ -323,7 +328,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBUNPACK, \ EXCLUDE_FILES := main.cpp, \ LANG := C++, \ OPTIMIZATION := LOW, \ - CFLAGS := $(CXXFLAGS_JDKLIB) \ + CFLAGS := $(CXXFLAGS_JDKLIB) $(DISABLED_WARNINGS_macosx) \ -DNO_ZLIB -DUNPACK_JNI -DFULL, \ CFLAGS_release := -DPRODUCT, \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libunpack/mapfile-vers, \ @@ -367,7 +372,7 @@ else endif ifeq ($(OPENJDK_TARGET_OS), macosx) - LIBJLI_CFLAGS += -I$(JDK_TOPDIR)/src/macosx/bin + LIBJLI_CFLAGS += -I$(JDK_TOPDIR)/src/macosx/bin -Wno-deprecated-declarations -Wno-unknown-warning-option -Wno-unused-parameter -Wno-unused -Wno-sometimes-uninitialized -Wno-format-nonliteral BUILD_LIBJLI_SRC_DIRS += $(JDK_TOPDIR)/src/macosx/bin BUILD_LIBJLI_FILES += java_md_common.c java_md_macosx.c @@ -499,7 +504,7 @@ else ifeq ($(OPENJDK_TARGET_OS), macosx) INCLUDE_FILES := $(BUILD_LIBJLI_FILES), \ LANG := C, \ OPTIMIZATION := HIGH, \ - CFLAGS := $(CFLAGS_JDKLIB) $(LIBJLI_CFLAGS), \ + CFLAGS := $(CFLAGS_JDKLIB) $(LIBJLI_CFLAGS) -Wno-unknown-warning-option -Wno-unused-parameter -Wno-unused -Wno-sometimes-uninitialized -Wno-format-nonliteral, \ LDFLAGS := -nostdlib -r -mmacosx-version-min=$(MACOSX_VERSION_MIN), \ OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjli_static, \ DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) diff --git a/jdk/make/lib/NetworkingLibraries.gmk b/jdk/make/lib/NetworkingLibraries.gmk index fc293d1cb2..556cbfee59 100644 --- a/jdk/make/lib/NetworkingLibraries.gmk +++ b/jdk/make/lib/NetworkingLibraries.gmk @@ -46,14 +46,16 @@ ifeq ($(OPENJDK_TARGET_OS), solaris) endif LIBNET_CFLAGS := $(foreach dir, $(LIBNET_SRC_DIRS), -I$(dir)) - LIBNET_EXCLUDE_FILES := +DISABLED_WARNINGS_macosx := + ifneq ($(OPENJDK_TARGET_OS), linux) LIBNET_EXCLUDE_FILES += linux_close.c LinuxSocketOptions.c endif ifneq ($(OPENJDK_TARGET_OS), macosx) LIBNET_EXCLUDE_FILES += bsd_close.c MacOSXSocketOptions.c + DISABLED_WARNINGS_macosx := -Wno-format-nonliteral endif ifneq ($(OPENJDK_TARGET_OS), solaris) @@ -79,8 +81,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBNET, \ EXCLUDE_FILES := $(LIBNET_EXCLUDE_FILES), \ LANG := C, \ OPTIMIZATION := LOW, \ - CFLAGS := $(CFLAGS_JDKLIB) \ - $(LIBNET_CFLAGS), \ + CFLAGS := $(CFLAGS_JDKLIB) $(LIBNET_CFLAGS) $(DISABLED_WARNINGS_macosx), \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libnet/mapfile-$(OPENJDK_TARGET_OS), \ LDFLAGS := $(LDFLAGS_JDKLIB) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ diff --git a/jdk/make/lib/NioLibraries.gmk b/jdk/make/lib/NioLibraries.gmk index 6c9c46a3f3..a9f4a6fe85 100644 --- a/jdk/make/lib/NioLibraries.gmk +++ b/jdk/make/lib/NioLibraries.gmk @@ -77,6 +77,7 @@ ifeq ($(OPENJDK_TARGET_OS), linux) UnixNativeDispatcher.c endif +DISABLED_WARNINGS_clang:= ifeq ($(OPENJDK_TARGET_OS), macosx) BUILD_LIBNIO_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libnio/mapfile-$(OPENJDK_TARGET_OS) BUILD_LIBNIO_SRC += $(JDK_TOPDIR)/src/macosx/native/sun/nio/ch @@ -93,6 +94,7 @@ ifeq ($(OPENJDK_TARGET_OS), macosx) KQueue.c \ KQueuePort.c \ KQueueArrayWrapper.c + DISABLED_WARNINGS_clang := -Wno-undef endif ifeq ($(OPENJDK_TARGET_OS), solaris) @@ -137,8 +139,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBNIO, \ INCLUDE_FILES := $(BUILD_LIBNIO_FILES), \ LANG := C, \ OPTIMIZATION := HIGH, \ - CFLAGS := $(CFLAGS_JDKLIB) \ - $(BUILD_LIBNIO_CFLAGS), \ + CFLAGS := $(CFLAGS_JDKLIB) $(BUILD_LIBNIO_CFLAGS) $(DISABLED_WARNINGS_clang), \ MAPFILE := $(BUILD_LIBNIO_MAPFILE), \ LDFLAGS := $(LDFLAGS_JDKLIB) $(BUILD_LIBNIO_LDFLAGS) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ diff --git a/jdk/make/lib/PlatformLibraries.gmk b/jdk/make/lib/PlatformLibraries.gmk index b6e8fe4b43..001f4dfd1b 100644 --- a/jdk/make/lib/PlatformLibraries.gmk +++ b/jdk/make/lib/PlatformLibraries.gmk @@ -58,7 +58,8 @@ ifeq ($(OPENJDK_TARGET_OS), macosx) SRC := $(JDK_TOPDIR)/src/macosx/native/sun/osxapp, \ LANG := C, \ OPTIMIZATION := LOW, \ - CFLAGS := $(CFLAGS_JDKLIB) \ + CFLAGS := $(CFLAGS_JDKLIB) -Wno-deprecated-declarations -Wno-objc-method-access -Wno-objc-root-class \ + -Wno-deprecated-declarations -Wno-format-nonliteral \ -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \ -I$(JDK_OUTPUTDIR)/gensrc/sun/osxapp, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ @@ -102,7 +103,7 @@ ifeq ($(OPENJDK_TARGET_OS), macosx) SRC := $(LIBOSX_DIRS), \ LANG := C, \ OPTIMIZATION := LOW, \ - CFLAGS := $(CFLAGS_JDKLIB) \ + CFLAGS := $(CFLAGS_JDKLIB) -Wno-deprecated-declarations \ $(foreach dir, $(LIBOSX_DIRS), -I$(dir)) \ -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ diff --git a/jdk/make/lib/SecurityLibraries.gmk b/jdk/make/lib/SecurityLibraries.gmk index a8eeceb3cd..2f73fa8c42 100644 --- a/jdk/make/lib/SecurityLibraries.gmk +++ b/jdk/make/lib/SecurityLibraries.gmk @@ -94,6 +94,11 @@ BUILD_LIBRARIES += $(BUILD_LIBJ2PCSC) ########################################################################################## +DISABLED_WARNINGS_macosx := +ifeq ($(OPENJDK_TARGET_OS), macosx) + DISABLED_WARNINGS_macosx := -Wno-undef +endif + ifneq ($(OPENJDK_TARGET_OS), windows) $(eval $(call SetupNativeCompilation,BUILD_LIBJ2GSS, \ LIBRARY := j2gss, \ @@ -102,7 +107,7 @@ ifneq ($(OPENJDK_TARGET_OS), windows) $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/jgss/wrapper, \ LANG := C, \ OPTIMIZATION := LOW, \ - CFLAGS := $(CFLAGS_JDKLIB) \ + CFLAGS := $(CFLAGS_JDKLIB) $(DISABLED_WARNINGS_macosx) \ -I$(JDK_TOPDIR)/src/share/native/sun/security/jgss/wrapper \ -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/jgss/wrapper, \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libj2gss/mapfile-vers, \ @@ -118,6 +123,11 @@ endif ########################################################################################## +DISABLED_WARNINGS_macosx := +ifeq ($(OPENJDK_TARGET_OS), macosx) + DISABLED_WARNINGS_macosx := -Wno-deprecated-declarations +endif + ifneq ($(BUILD_CRYPTO), no) BUILD_LIBKRB5_NAME := ifeq ($(OPENJDK_TARGET_OS), windows) @@ -139,7 +149,7 @@ ifneq ($(BUILD_CRYPTO), no) SRC := $(BUILD_LIBKRB5_SRC), \ LANG := C, \ OPTIMIZATION := LOW, \ - CFLAGS := $(CFLAGS_JDKLIB) \ + CFLAGS := $(CFLAGS_JDKLIB) $(DISABLED_WARNINGS_macosx) \ -I$(JDK_TOPDIR)/src/share/native/sun/security/krb5 \ -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/krb5, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ @@ -185,6 +195,11 @@ endif ########################################################################################## +DISABLED_WARNINGS_macosx := +ifeq ($(OPENJDK_TARGET_OS), macosx) + DISABLED_WARNINGS_macosx := -Wno-format-nonliteral +endif + $(eval $(call SetupNativeCompilation,BUILD_LIBJ2PKCS11, \ LIBRARY := j2pkcs11, \ OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ @@ -194,7 +209,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJ2PKCS11, \ $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/pkcs11/wrapper, \ LANG := C, \ OPTIMIZATION := LOW, \ - CFLAGS := $(CFLAGS_JDKLIB) \ + CFLAGS := $(CFLAGS_JDKLIB) $(DISABLED_WARNINGS_macosx) \ -I$(JDK_TOPDIR)/src/share/native/sun/security/pkcs11 \ -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/pkcs11 \ -I$(JDK_TOPDIR)/src/share/native/sun/security/pkcs11/wrapper \ diff --git a/jdk/make/lib/ServiceabilityLibraries.gmk b/jdk/make/lib/ServiceabilityLibraries.gmk index 31ffff62b0..861d671467 100644 --- a/jdk/make/lib/ServiceabilityLibraries.gmk +++ b/jdk/make/lib/ServiceabilityLibraries.gmk @@ -141,6 +141,11 @@ endif # OPENJDK_TARGET_OS ########################################################################################## +DISABLED_WARNINGS_macosx := +ifeq ($(OPENJDK_TARGET_OS), macosx) + DISABLED_WARNINGS_macosx := -Wno-format-nonliteral +endif + # JDWP_LOGGING causes log messages to be compiled into the library. $(eval $(call SetupNativeCompilation,BUILD_LIBJDWP, \ LIBRARY := jdwp, \ @@ -148,7 +153,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJDWP, \ SRC := $(JDK_TOPDIR)/src/share/back $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/back, \ LANG := C, \ OPTIMIZATION := LOW, \ - CFLAGS := $(CFLAGS_JDKLIB) -DJDWP_LOGGING \ + CFLAGS := $(CFLAGS_JDKLIB) $(DISABLED_WARNINGS_macosx) -DJDWP_LOGGING \ -I$(JDK_TOPDIR)/src/share/transport/export \ -I$(JDK_TOPDIR)/src/share/back/export \ -I$(JDK_TOPDIR)/src/share/npt \ @@ -306,8 +311,11 @@ ifneq ($(OPENJDK_TARGET_OS), linux) BUILD_LIBMANAGEMENT_EXCLUDES += LinuxOperatingSystem.c endif +DISABLED_WARNINGS_macosx := ifneq ($(OPENJDK_TARGET_OS), macosx) BUILD_LIBMANAGEMENT_EXCLUDES += MacosxOperatingSystem.c +else + DISABLED_WARNINGS_macosx := -Wno-sometimes-uninitialized -Wno-format-nonliteral -Wno-self-assign endif LIBMANAGEMENT_OPTIMIZATION := HIGH @@ -327,7 +335,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBMANAGEMENT, \ EXCLUDE_FILES := $(BUILD_LIBMANAGEMENT_EXCLUDES), \ LANG := C, \ OPTIMIZATION := $(LIBMANAGEMENT_OPTIMIZATION), \ - CFLAGS := $(CFLAGS_JDKLIB) $(BUILD_LIBMANAGEMENT_CFLAGS), \ + CFLAGS := $(CFLAGS_JDKLIB) $(BUILD_LIBMANAGEMENT_CFLAGS) $(DISABLED_WARNINGS_macosx), \ MAPFILE := $(LIBMANAGEMENT_MAPFILE), \ LDFLAGS := $(LDFLAGS_JDKLIB) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ @@ -369,6 +377,11 @@ ifneq ($(findstring $(OPENJDK_TARGET_OS), solaris linux), ) endif endif +DISABLED_WARNINGS_macosx := +ifeq ($(OPENJDK_TARGET_OS), macosx) + DISABLED_WARNINGS_macosx := -Wno-sometimes-uninitialized -Wno-format-nonliteral -Wno-self-assign +endif + $(eval $(call SetupNativeCompilation,BUILD_LIBHPROF, \ LIBRARY := hprof, \ OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ @@ -376,7 +389,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBHPROF, \ LANG := C, \ OPTIMIZATION := $(LIBHPROF_OPTIMIZATION), \ CFLAGS := $(CFLAGS_JDKLIB) \ - $(BUILD_LIBHPROF_CFLAGS), \ + $(BUILD_LIBHPROF_CFLAGS) $(DISABLED_WARNINGS_macosx), \ CFLAGS_debug := -DHPROF_LOGGING, \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libhprof/mapfile-vers, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ @@ -421,6 +434,11 @@ BUILD_LIBRARIES += $(BUILD_LIBJAVA_CRW_DEMO) ########################################################################################## +DISABLED_WARNINGS_macosx := +ifeq ($(OPENJDK_TARGET_OS), macosx) + DISABLED_WARNINGS_macosx := -Wno-format-nonliteral +endif + ifndef OPENJDK ifeq ($(ENABLE_JFR), true) @@ -430,7 +448,7 @@ ifndef OPENJDK SRC := $(JDK_TOPDIR)/src/closed/share/native/oracle/jfr, \ LANG := C, \ OPTIMIZATION := LOW, \ - CFLAGS := $(CFLAGS_JDKLIB) \ + CFLAGS := $(CFLAGS_JDKLIB) $(DISABLED_WARNINGS_macosx) \ -I$(JDK_TOPDIR)/src/closed/share/javavm/export, \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjfr/mapfile-vers, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ diff --git a/jdk/make/lib/SoundLibraries.gmk b/jdk/make/lib/SoundLibraries.gmk index 96362324fb..2a07900bdd 100644 --- a/jdk/make/lib/SoundLibraries.gmk +++ b/jdk/make/lib/SoundLibraries.gmk @@ -151,6 +151,11 @@ endif LIBJSOUND_CFLAGS += -DEXTRA_SOUND_JNI_LIBS='"$(EXTRA_SOUND_JNI_LIBS)"' +DISABLED_WARNINGS_clang := +ifeq ($(TOOLCHAIN_TYPE), clang) + DISABLED_WARNINGS_clang := -Wno-undef +endif + $(eval $(call SetupNativeCompilation,BUILD_LIBJSOUND, \ LIBRARY := jsound, \ OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ @@ -158,7 +163,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJSOUND, \ INCLUDE_FILES := $(LIBJSOUND_SRC_FILES), \ LANG := $(LIBJSOUND_LANG), \ OPTIMIZATION := LOW, \ - CFLAGS := $(CFLAGS_JDKLIB) \ + CFLAGS := $(CFLAGS_JDKLIB) $(DISABLED_WARNINGS_clang) \ $(LIBJSOUND_CFLAGS), \ CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBJSOUND_CFLAGS), \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjsound/mapfile-vers, \ diff --git a/jdk/src/closed/share/native/sun/font/t2k/t2kstrm.c b/jdk/src/closed/share/native/sun/font/t2k/t2kstrm.c index 7748c4f5a3..7ce0dc6809 100644 --- a/jdk/src/closed/share/native/sun/font/t2k/t2kstrm.c +++ b/jdk/src/closed/share/native/sun/font/t2k/t2kstrm.c @@ -25,7 +25,13 @@ #include "tsimem.h" #include "t2kstrm.h" +#include +#ifdef __APPLE__ +/* use setjmp/longjmp versions that do not save/restore the signal mask */ +#define setjmp _setjmp +#define longjmp _longjmp +#endif #ifdef USE_PRE_CACHING void PreLoadT2KInputStream( InputStream *t, tt_uint32 requestedByteCount ) diff --git a/jdk/src/closed/share/native/sun/font/t2k/truetype.c b/jdk/src/closed/share/native/sun/font/t2k/truetype.c index 748e1ee724..35f8bd3f20 100644 --- a/jdk/src/closed/share/native/sun/font/t2k/truetype.c +++ b/jdk/src/closed/share/native/sun/font/t2k/truetype.c @@ -31,6 +31,14 @@ #include "autogrid.h" #include "ghints.h" +#include + +#ifdef __APPLE__ +/* use setjmp/longjmp versions that do not save/restore the signal mask */ +#define setjmp _setjmp +#define longjmp _longjmp +#endif + /***** ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** *****/ /* * for the flags field diff --git a/jdk/src/closed/share/native/sun/font/t2k/tsimem.h b/jdk/src/closed/share/native/sun/font/t2k/tsimem.h index bf7d4c9a74..745711115d 100644 --- a/jdk/src/closed/share/native/sun/font/t2k/tsimem.h +++ b/jdk/src/closed/share/native/sun/font/t2k/tsimem.h @@ -26,13 +26,8 @@ extern "C" { /* Assume C declarations for C++ */ #endif /* __cplusplus */ #include "syshead.h" -#include -#ifdef __APPLE__ -/* use setjmp/longjmp versions that do not save/restore the signal mask */ -#define setjmp _setjmp -#define longjmp _longjmp -#endif +#include /* #define TRACK_RAM */ diff --git a/jdk/src/closed/share/native/sun/font/t2kScalerMethods.cpp b/jdk/src/closed/share/native/sun/font/t2kScalerMethods.cpp index 8b18fa8f1c..ceb495cc19 100644 --- a/jdk/src/closed/share/native/sun/font/t2kScalerMethods.cpp +++ b/jdk/src/closed/share/native/sun/font/t2kScalerMethods.cpp @@ -110,7 +110,7 @@ Java_sun_font_T2KFontScaler_getGlyphVectorOutlineNative(JNIEnv *env, UInt32 renderFlags = ((context->t2kFlags | T2K_RETURN_OUTLINES) & ~T2K_GRID_FIT); jint *glyphs = NULL; - if (numGlyphs > 0 && 0xffffffffu / sizeof(jint) >= numGlyphs) { + if (numGlyphs > 0 && 0xffffffffu / sizeof(jint) >= (unsigned long)numGlyphs) { glyphs = (jint*)malloc(sizeof(jint)*numGlyphs); } if (glyphs == NULL) { diff --git a/jdk/src/macosx/bin/java_md_macosx.c b/jdk/src/macosx/bin/java_md_macosx.c index b2bed6f9b6..59973c1fe0 100644 --- a/jdk/src/macosx/bin/java_md_macosx.c +++ b/jdk/src/macosx/bin/java_md_macosx.c @@ -619,7 +619,7 @@ GetJREPath(char *path, jint pathsize, const char * arch, jboolean speculative) return JNI_TRUE; } /* ensure storage for path + /jre + NULL */ - if ((JLI_StrLen(path) + 4 + 1) > pathsize) { + if ((JLI_StrLen(path) + 4 + 1) > (size_t) pathsize) { JLI_TraceLauncher("Insufficient space to store JRE path\n"); return JNI_FALSE; } @@ -883,7 +883,7 @@ ContinueInNewThread0(int (JNICALL *continuation)(void *), jlong stack_size, void if (pthread_create(&tid, &attr, (void *(*)(void*))continuation, (void*)args) == 0) { void * tmp; pthread_join(tid, &tmp); - rslt = (int)tmp; + rslt = (int)(intptr_t)tmp; } else { /* * Continue execution in current thread if for some reason (e.g. out of diff --git a/jdk/src/macosx/native/com/apple/eio/CFileManager.m b/jdk/src/macosx/native/com/apple/eio/CFileManager.m index 75693339e9..48d6301146 100644 --- a/jdk/src/macosx/native/com/apple/eio/CFileManager.m +++ b/jdk/src/macosx/native/com/apple/eio/CFileManager.m @@ -218,19 +218,17 @@ JNI_COCOA_ENTER(env); NSString * path = NormalizedPathNSStringFromJavaString(env, url); + NSURL *file_url = [NSURL fileURLWithPath:path]; [ThreadUtilities performOnMainThreadWaiting:YES block:^(){ - NSInteger res = 0; - [[NSWorkspace sharedWorkspace] performFileOperation:NSWorkspaceRecycleOperation - source:[path stringByDeletingLastPathComponent] - destination:nil - files:[NSArray arrayWithObject:[path lastPathComponent]] - tag:&res]; - returnValue = (res == 0); + + returnValue = [[NSFileManager defaultManager] trashItemAtURL:file_url + resultingItemURL:nil + error:nil]; }]; JNI_COCOA_EXIT(env); - return returnValue; + return returnValue ? JNI_TRUE: JNI_FALSE; } /* diff --git a/jdk/src/macosx/native/com/sun/media/sound/PLATFORM_API_MacOSX_Ports.cpp b/jdk/src/macosx/native/com/sun/media/sound/PLATFORM_API_MacOSX_Ports.cpp index 8db89debb8..2f85e16a78 100644 --- a/jdk/src/macosx/native/com/sun/media/sound/PLATFORM_API_MacOSX_Ports.cpp +++ b/jdk/src/macosx/native/com/sun/media/sound/PLATFORM_API_MacOSX_Ports.cpp @@ -421,15 +421,16 @@ static void* CreatePortControl(PortMixer *mixer, PortControlCreator *creator, Po control->audioControls = (AudioControl **)malloc(len * sizeof(AudioControl *)); memcpy(control->audioControls, audioControls + offset, len * sizeof(AudioControl *)); + char title[] = {0}; switch (control->type) { case PortControl::Volume: - jControl = creator->newFloatControl(creator, control, CONTROL_TYPE_VOLUME, 0, 1, precision, ""); + jControl = creator->newFloatControl(creator, control, CONTROL_TYPE_VOLUME, 0, 1, precision, title); break; case PortControl::Mute: jControl = creator->newBooleanControl(creator, control, CONTROL_TYPE_MUTE); break; case PortControl::Balance: - jControl = creator->newFloatControl(creator, control, CONTROL_TYPE_BALANCE, -1, 1, precision, ""); + jControl = creator->newFloatControl(creator, control, CONTROL_TYPE_BALANCE, -1, 1, precision, title); break; }; diff --git a/jdk/src/macosx/native/sun/awt/AWTView.m b/jdk/src/macosx/native/sun/awt/AWTView.m index f12a3f417c..1760d5e94e 100644 --- a/jdk/src/macosx/native/sun/awt/AWTView.m +++ b/jdk/src/macosx/native/sun/awt/AWTView.m @@ -670,7 +670,9 @@ - (NSData *)accessibleSelectedTextAsRTFD { NSString *selectedText = [self accessibilitySelectedText]; NSAttributedString *styledText = [[NSAttributedString alloc] initWithString:selectedText]; - NSData *rtfdData = [styledText RTFDFromRange:NSMakeRange(0, [styledText length]) documentAttributes:nil]; + NSData *rtfdData = [styledText RTFDFromRange:NSMakeRange(0, [styledText length]) + documentAttributes: + @{NSDocumentTypeDocumentAttribute: NSRTFTextDocumentType}]; [styledText release]; return rtfdData; } diff --git a/jdk/src/macosx/native/sun/awt/CGraphicsDevice.m b/jdk/src/macosx/native/sun/awt/CGraphicsDevice.m index 2b0758d856..0a0ef6dd9c 100644 --- a/jdk/src/macosx/native/sun/awt/CGraphicsDevice.m +++ b/jdk/src/macosx/native/sun/awt/CGraphicsDevice.m @@ -209,7 +209,7 @@ static jobject createJavaDisplayMode(CGDisplayModeRef mode, JNIEnv *env, jint di for (NSScreen *screen in screens) { NSDictionary *screenInfo = [screen deviceDescription]; NSNumber *screenID = [screenInfo objectForKey:@"NSScreenNumber"]; - if ([screenID pointerValue] == displayID){ + if ([screenID unsignedIntValue] == displayID){ frame = [screen frame]; visibleFrame = [screen visibleFrame]; break; @@ -342,7 +342,7 @@ static jobject createJavaDisplayMode(CGDisplayModeRef mode, JNIEnv *env, jint di for (NSScreen *screen in screens) { NSDictionary *screenInfo = [screen deviceDescription]; NSNumber *screenID = [screenInfo objectForKey:@"NSScreenNumber"]; - if ([screenID pointerValue] == displayID){ + if ([screenID unsignedIntValue] == displayID){ if ([screen respondsToSelector:@selector(backingScaleFactor)]) { ret = [screen backingScaleFactor]; } diff --git a/jdk/src/macosx/native/sun/awt/CSystemColors.m b/jdk/src/macosx/native/sun/awt/CSystemColors.m index 3ccbd0f226..71b20bb07f 100644 --- a/jdk/src/macosx/native/sun/awt/CSystemColors.m +++ b/jdk/src/macosx/native/sun/awt/CSystemColors.m @@ -134,7 +134,7 @@ + (void)reloadColors { + (NSColor*)getColor:(NSUInteger)colorIndex useAppleColor:(BOOL)useAppleColor { NSColor* result = nil; - if (colorIndex < (useAppleColor) ? sun_lwawt_macosx_LWCToolkit_NUM_APPLE_COLORS : java_awt_SystemColor_NUM_COLORS) { + if (colorIndex < ((useAppleColor) ? sun_lwawt_macosx_LWCToolkit_NUM_APPLE_COLORS : java_awt_SystemColor_NUM_COLORS)) { result = (useAppleColor ? appleColors : sColors)[colorIndex]; } else { diff --git a/jdk/src/macosx/native/sun/awt/LWCToolkit.m b/jdk/src/macosx/native/sun/awt/LWCToolkit.m index cc53350d9d..18943b3cb0 100644 --- a/jdk/src/macosx/native/sun/awt/LWCToolkit.m +++ b/jdk/src/macosx/native/sun/awt/LWCToolkit.m @@ -772,7 +772,7 @@ JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) { // We need to let Foundation know that this is a multithreaded application, if it isn't already. if (![NSThread isMultiThreaded]) { - [NSThread detachNewThreadSelector:nil toTarget:nil withObject:nil]; + [[[[NSThread alloc] init] autorelease] start]; } return JNI_VERSION_1_4; diff --git a/jdk/src/macosx/native/sun/osxapp/NSApplicationAWT.m b/jdk/src/macosx/native/sun/osxapp/NSApplicationAWT.m index 85cda4ae6c..93e82b3f3b 100644 --- a/jdk/src/macosx/native/sun/osxapp/NSApplicationAWT.m +++ b/jdk/src/macosx/native/sun/osxapp/NSApplicationAWT.m @@ -337,7 +337,13 @@ - (void)orderFrontStandardAboutPanelWithOptions:(NSDictionary *)optionsDictionar #define DRAGMASK (NSMouseMovedMask | NSLeftMouseDraggedMask | NSRightMouseDownMask | NSRightMouseDraggedMask | NSLeftMouseUpMask | NSRightMouseUpMask | NSFlagsChangedMask | NSKeyDownMask) -- (NSEvent *)nextEventMatchingMask:(NSUInteger)mask untilDate:(NSDate *)expiration inMode:(NSString *)mode dequeue:(BOOL)deqFlag { +#if defined(MAC_OS_X_VERSION_10_12) && __LP64__ + // 10.12 changed `mask` to NSEventMask (unsigned long long) for x86_64 builds. +- (NSEvent *)nextEventMatchingMask:(NSEventMask)mask +#else +- (NSEvent *)nextEventMatchingMask:(NSUInteger)mask +#endif +untilDate:(NSDate *)expiration inMode:(NSString *)mode dequeue:(BOOL)deqFlag { if (mask == DRAGMASK && [((NSString *)kCFRunLoopDefaultMode) isEqual:mode]) { postEventDuringEventSynthesis = YES; } diff --git a/jdk/src/share/back/EventRequestImpl.c b/jdk/src/share/back/EventRequestImpl.c index 39caeedbc6..6ad52746db 100644 --- a/jdk/src/share/back/EventRequestImpl.c +++ b/jdk/src/share/back/EventRequestImpl.c @@ -84,12 +84,10 @@ readAndSetFilters(JNIEnv *env, PacketInputStream *in, HandlerNode *node, } case JDWP_REQUEST_MODIFIER(LocationOnly): { - jbyte tag; jclass clazz; jmethodID method; jlocation location; - tag = inStream_readByte(in); /* not currently used */ - tag = tag; /* To shut up lint */ + inStream_readByte(in); if ( (serror = inStream_error(in)) != JDWP_ERROR(NONE) ) break; clazz = inStream_readClassRef(env, in); diff --git a/jdk/src/share/back/SDE.c b/jdk/src/share/back/SDE.c index 5c0ac21870..7e386f8b27 100644 --- a/jdk/src/share/back/SDE.c +++ b/jdk/src/share/back/SDE.c @@ -48,8 +48,6 @@ #define BASE_STRATUM_NAME "Java" #define null NULL -#define true JNI_TRUE -#define false JNI_FALSE #define String char * #define private static diff --git a/jdk/src/share/back/error_messages.c b/jdk/src/share/back/error_messages.c index 2ec5bbfa2e..d620796549 100644 --- a/jdk/src/share/back/error_messages.c +++ b/jdk/src/share/back/error_messages.c @@ -140,7 +140,7 @@ jdiAssertionFailed(char *fileName, int lineNumber, char *msg) const char * jvmtiErrorText(jvmtiError error) { - switch (error) { + switch ((int)error) { CASE_RETURN_TEXT(JVMTI_ERROR_NONE) CASE_RETURN_TEXT(JVMTI_ERROR_INVALID_THREAD) CASE_RETURN_TEXT(JVMTI_ERROR_INVALID_THREAD_GROUP) diff --git a/jdk/src/share/back/inStream.c b/jdk/src/share/back/inStream.c index 3c4d5b266d..0fea0ae694 100644 --- a/jdk/src/share/back/inStream.c +++ b/jdk/src/share/back/inStream.c @@ -416,9 +416,9 @@ jvalue inStream_readValue(PacketInputStream *stream, jbyte *typeKeyPtr) { jvalue value; + value.j = 0L; jbyte typeKey = inStream_readByte(stream); if (stream->error) { - value.j = 0L; return value; } diff --git a/jdk/src/share/back/log_messages.c b/jdk/src/share/back/log_messages.c index 32bea2942e..e880487dc8 100644 --- a/jdk/src/share/back/log_messages.c +++ b/jdk/src/share/back/log_messages.c @@ -175,7 +175,7 @@ log_message_end(const char *format, ...) "LOC=%s;PID=%d;THR=t@%d", location_stamp, (int)processPid, - (int)tid); + (int)(intptr_t)tid); /* Construct message string. */ va_start(ap, format); diff --git a/jdk/src/share/back/util.c b/jdk/src/share/back/util.c index 84f9b6e94b..70b93dc431 100644 --- a/jdk/src/share/back/util.c +++ b/jdk/src/share/back/util.c @@ -2124,7 +2124,7 @@ jvmti2EventIndex(jvmtiEvent kind) jdwpError map2jdwpError(jvmtiError error) { - switch ( error ) { + switch ( (int)error ) { case JVMTI_ERROR_NONE: return JDWP_ERROR(NONE); case AGENT_ERROR_INVALID_THREAD: diff --git a/jdk/src/share/bin/main.c b/jdk/src/share/bin/main.c index 677eb6962f..da5b4e7682 100644 --- a/jdk/src/share/bin/main.c +++ b/jdk/src/share/bin/main.c @@ -129,6 +129,6 @@ main(int argc, char **argv) DOT_VERSION, (const_progname != NULL) ? const_progname : *margv, (const_launcher != NULL) ? const_launcher : *margv, - (const_jargs != NULL) ? JNI_TRUE : JNI_FALSE, + const_jargs > 0, const_cpwildcard, const_javaw, const_ergo_class); } diff --git a/jdk/src/share/bin/parse_manifest.c b/jdk/src/share/bin/parse_manifest.c index 4926824e36..4a29dd5c99 100644 --- a/jdk/src/share/bin/parse_manifest.c +++ b/jdk/src/share/bin/parse_manifest.c @@ -232,7 +232,7 @@ compute_cen(int fd, Byte *bp) Byte *p; jlong base_offset; jlong offset; - char buffer[MINREAD]; + Byte buffer[MINREAD]; p = buffer; /* * Read the END Header, which is the starting point for ZIP files. diff --git a/jdk/src/share/bin/splashscreen_stubs.c b/jdk/src/share/bin/splashscreen_stubs.c index 9c1f5148c4..666634f6d2 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) { diff --git a/jdk/src/share/demo/jvmti/compiledMethodLoad/compiledMethodLoad.c b/jdk/src/share/demo/jvmti/compiledMethodLoad/compiledMethodLoad.c index 0f78bc953f..dbafab81fe 100644 --- a/jdk/src/share/demo/jvmti/compiledMethodLoad/compiledMethodLoad.c +++ b/jdk/src/share/demo/jvmti/compiledMethodLoad/compiledMethodLoad.c @@ -143,7 +143,7 @@ print_inline_info_record(jvmtiCompiledMethodLoadInlineRecord* record, for (i = 0; i < numpcs; i++) { PCStackInfo pcrecord = (record->pcinfo[i]); - fprintf(fp, "PcDescriptor(pc=0x%lx):\n", (jint)(pcrecord.pc)); + fprintf(fp, "PcDescriptor(pc=0x%lx):\n", (unsigned long)pcrecord.pc); print_stack_frames(&pcrecord, jvmti, fp); } } 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 e9109cbec9..19c4abedd4 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. diff --git a/jdk/src/share/native/com/sun/java/util/jar/pack/unpack.cpp b/jdk/src/share/native/com/sun/java/util/jar/pack/unpack.cpp index 56f391b1e8..9b8a7c5e8d 100644 --- a/jdk/src/share/native/com/sun/java/util/jar/pack/unpack.cpp +++ b/jdk/src/share/native/com/sun/java/util/jar/pack/unpack.cpp @@ -733,7 +733,7 @@ void unpacker::read_file_header() { abort("impossible archive size"); // bad input data return; } - if (archive_size < header_size_1) { + if (archive_size < (size_t)header_size_1) { abort("too much read-ahead"); // somehow we pre-fetched too much? return; } @@ -985,7 +985,7 @@ void cpool::init(unpacker* u_, int counts[CONSTANT_Limit]) { } // Initialize *all* our entries once - for (int i = 0 ; i < maxentries ; i++) + for (size_t i = 0 ; i < maxentries ; i++) entries[i].outputIndex = REQUESTED_NONE; initGroupIndexes(); @@ -3716,7 +3716,7 @@ char* entry::string() { default: if (nrefs == 0) { buf = getbuf(20); - sprintf((char*)buf.ptr, TAG_NAME[tag]); + sprintf((char*)buf.ptr, "%s", TAG_NAME[tag]); } else if (nrefs == 1) { return refs[0]->string(); } else { diff --git a/jdk/src/share/native/com/sun/java/util/jar/pack/utils.cpp b/jdk/src/share/native/com/sun/java/util/jar/pack/utils.cpp index e5197e1a3f..40a10055ea 100644 --- a/jdk/src/share/native/com/sun/java/util/jar/pack/utils.cpp +++ b/jdk/src/share/native/com/sun/java/util/jar/pack/utils.cpp @@ -81,7 +81,7 @@ void breakpoint() { } // hook for debugger int assert_failed(const char* p) { char message[1<<12]; sprintf(message, "@assert failed: %s\n", p); - fprintf(stdout, 1+message); + fprintf(stdout, "%s", 1+message); breakpoint(); unpack_abort(message); return 0; diff --git a/jdk/src/share/native/java/lang/fdlibm/src/e_pow.c b/jdk/src/share/native/java/lang/fdlibm/src/e_pow.c index 13923f8d06..336c5f259e 100644 --- a/jdk/src/share/native/java/lang/fdlibm/src/e_pow.c +++ b/jdk/src/share/native/java/lang/fdlibm/src/e_pow.c @@ -146,7 +146,7 @@ ivln2_l = 1.92596299112661746887e-08; /* 0x3E54AE0B, 0xF85DDF44 =1/ln2 tail*/ k = (iy>>20)-0x3ff; /* exponent */ if(k>20) { j = ly>>(52-k); - if((j<<(52-k))==ly) yisint = 2-(j&1); + if((unsigned)(j<<(52-k))==ly) yisint = 2-(j&1); } else if(ly==0) { j = iy>>(20-k); if((j<<(20-k))==iy) yisint = 2-(j&1); diff --git a/jdk/src/share/native/java/net/net_util.c b/jdk/src/share/native/java/net/net_util.c index b1b8223a63..6210c10887 100644 --- a/jdk/src/share/native/java/net/net_util.c +++ b/jdk/src/share/native/java/net/net_util.c @@ -230,7 +230,8 @@ NET_SockaddrToInetAddress(JNIEnv *env, struct sockaddr *him, int *port) { iaObj = (*env)->NewObject(env, ia6_class, ia6_ctrID); CHECK_NULL_RETURN(iaObj, NULL); ret = setInet6Address_ipaddress(env, iaObj, (char *)&(him6->sin6_addr)); - CHECK_NULL_RETURN(ret, NULL); + if (ret == JNI_FALSE) + return NULL; setInetAddress_family(env, iaObj, IPv6); JNU_CHECK_EXCEPTION_RETURN(env, NULL); scope = getScopeID(him); diff --git a/jdk/src/share/native/java/util/zip/zip_util.c b/jdk/src/share/native/java/util/zip/zip_util.c index 3245dea506..e05417a217 100644 --- a/jdk/src/share/native/java/util/zip/zip_util.c +++ b/jdk/src/share/native/java/util/zip/zip_util.c @@ -1420,7 +1420,7 @@ InflateFully(jzfile *zip, jzentry *entry, void *buf, char **msg) case Z_OK: break; case Z_STREAM_END: - if (count != 0 || strm.total_out != entry->size) { + if (count != 0 || strm.total_out != (uInt)entry->size) { *msg = "inflateFully: Unexpected end of stream"; inflateEnd(&strm); return JNI_FALSE; diff --git a/jdk/src/share/native/sun/awt/giflib/dgif_lib.c b/jdk/src/share/native/sun/awt/giflib/dgif_lib.c index 6ddfb46060..468bf09a97 100644 --- a/jdk/src/share/native/sun/awt/giflib/dgif_lib.c +++ b/jdk/src/share/native/sun/awt/giflib/dgif_lib.c @@ -413,7 +413,7 @@ DGifGetImageHeader(GifFileType *GifFile) } /* Does this image have local color map? */ if (Buf[0] & 0x80) { - unsigned int i; + int i; GifFile->Image.ColorMap = GifMakeMapObject(1 << BitsPerPixel, NULL); if (GifFile->Image.ColorMap == NULL) { diff --git a/jdk/src/share/native/sun/awt/image/awt_parseImage.c b/jdk/src/share/native/sun/awt/image/awt_parseImage.c index 882c799efc..4b6b24183b 100644 --- a/jdk/src/share/native/sun/awt/image/awt_parseImage.c +++ b/jdk/src/share/native/sun/awt/image/awt_parseImage.c @@ -852,7 +852,7 @@ setHints(JNIEnv *env, BufImageS_t *imageP) { hintP->needToExpand = TRUE; hintP->expandToNbits = cmodelP->maxNbits; } - else if (rasterP->sppsm.offsets != NULL) { + else { for (i=0; i < rasterP->numBands; i++) { if (!(rasterP->sppsm.offsets[i] % 8)) { hintP->needToExpand = TRUE; 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 7e1d8c99d7..163003c0fb 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++) { diff --git a/jdk/src/share/native/sun/awt/image/jpeg/jdhuff.c b/jdk/src/share/native/sun/awt/image/jpeg/jdhuff.c index d554bb3d5c..1d0f8d5678 100644 --- a/jdk/src/share/native/sun/awt/image/jpeg/jdhuff.c +++ b/jdk/src/share/native/sun/awt/image/jpeg/jdhuff.c @@ -455,10 +455,15 @@ static const int extend_test[16] = /* entry n is 2**(n-1) */ 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000 }; static const int extend_offset[16] = /* entry n is (-1 << n) + 1 */ - { 0, ((-1)<<1) + 1, ((-1)<<2) + 1, ((-1)<<3) + 1, ((-1)<<4) + 1, - ((-1)<<5) + 1, ((-1)<<6) + 1, ((-1)<<7) + 1, ((-1)<<8) + 1, - ((-1)<<9) + 1, ((-1)<<10) + 1, ((-1)<<11) + 1, ((-1)<<12) + 1, - ((-1)<<13) + 1, ((-1)<<14) + 1, ((-1)<<15) + 1 }; + { 0, + (int)(((unsigned)(~0)<<1) + 1), (int)(((unsigned)(~0)<<2) + 1), + (int)(((unsigned)(~0)<<3) + 1), (int)(((unsigned)(~0)<<4) + 1), + (int)(((unsigned)(~0)<<5) + 1), (int)(((unsigned)(~0)<<6) + 1), + (int)(((unsigned)(~0)<<7) + 1), (int)(((unsigned)(~0)<<8) + 1), + (int)(((unsigned)(~0)<<9) + 1), (int)(((unsigned)(~0)<<10) + 1), + (int)(((unsigned)(~0)<<11) + 1), (int)(((unsigned)(~0)<<12) + 1), + (int)(((unsigned)(~0)<<13) + 1), (int)(((unsigned)(~0)<<14) + 1), + (int)(((unsigned)(~0)<<15) + 1) }; #endif /* AVOID_TABLES */ diff --git a/jdk/src/share/native/sun/awt/image/jpeg/jdphuff.c b/jdk/src/share/native/sun/awt/image/jpeg/jdphuff.c index 8301209681..ba589d7543 100644 --- a/jdk/src/share/native/sun/awt/image/jpeg/jdphuff.c +++ b/jdk/src/share/native/sun/awt/image/jpeg/jdphuff.c @@ -215,10 +215,15 @@ static const int extend_test[16] = /* entry n is 2**(n-1) */ 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000 }; static const int extend_offset[16] = /* entry n is (-1 << n) + 1 */ - { 0, ((-1)<<1) + 1, ((-1)<<2) + 1, ((-1)<<3) + 1, ((-1)<<4) + 1, - ((-1)<<5) + 1, ((-1)<<6) + 1, ((-1)<<7) + 1, ((-1)<<8) + 1, - ((-1)<<9) + 1, ((-1)<<10) + 1, ((-1)<<11) + 1, ((-1)<<12) + 1, - ((-1)<<13) + 1, ((-1)<<14) + 1, ((-1)<<15) + 1 }; + { 0, + (int)(((unsigned)(~0)<<1) + 1), (int)(((unsigned)(~0)<<2) + 1), + (int)(((unsigned)(~0)<<3) + 1), (int)(((unsigned)(~0)<<4) + 1), + (int)(((unsigned)(~0)<<5) + 1), (int)(((unsigned)(~0)<<6) + 1), + (int)(((unsigned)(~0)<<7) + 1), (int)(((unsigned)(~0)<<8) + 1), + (int)(((unsigned)(~0)<<9) + 1), (int)(((unsigned)(~0)<<10) + 1), + (int)(((unsigned)(~0)<<11) + 1), (int)(((unsigned)(~0)<<12) + 1), + (int)(((unsigned)(~0)<<13) + 1), (int)(((unsigned)(~0)<<14) + 1), + (int)(((unsigned)(~0)<<15) + 1) }; #endif /* AVOID_TABLES */ diff --git a/jdk/src/share/native/sun/font/layout/AlternateSubstSubtables.cpp b/jdk/src/share/native/sun/font/layout/AlternateSubstSubtables.cpp index baf897d9d8..8dd7ca7dfd 100644 --- a/jdk/src/share/native/sun/font/layout/AlternateSubstSubtables.cpp +++ b/jdk/src/share/native/sun/font/layout/AlternateSubstSubtables.cpp @@ -44,7 +44,7 @@ le_uint32 AlternateSubstitutionSubtable::process(const LEReferenceTogetCurrGlyphID(); - le_int32 coverageIndex = getGlyphCoverage(base, glyph, success); + size_t coverageIndex = getGlyphCoverage(base, glyph, success); if (LE_SUCCESS(success)) { le_uint16 altSetCount = SWAPW(alternateSetCount); diff --git a/jdk/src/share/native/sun/font/layout/IndicRearrangementProcessor2.cpp b/jdk/src/share/native/sun/font/layout/IndicRearrangementProcessor2.cpp index 8692312ecd..288479d088 100644 --- a/jdk/src/share/native/sun/font/layout/IndicRearrangementProcessor2.cpp +++ b/jdk/src/share/native/sun/font/layout/IndicRearrangementProcessor2.cpp @@ -45,7 +45,8 @@ UOBJECT_DEFINE_RTTI_IMPLEMENTATION(IndicRearrangementProcessor2) IndicRearrangementProcessor2::IndicRearrangementProcessor2( const LEReferenceTo &morphSubtableHeader, LEErrorCode &success) - : StateTableProcessor2(morphSubtableHeader, success), indicRearrangementSubtableHeader(morphSubtableHeader, success), + : StateTableProcessor2(morphSubtableHeader, success), + indicRearrangementSubtableHeader(morphSubtableHeader, success), entryTable(stHeader, success, entryTableOffset, LE_UNBOUNDED_ARRAY) { } diff --git a/jdk/src/share/native/sun/font/layout/IndicRearrangementProcessor2.h b/jdk/src/share/native/sun/font/layout/IndicRearrangementProcessor2.h index 691274c6da..52a6df25a9 100644 --- a/jdk/src/share/native/sun/font/layout/IndicRearrangementProcessor2.h +++ b/jdk/src/share/native/sun/font/layout/IndicRearrangementProcessor2.h @@ -79,8 +79,8 @@ protected: le_int32 firstGlyph; le_int32 lastGlyph; - LEReferenceToArrayOf entryTable; LEReferenceTo indicRearrangementSubtableHeader; + LEReferenceToArrayOf entryTable; }; diff --git a/jdk/src/share/native/sun/font/layout/LEInsertionList.h b/jdk/src/share/native/sun/font/layout/LEInsertionList.h index 231b5f6330..56f96883f0 100644 --- a/jdk/src/share/native/sun/font/layout/LEInsertionList.h +++ b/jdk/src/share/native/sun/font/layout/LEInsertionList.h @@ -101,7 +101,7 @@ public: /** * The destructor. */ - ~LEInsertionList(); + virtual ~LEInsertionList(); /** * Add an entry to the insertion list. diff --git a/jdk/src/share/native/sun/font/layout/LETypes.h b/jdk/src/share/native/sun/font/layout/LETypes.h index d86a0aa44f..80da788d38 100644 --- a/jdk/src/share/native/sun/font/layout/LETypes.h +++ b/jdk/src/share/native/sun/font/layout/LETypes.h @@ -384,7 +384,7 @@ typedef struct LEPoint LEPoint; /** * Range check for overflow */ -#define LE_RANGE_CHECK(type, count, ptrfn) (( (LE_UINTPTR_MAX / sizeof(type)) < count ) ? NULL : (ptrfn)) +#define LE_RANGE_CHECK(type, count, ptrfn) ((count < 0) ? NULL : (( (LE_UINTPTR_MAX / sizeof(type)) < (size_t)count ) ? NULL : (ptrfn))) /** * A convenience macro to get the length of an array. * diff --git a/jdk/src/share/native/sun/font/layout/LigatureSubstProc.cpp b/jdk/src/share/native/sun/font/layout/LigatureSubstProc.cpp index 111346224e..2c1678e2e3 100644 --- a/jdk/src/share/native/sun/font/layout/LigatureSubstProc.cpp +++ b/jdk/src/share/native/sun/font/layout/LigatureSubstProc.cpp @@ -129,7 +129,7 @@ ByteOffset LigatureSubstitutionProcessor::processStateEntry(LEGlyphStorage &glyp LE_DEBUG_BAD_FONT("off end of ligature substitution header"); return newState; // get out! bad font } - if(componentGlyph >= glyphStorage.getGlyphCount()) { + if(componentGlyph >= (le_uint32)glyphStorage.getGlyphCount()) { LE_DEBUG_BAD_FONT("preposterous componentGlyph"); currGlyph++; return newState; // get out! bad font diff --git a/jdk/src/share/native/sun/font/layout/LigatureSubstProc2.cpp b/jdk/src/share/native/sun/font/layout/LigatureSubstProc2.cpp index 20c73d4d8b..57e44f8fc7 100644 --- a/jdk/src/share/native/sun/font/layout/LigatureSubstProc2.cpp +++ b/jdk/src/share/native/sun/font/layout/LigatureSubstProc2.cpp @@ -49,8 +49,7 @@ UOBJECT_DEFINE_RTTI_IMPLEMENTATION(LigatureSubstitutionProcessor2) LigatureSubstitutionProcessor2::LigatureSubstitutionProcessor2(const LEReferenceTo &morphSubtableHeader, LEErrorCode &success) : StateTableProcessor2(morphSubtableHeader, success), - ligActionOffset(0), - ligatureSubstitutionHeader(morphSubtableHeader, success), componentOffset(0), ligatureOffset(0), entryTable() + ligActionOffset(0), componentOffset(0), ligatureOffset(0), ligatureSubstitutionHeader(morphSubtableHeader, success), entryTable() { if (LE_FAILURE(success)) return; @@ -131,7 +130,7 @@ le_uint16 LigatureSubstitutionProcessor2::processStateEntry(LEGlyphStorage &glyp offset = action & lafComponentOffsetMask; if (offset != 0) { - if(componentGlyph >= glyphStorage.getGlyphCount()) { + if(componentGlyph >= (le_uint32)glyphStorage.getGlyphCount()) { LE_DEBUG_BAD_FONT("preposterous componentGlyph"); currGlyph+= dir; return nextStateIndex; // get out! bad font diff --git a/jdk/src/share/native/sun/font/layout/LigatureSubstProc2.h b/jdk/src/share/native/sun/font/layout/LigatureSubstProc2.h index 2edfa903d2..2f2ca13885 100644 --- a/jdk/src/share/native/sun/font/layout/LigatureSubstProc2.h +++ b/jdk/src/share/native/sun/font/layout/LigatureSubstProc2.h @@ -84,12 +84,11 @@ protected: le_uint32 componentOffset; le_uint32 ligatureOffset; - LEReferenceToArrayOf entryTable; - le_int32 componentStack[nComponents]; le_int16 m; const LEReferenceTo ligatureSubstitutionHeader; + LEReferenceToArrayOf entryTable; }; diff --git a/jdk/src/share/native/sun/font/layout/SingleSubstitutionSubtables.cpp b/jdk/src/share/native/sun/font/layout/SingleSubstitutionSubtables.cpp index ccbc0523d3..340443021b 100644 --- a/jdk/src/share/native/sun/font/layout/SingleSubstitutionSubtables.cpp +++ b/jdk/src/share/native/sun/font/layout/SingleSubstitutionSubtables.cpp @@ -89,7 +89,7 @@ le_uint32 SingleSubstitutionFormat1Subtable::process(const LEReferenceTo &base, GlyphIterator *glyphIterator, LEErrorCode &success, const LEGlyphFilter *filter) const { LEGlyphID glyph = glyphIterator->getCurrGlyphID(); - le_int32 coverageIndex = getGlyphCoverage(base, glyph, success); + le_uint32 coverageIndex = getGlyphCoverage(base, glyph, success); if (LE_FAILURE(success)) { return 0; } diff --git a/jdk/src/share/native/sun/font/layout/StateTableProcessor2.cpp b/jdk/src/share/native/sun/font/layout/StateTableProcessor2.cpp index ab74b239d7..f53ac2b597 100644 --- a/jdk/src/share/native/sun/font/layout/StateTableProcessor2.cpp +++ b/jdk/src/share/native/sun/font/layout/StateTableProcessor2.cpp @@ -48,8 +48,8 @@ StateTableProcessor2::StateTableProcessor2() StateTableProcessor2::StateTableProcessor2(const LEReferenceTo &morphSubtableHeader, LEErrorCode &success) : SubtableProcessor2(morphSubtableHeader, success), stateTableHeader(morphSubtableHeader, success), stHeader(stateTableHeader, success, (const StateTableHeader2*)&stateTableHeader->stHeader), - nClasses(0), classTableOffset(0), stateArrayOffset(0), entryTableOffset(0), classTable(), format(0), - stateArray() + nClasses(0), classTableOffset(0), stateArrayOffset(0), entryTableOffset(0), format(0), + classTable(), stateArray() { if (LE_FAILURE(success)) { return; diff --git a/jdk/src/share/native/sun/font/layout/StateTableProcessor2.h b/jdk/src/share/native/sun/font/layout/StateTableProcessor2.h index db5056c94b..bb43cfc279 100644 --- a/jdk/src/share/native/sun/font/layout/StateTableProcessor2.h +++ b/jdk/src/share/native/sun/font/layout/StateTableProcessor2.h @@ -64,17 +64,18 @@ protected: StateTableProcessor2(); + LEReferenceTo stateTableHeader; + LEReferenceTo stHeader; // for convenience + le_int32 dir; - le_uint16 format; le_uint32 nClasses; le_uint32 classTableOffset; le_uint32 stateArrayOffset; le_uint32 entryTableOffset; + le_uint16 format; LEReferenceTo classTable; LEReferenceToArrayOf stateArray; - LEReferenceTo stateTableHeader; - LEReferenceTo stHeader; // for convenience private: StateTableProcessor2(const StateTableProcessor2 &other); // forbid copying of this class diff --git a/jdk/src/share/native/sun/font/layout/SubtableProcessor2.h b/jdk/src/share/native/sun/font/layout/SubtableProcessor2.h index 42ef68b592..4a5d1649d0 100644 --- a/jdk/src/share/native/sun/font/layout/SubtableProcessor2.h +++ b/jdk/src/share/native/sun/font/layout/SubtableProcessor2.h @@ -54,12 +54,12 @@ protected: SubtableProcessor2(); + const LEReferenceTo subtableHeader; + le_uint32 length; SubtableCoverage2 coverage; FeatureFlags subtableFeatures; - const LEReferenceTo subtableHeader; - private: SubtableProcessor2(const SubtableProcessor2 &other); // forbid copying of this class diff --git a/jdk/src/share/native/sun/security/ec/impl/mpi.c b/jdk/src/share/native/sun/security/ec/impl/mpi.c index 1add21e51a..92d70b24cb 100644 --- a/jdk/src/share/native/sun/security/ec/impl/mpi.c +++ b/jdk/src/share/native/sun/security/ec/impl/mpi.c @@ -2194,7 +2194,7 @@ mp_err s_mp_fixup_reciprocal(const mp_int *c, const mp_int *p, int k, mp_int *x r = 0 - s_mp_invmod_radix(MP_DIGIT(p,0)); for (ix = 0; k > 0; ix++) { - int j = MP_MIN(k, MP_DIGIT_BIT); + size_t j = MP_MIN((size_t)k, MP_DIGIT_BIT); mp_digit v = r * MP_DIGIT(x, ix); if (j < MP_DIGIT_BIT) { v &= ((mp_digit)1 << j) - 1; /* v = v mod (2 ** j) */ @@ -2963,7 +2963,7 @@ mp_err s_mp_lshd(mp_int *mp, mp_size p) { mp_err res; mp_size pos; - int ix; + size_t ix; if(p == 0) return MP_OKAY; diff --git a/jdk/src/share/native/sun/tracing/dtrace/JVM.c b/jdk/src/share/native/sun/tracing/dtrace/JVM.c index ba54d8ecb4..44ab612433 100644 --- a/jdk/src/share/native/sun/tracing/dtrace/JVM.c +++ b/jdk/src/share/native/sun/tracing/dtrace/JVM.c @@ -297,7 +297,7 @@ Java_sun_tracing_dtrace_JVM_defineClass0( if (name != NULL) { int i; - int len = (*env)->GetStringUTFLength(env, name); + size_t len = (*env)->GetStringUTFLength(env, name); int unicode_len = (*env)->GetStringLength(env, name); if (len >= sizeof(buf)) { utfName = malloc(len + 1); diff --git a/jdk/src/solaris/native/java/lang/UNIXProcess_md.c b/jdk/src/solaris/native/java/lang/UNIXProcess_md.c index 9b510ad3a9..5469723f84 100644 --- a/jdk/src/solaris/native/java/lang/UNIXProcess_md.c +++ b/jdk/src/solaris/native/java/lang/UNIXProcess_md.c @@ -429,7 +429,12 @@ vforkChild(ChildStuff *c) { * as suggested by the scary gcc warning: * warning: variable 'foo' might be clobbered by 'longjmp' or 'vfork' */ +/* vfork(2) is deprecated on Darwin */ +#ifndef __APPLE__ resultPid = vfork(); +#else + resultPid = fork(); +#endif if (resultPid == 0) { childProcess(c); diff --git a/jdk/src/solaris/native/java/net/Inet6AddressImpl.c b/jdk/src/solaris/native/java/net/Inet6AddressImpl.c index 0a51a365fd..c57cbd9f60 100644 --- a/jdk/src/solaris/native/java/net/Inet6AddressImpl.c +++ b/jdk/src/solaris/native/java/net/Inet6AddressImpl.c @@ -787,7 +787,7 @@ Java_java_net_Inet6AddressImpl_isReachable0(JNIEnv *env, jobject this, &optlen) <0) { connect_rv = errno; } - if (connect_rv == 0 || ECONNREFUSED) { + if (connect_rv == 0 || connect_rv == ECONNREFUSED) { close(fd); return JNI_TRUE; } diff --git a/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c b/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c index 6bbe75c1a4..3bc1cbadae 100644 --- a/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c +++ b/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c @@ -601,7 +601,7 @@ Java_java_net_PlainDatagramSocketImpl_peekData(JNIEnv *env, jobject this, int n; SOCKADDR remote_addr; int len; - int port; + int port = -1; if (IS_NULL(fdObj)) { JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", diff --git a/jdk/src/solaris/native/java/net/net_util_md.c b/jdk/src/solaris/native/java/net/net_util_md.c index bd0bd8c2c9..2b9ab02050 100644 --- a/jdk/src/solaris/native/java/net/net_util_md.c +++ b/jdk/src/solaris/native/java/net/net_util_md.c @@ -429,7 +429,7 @@ void ThrowUnknownHostExceptionWithGaiError(JNIEnv *env, { int size; char *buf; - const char *format = "%s: %s"; + const char * const format = "%s: %s"; const char *error_string = gai_strerror(gai_error); if (error_string == NULL) error_string = "unknown error";