changeset 17338:f95446136b0d

8074843: Resolve disabled warnings for libmlib_image and libmlib_image_v Reviewed-by: vadim, psadhukhan
author prr
date Tue, 02 Aug 2016 10:43:31 -0700
parents 196d2bbc11a2
children 23cce09f8925
files make/lib/Awt2dLibraries.gmk src/java.desktop/share/native/libmlib_image/mlib_ImageAffine_NN_Bit.c src/java.desktop/share/native/libmlib_image/mlib_ImageConv.h src/java.desktop/share/native/libmlib_image/mlib_c_ImageConv.h src/java.desktop/share/native/libmlib_image/mlib_c_ImageCopy.c
diffstat 5 files changed, 10 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/make/lib/Awt2dLibraries.gmk	Tue Aug 02 16:14:59 2016 +0530
+++ b/make/lib/Awt2dLibraries.gmk	Tue Aug 02 10:43:31 2016 -0700
@@ -56,9 +56,6 @@
     OPTIMIZATION := HIGHEST, \
     CFLAGS := $(CFLAGS_JDKLIB) \
         $(BUILD_LIBMLIB_CFLAGS), \
-    DISABLED_WARNINGS_gcc := parentheses array-bounds, \
-    DISABLED_WARNINGS_clang := parentheses, \
-    DISABLED_WARNINGS_solstudio := E_STATEMENT_NOT_REACHED, \
     MAPFILE := $(BUILD_LIBMLIB_IMAGE_MAPFILE), \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
@@ -119,7 +116,6 @@
       CFLAGS := -xarch=sparcvis \
           $(LIBMLIB_IMAGE_V_CFLAGS) \
           $(CFLAGS_JDKLIB), \
-      DISABLED_WARNINGS_solstudio := E_STATEMENT_NOT_REACHED, \
       MAPFILE := $(BUILD_LIBMLIB_IMAGE_MAPFILE), \
       LDFLAGS := $(LDFLAGS_JDKLIB) \
           $(call SET_SHARED_LIBRARY_ORIGIN), \
--- a/src/java.desktop/share/native/libmlib_image/mlib_ImageAffine_NN_Bit.c	Tue Aug 02 16:14:59 2016 +0530
+++ b/src/java.desktop/share/native/libmlib_image/mlib_ImageAffine_NN_Bit.c	Tue Aug 02 10:43:31 2016 -0700
@@ -84,8 +84,7 @@
         ySrc = MLIB_POINTER_SHIFT(Y);
         srcPixelPtr = MLIB_POINTER_GET(lineAddr, ySrc);
 
-        res = (res & ~(1 << bit)) | (((srcPixelPtr[X >> (MLIB_SHIFT + 3)] >> (7 - (X >> MLIB_SHIFT) & 7)) & 1) <<
-           bit);
+        res = (res & ~(1 << bit)) | (((srcPixelPtr[X >> (MLIB_SHIFT + 3)] >> (7 - ((X >> MLIB_SHIFT) & 7))) & 1) << bit);
 
         X += dX;
         Y += dY;
@@ -150,7 +149,7 @@
         ySrc = MLIB_POINTER_SHIFT(Y);
         srcPixelPtr = MLIB_POINTER_GET(lineAddr, ySrc);
 
-        res = (res & ~(1 << bit)) | (((srcPixelPtr[X >> (MLIB_SHIFT + 3)] >> (7 - (X >> MLIB_SHIFT) & 7)) & 1) << bit);
+        res = (res & ~(1 << bit)) | (((srcPixelPtr[X >> (MLIB_SHIFT + 3)] >> (7 - ((X >> MLIB_SHIFT) & 7))) & 1) << bit);
 
         X += dX;
         Y += dY;
--- a/src/java.desktop/share/native/libmlib_image/mlib_ImageConv.h	Tue Aug 02 16:14:59 2016 +0530
+++ b/src/java.desktop/share/native/libmlib_image/mlib_ImageConv.h	Tue Aug 02 10:43:31 2016 -0700
@@ -34,11 +34,9 @@
 // Shared macro defined for cleanup of allocated memory.
 #ifndef FREE_AND_RETURN_STATUS
 #define FREE_AND_RETURN_STATUS \
-{ \
 if (pbuff != buff) mlib_free(pbuff); \
 if (k != akernel) mlib_free(k); \
-return status; \
-}
+return status
 #endif /* FREE_AND_RETURN_STATUS */
 
 mlib_status mlib_convMxNext_s32(mlib_image       *dst,
--- a/src/java.desktop/share/native/libmlib_image/mlib_c_ImageConv.h	Tue Aug 02 16:14:59 2016 +0530
+++ b/src/java.desktop/share/native/libmlib_image/mlib_c_ImageConv.h	Tue Aug 02 10:43:31 2016 -0700
@@ -34,11 +34,9 @@
 // Shared macro defined for cleanup of allocated memory.
 #ifndef FREE_AND_RETURN_STATUS
 #define FREE_AND_RETURN_STATUS \
-{ \
 if (pbuff != buff) mlib_free(pbuff); \
 if (k != akernel) mlib_free(k); \
-return status; \
-}
+return status
 #endif /* FREE_AND_RETURN_STATUS */
 
 mlib_status mlib_c_convMxNnw_u8(mlib_image       *dst,
--- a/src/java.desktop/share/native/libmlib_image/mlib_c_ImageCopy.c	Tue Aug 02 16:14:59 2016 +0530
+++ b/src/java.desktop/share/native/libmlib_image/mlib_c_ImageCopy.c	Tue Aug 02 10:43:31 2016 -0700
@@ -182,7 +182,7 @@
 #define STRIP(pd, ps, w, h, data_type) {                        \
   data_type s0, s1;                                             \
   for ( i = 0; i < h; i++ ) {                                   \
-    if (j = w & 1)                                              \
+    if ((j = (w & 1)))                                          \
       pd[i * dst_stride] = ps[i * src_stride];                  \
     for (; j < w; j += 2) {                                     \
       s0 = ps[i * src_stride + j];                              \
@@ -546,7 +546,8 @@
     mlib_u32 *psrc_row = psrc + i * src_stride, *pdst_row = pdst + i * dst_stride;
 
     if (!(((mlib_addr) psrc_row ^ (mlib_addr) pdst_row) & 7)) {
-      if (j = ((mlib_s32) ((mlib_addr) psrc_row & 4) >> 2)) {
+      j = (mlib_s32) ((mlib_addr) psrc_row & 4) >> 2;
+      if (j != 0) {
         pdst_row[0] = psrc_row[0];
       }
 
@@ -575,8 +576,10 @@
       {
         mlib_u64 *ps, src0, src1;
 
-        if (j = ((mlib_s32) ((mlib_addr) pdst_row & 4) >> 2))
+        j = (mlib_s32) ((mlib_addr) pdst_row & 4) >> 2;
+        if (j != 0) {
           pdst_row[0] = psrc_row[0];
+        }
         ps = (mlib_u64 *) (psrc_row + j - 1);
         src1 = ps[0];
 #ifdef __SUNPRO_C