Fix a bug to judege max value of UINT32, 0xFFFFFFFF is invalid UINT32 in JAVA.
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 19 Jun 2006 09:13:44 +0000 (09:13 +0000)
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 19 Jun 2006 09:13:44 +0000 (09:13 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@560 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Source/GenBuild/org/tianocore/build/pcd/entity/Token.java

index d901336..9a54a3e 100644 (file)
@@ -593,14 +593,25 @@ public class Token {
 \r
     public boolean isValidNullValue(String judgedValue) {\r
         int         intValue;\r
+        String      subStr;\r
         BigInteger  bigIntValue;\r
 \r
         switch (datumType) {\r
         case UINT8:\r
         case UINT16:\r
         case UINT32:\r
-            intValue = Integer.decode(judgedValue);\r
-            if (intValue == 0) {\r
+            if (judgedValue.length() > 2) {\r
+                if ((judgedValue.charAt(0) == '0')        && \r
+                    ((judgedValue.charAt(1) == 'x') || (judgedValue.charAt(1) == 'X'))){\r
+                    subStr      = judgedValue.substring(2, judgedValue.length());\r
+                    bigIntValue = new BigInteger(subStr, 16);\r
+                } else {\r
+                    bigIntValue = new BigInteger(judgedValue);\r
+                }\r
+            } else {\r
+                bigIntValue = new BigInteger(judgedValue);\r
+            }\r
+            if (bigIntValue.bitCount() == 0) {\r
                 return true;\r
             }\r
             break;\r