8074827: Resolve disabled warnings for libjavajpeg
authorprr
Tue, 26 Jul 2016 11:30:40 -0700
changeset 40151 396a601f5f8e
parent 40150 b4177fc65b33
child 40152 35cbab101a76
8074827: Resolve disabled warnings for libjavajpeg Reviewed-by: serb, psadhukhan
jdk/make/lib/Awt2dLibraries.gmk
jdk/src/java.desktop/share/native/libjavajpeg/imageioJPEG.c
jdk/src/java.desktop/share/native/libjavajpeg/jpegdecoder.c
--- a/jdk/make/lib/Awt2dLibraries.gmk	Tue Jul 26 18:45:05 2016 +0300
+++ b/jdk/make/lib/Awt2dLibraries.gmk	Tue Jul 26 11:30:40 2016 -0700
@@ -498,9 +498,7 @@
     CFLAGS := $(CFLAGS_JDKLIB) $(BUILD_LIBJAVAJPEG_HEADERS) \
         $(LIBJAVA_HEADER_FLAGS) \
         -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop, \
-    DISABLED_WARNINGS_gcc := clobbered parentheses array-bounds shift-negative-value, \
-    DISABLED_WARNINGS_clang := logical-op-parentheses, \
-    DISABLED_WARNINGS_microsoft := 4267, \
+    DISABLED_WARNINGS_gcc := clobbered, \
     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjpeg/mapfile-vers, \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
--- a/jdk/src/java.desktop/share/native/libjavajpeg/imageioJPEG.c	Tue Jul 26 18:45:05 2016 +0300
+++ b/jdk/src/java.desktop/share/native/libjavajpeg/imageioJPEG.c	Tue Jul 26 11:30:40 2016 -0700
@@ -952,7 +952,7 @@
                                 sb->hstreamBuffer, 0,
                                 sb->bufferLength);
     if ((ret > 0) && ((unsigned int)ret > sb->bufferLength)) {
-         ret = sb->bufferLength;
+         ret = (int)sb->bufferLength;
     }
     if ((*env)->ExceptionOccurred(env)
         || !GET_ARRAYS(env, data, &(src->next_input_byte))) {
@@ -1050,7 +1050,7 @@
                                 JPEGImageReader_readInputDataID,
                                 sb->hstreamBuffer,
                                 offset, buflen);
-    if ((ret > 0) && ((unsigned int)ret > buflen)) ret = buflen;
+    if ((ret > 0) && ((unsigned int)ret > buflen)) ret = (int)buflen;
     if ((*env)->ExceptionOccurred(env)
         || !GET_ARRAYS(env, data, &(src->next_input_byte))) {
         cinfo->err->error_exit((j_common_ptr) cinfo);
@@ -1774,8 +1774,8 @@
             v_samp1 = cinfo->comp_info[1].v_samp_factor;
             v_samp2 = cinfo->comp_info[2].v_samp_factor;
 
-            if ((h_samp1 > h_samp0) && (h_samp2 > h_samp0) ||
-                (v_samp1 > v_samp0) && (v_samp2 > v_samp0))
+            if (((h_samp1 > h_samp0) && (h_samp2 > h_samp0)) ||
+                ((v_samp1 > v_samp0) && (v_samp2 > v_samp0)))
             {
                 cinfo->jpeg_color_space = JCS_YCCK;
                 /* Leave the output space as CMYK */
@@ -1866,7 +1866,6 @@
     pixelBufferPtr pb;
     sun_jpeg_error_ptr jerr;
     boolean done;
-    boolean mustScale = FALSE;
     boolean progressive = FALSE;
     boolean orderedBands = TRUE;
     imageIODataPtr data = (imageIODataPtr)jlong_to_ptr(ptr);
--- a/jdk/src/java.desktop/share/native/libjavajpeg/jpegdecoder.c	Tue Jul 26 18:45:05 2016 +0300
+++ b/jdk/src/java.desktop/share/native/libjavajpeg/jpegdecoder.c	Tue Jul 26 11:30:40 2016 -0700
@@ -358,7 +358,7 @@
     }
     ret = (*env)->CallIntMethod(env, src->hInputStream, InputStream_readID,
                                 src->hInputBuffer, offset, buflen);
-    if ((ret > 0) && ((unsigned int)ret > buflen)) ret = buflen;
+    if ((ret > 0) && ((unsigned int)ret > buflen)) ret = (int)buflen;
     if ((*env)->ExceptionOccurred(env) || !GET_ARRAYS(env, src)) {
         cinfo->err->error_exit((struct jpeg_common_struct *) cinfo);
     }