]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Add comment to explain use of the types "int" and "unsigned int" in the implementatio...
authormdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 5 Feb 2009 21:58:48 +0000 (21:58 +0000)
committermdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 5 Feb 2009 21:58:48 +0000 (21:58 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7444 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Library/BasePrintLib/PrintLibInternal.c

index 9fe52f22bc501979d2d0837c7c92b04426fbec74..a9a53866e724aca9190a5980ed39e743b862e5f6 100644 (file)
@@ -489,6 +489,14 @@ BasePrintLibVSPrint (
         //\r
       case 'd':\r
         if ((Flags & LONG_TYPE) == 0) {\r
+          //\r
+          // 'd','x', and 'X' that are not preceeded by 'l' or 'L' are assumed to be type "int".\r
+          // This assumption is made so the format string defintion is compatible with the ANSI C\r
+          // Specification for formatted strings.  It is recommended that the Base Types be used \r
+          // everywhere, but in this one case, compliance with ANSI C is more important, and \r
+          // provides an implementation that is compatible with that largest possible set of CPU \r
+          // architectures.  This is why the type "int" is used in this one case.\r
+          //\r
           Value = (VA_ARG (Marker, int));\r
         } else {\r
           Value = VA_ARG (Marker, INT64);\r
@@ -517,6 +525,14 @@ BasePrintLibVSPrint (
           Radix = 16;\r
           Comma = FALSE;\r
           if ((Flags & LONG_TYPE) == 0 && Value < 0) {\r
+            //\r
+            // 'd','x', and 'X' that are not preceeded by 'l' or 'L' are assumed to be type "int".\r
+            // This assumption is made so the format string defintion is compatible with the ANSI C\r
+            // Specification for formatted strings.  It is recommended that the Base Types be used \r
+            // everywhere, but in this one case, compliance with ANSI C is more important, and \r
+            // provides an implementation that is compatible with that largest possible set of CPU \r
+            // architectures.  This is why the type "unsigned int" is used in this one case.\r
+            //\r
             Value = (unsigned int)Value;\r
           }\r
         }\r