mirror of https://github.com/acidanthera/audk.git
Add comment to explain use of the types "int" and "unsigned int" in the implementation of the BasePrintLib which does not follow the source code conventions used for the rest of the EDK II project.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7444 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
e54ce9047b
commit
57dd2382b7
|
@ -489,6 +489,14 @@ BasePrintLibVSPrint (
|
||||||
//
|
//
|
||||||
case 'd':
|
case 'd':
|
||||||
if ((Flags & LONG_TYPE) == 0) {
|
if ((Flags & LONG_TYPE) == 0) {
|
||||||
|
//
|
||||||
|
// 'd','x', and 'X' that are not preceeded by 'l' or 'L' are assumed to be type "int".
|
||||||
|
// This assumption is made so the format string defintion is compatible with the ANSI C
|
||||||
|
// Specification for formatted strings. It is recommended that the Base Types be used
|
||||||
|
// everywhere, but in this one case, compliance with ANSI C is more important, and
|
||||||
|
// provides an implementation that is compatible with that largest possible set of CPU
|
||||||
|
// architectures. This is why the type "int" is used in this one case.
|
||||||
|
//
|
||||||
Value = (VA_ARG (Marker, int));
|
Value = (VA_ARG (Marker, int));
|
||||||
} else {
|
} else {
|
||||||
Value = VA_ARG (Marker, INT64);
|
Value = VA_ARG (Marker, INT64);
|
||||||
|
@ -517,6 +525,14 @@ BasePrintLibVSPrint (
|
||||||
Radix = 16;
|
Radix = 16;
|
||||||
Comma = FALSE;
|
Comma = FALSE;
|
||||||
if ((Flags & LONG_TYPE) == 0 && Value < 0) {
|
if ((Flags & LONG_TYPE) == 0 && Value < 0) {
|
||||||
|
//
|
||||||
|
// 'd','x', and 'X' that are not preceeded by 'l' or 'L' are assumed to be type "int".
|
||||||
|
// This assumption is made so the format string defintion is compatible with the ANSI C
|
||||||
|
// Specification for formatted strings. It is recommended that the Base Types be used
|
||||||
|
// everywhere, but in this one case, compliance with ANSI C is more important, and
|
||||||
|
// provides an implementation that is compatible with that largest possible set of CPU
|
||||||
|
// architectures. This is why the type "unsigned int" is used in this one case.
|
||||||
|
//
|
||||||
Value = (unsigned int)Value;
|
Value = (unsigned int)Value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue