changeset 7856:99c1f910abcc

8005796: [parfait] Possible uninitialised variable at jdk/src/share/native/sun/java2d/loops/ByteBinary1Bit.c Reviewed-by: prr, vadim, flar Contributed-by: jia-hong.chen@oracle.com
author jgodinez
date Fri, 22 Feb 2013 13:20:16 -0800
parents d2d7da120c37
children 4fd6048a78c0
files src/share/native/sun/java2d/loops/AnyByteBinary.h src/share/native/sun/java2d/loops/ByteIndexed.h src/share/native/sun/java2d/loops/IntArgb.h src/share/native/sun/java2d/loops/IntArgbBm.h src/share/native/sun/java2d/loops/IntArgbPre.h src/share/native/sun/java2d/loops/Ushort4444Argb.h src/share/native/sun/java2d/loops/UshortIndexed.h
diffstat 7 files changed, 20 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/native/sun/java2d/loops/AnyByteBinary.h	Fri Feb 22 11:01:23 2013 -0800
+++ b/src/share/native/sun/java2d/loops/AnyByteBinary.h	Fri Feb 22 13:20:16 2013 -0800
@@ -153,7 +153,10 @@
     jint PREFIX ## rgb;
 
 #define InitByteBinaryAlphaLoadData(TYPE, PREFIX, pRasInfo) \
-    PREFIX ## Lut = (pRasInfo)->lutBase
+    do { \
+        PREFIX ## Lut = (pRasInfo)->lutBase; \
+        PREFIX ## rgb = 0; \
+    } while (0)
 
 #define LoadAlphaFromByteBinaryFor4ByteArgb(TYPE, pRas, PREFIX, COMP_PREFIX) \
     do { \
--- a/src/share/native/sun/java2d/loops/ByteIndexed.h	Fri Feb 22 11:01:23 2013 -0800
+++ b/src/share/native/sun/java2d/loops/ByteIndexed.h	Fri Feb 22 13:20:16 2013 -0800
@@ -202,7 +202,10 @@
     jint PREFIX ## rgb;
 
 #define InitByteIndexedAlphaLoadData(PREFIX, pRasInfo) \
-    PREFIX ## Lut = (pRasInfo)->lutBase
+    do { \
+        PREFIX ## Lut = (pRasInfo)->lutBase; \
+        PREFIX ## rgb = 0; \
+    } while (0)
 
 #define LoadAlphaFromByteIndexedFor4ByteArgb(pRas, PREFIX, COMP_PREFIX) \
     do { \
--- a/src/share/native/sun/java2d/loops/IntArgb.h	Fri Feb 22 11:01:23 2013 -0800
+++ b/src/share/native/sun/java2d/loops/IntArgb.h	Fri Feb 22 13:20:16 2013 -0800
@@ -122,7 +122,8 @@
 #define DeclareIntArgbAlphaLoadData(PREFIX) \
     jint PREFIX;
 
-#define InitIntArgbAlphaLoadData(PREFIX, pRasInfo)
+#define InitIntArgbAlphaLoadData(PREFIX, pRasInfo) \
+    PREFIX = 0
 
 #define LoadAlphaFromIntArgbFor4ByteArgb(pRas, PREFIX, COMP_PREFIX) \
     do { \
--- a/src/share/native/sun/java2d/loops/IntArgbBm.h	Fri Feb 22 11:01:23 2013 -0800
+++ b/src/share/native/sun/java2d/loops/IntArgbBm.h	Fri Feb 22 13:20:16 2013 -0800
@@ -133,7 +133,8 @@
 #define DeclareIntArgbBmAlphaLoadData(PREFIX) \
     jint PREFIX;
 
-#define InitIntArgbBmAlphaLoadData(PREFIX, pRasInfo)
+#define InitIntArgbBmAlphaLoadData(PREFIX, pRasInfo) \
+    PREFIX = 0
 
 #define LoadAlphaFromIntArgbBmFor4ByteArgb(pRas, PREFIX, COMP_PREFIX) \
     do { \
--- a/src/share/native/sun/java2d/loops/IntArgbPre.h	Fri Feb 22 11:01:23 2013 -0800
+++ b/src/share/native/sun/java2d/loops/IntArgbPre.h	Fri Feb 22 13:20:16 2013 -0800
@@ -153,7 +153,8 @@
 #define DeclareIntArgbPreAlphaLoadData(PREFIX) \
     jint PREFIX;
 
-#define InitIntArgbPreAlphaLoadData(PREFIX, pRasInfo)
+#define InitIntArgbPreAlphaLoadData(PREFIX, pRasInfo) \
+    PREFIX = 0
 
 #define LoadAlphaFromIntArgbPreFor4ByteArgb(pRas, PREFIX, COMP_PREFIX) \
     do { \
--- a/src/share/native/sun/java2d/loops/Ushort4444Argb.h	Fri Feb 22 11:01:23 2013 -0800
+++ b/src/share/native/sun/java2d/loops/Ushort4444Argb.h	Fri Feb 22 13:20:16 2013 -0800
@@ -120,7 +120,8 @@
 #define DeclareUshort4444ArgbAlphaLoadData(PREFIX) \
     jint PREFIX;
 
-#define InitUshort4444ArgbAlphaLoadData(PREFIX, pRasInfo)
+#define InitUshort4444ArgbAlphaLoadData(PREFIX, pRasInfo) \
+    PREFIX = 0
 
 #define LoadAlphaFromUshort4444ArgbFor4ByteArgb(pRas, PREFIX, COMP_PREFIX) \
     do { \
--- a/src/share/native/sun/java2d/loops/UshortIndexed.h	Fri Feb 22 11:01:23 2013 -0800
+++ b/src/share/native/sun/java2d/loops/UshortIndexed.h	Fri Feb 22 13:20:16 2013 -0800
@@ -170,7 +170,10 @@
     jint PREFIX ## rgb;
 
 #define InitUshortIndexedAlphaLoadData(PREFIX, pRasInfo) \
-    PREFIX ## Lut = (pRasInfo)->lutBase
+    do { \
+        PREFIX ## Lut = (pRasInfo)->lutBase; \
+        PREFIX ## rgb = 0; \
+    } while (0)
 
 #define LoadAlphaFromUshortIndexedFor4ByteArgb(pRas, PREFIX, COMP_PREFIX) \
     do { \