Changeset 58459 in vbox for trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BasePrintLib/PrintLibInternal.c
- Timestamp:
- Oct 28, 2015 8:17:18 PM (9 years ago)
- Location:
- trunk/src/VBox/Devices/EFI/Firmware
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/Firmware
-
Property svn:mergeinfo
set to (toggle deleted branches)
/vendor/edk2/current 103735-103757
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BasePrintLib/PrintLibInternal.c
r48674 r58459 15 15 #include "PrintLibInternal.h" 16 16 17 #define WARNING_STATUS_NUMBER 418 #define ERROR_STATUS_NUMBER 2417 #define WARNING_STATUS_NUMBER 5 18 #define ERROR_STATUS_NUMBER 33 19 19 20 20 GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 mHexStr[] = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'}; … … 26 26 "Warning Write Failure", // RETURN_WARN_WRITE_FAILURE = 3 27 27 "Warning Buffer Too Small", // RETURN_WARN_BUFFER_TOO_SMALL = 4 28 "Warning Stale Data", // RETURN_WARN_STALE_DATA = 5 28 29 "Load Error", // RETURN_LOAD_ERROR = 1 | MAX_BIT 29 30 "Invalid Parameter", // RETURN_INVALID_PARAMETER = 2 | MAX_BIT … … 49 50 "ICMP Error", // RETURN_ICMP_ERROR = 22 | MAX_BIT 50 51 "TFTP Error", // RETURN_TFTP_ERROR = 23 | MAX_BIT 51 "Protocol Error" // RETURN_PROTOCOL_ERROR = 24 | MAX_BIT 52 "Protocol Error", // RETURN_PROTOCOL_ERROR = 24 | MAX_BIT 53 "Incompatible Version", // RETURN_INCOMPATIBLE_VERSION = 25 | MAX_BIT 54 "Security Violation", // RETURN_SECURITY_VIOLATION = 26 | MAX_BIT 55 "CRC Error", // RETURN_CRC_ERROR = 27 | MAX_BIT 56 "End of Media", // RETURN_END_OF_MEDIA = 28 | MAX_BIT 57 "Reserved (29)", // RESERVED = 29 | MAX_BIT 58 "Reserved (30)", // RESERVED = 30 | MAX_BIT 59 "End of File", // RETURN_END_OF_FILE = 31 | MAX_BIT 60 "Invalid Language", // RETURN_INVALID_LANGUAGE = 32 | MAX_BIT 61 "Compromised Data" // RETURN_COMPROMISED_DATA = 33 | MAX_BIT 52 62 }; 53 63 … … 204 214 // 205 215 if (Width == 0 || (Flags & COMMA_TYPE) != 0) { 206 Flags &= (~PREFIX_ZERO);216 Flags &= ~((UINTN) PREFIX_ZERO); 207 217 } 208 218 // … … 364 374 365 375 LengthToReturn = 0; 376 EndBuffer = NULL; 377 OriginalBuffer = NULL; 366 378 367 379 // 368 380 // Reserve space for the Null terminator. 369 381 // 370 BufferSize--; 371 OriginalBuffer = Buffer; 372 373 // 374 // Set the tag for the end of the input Buffer. 375 // 376 EndBuffer = Buffer + BufferSize * BytesPerOutputCharacter; 382 if (Buffer != NULL) { 383 BufferSize--; 384 OriginalBuffer = Buffer; 385 386 // 387 // Set the tag for the end of the input Buffer. 388 // 389 EndBuffer = Buffer + BufferSize * BytesPerOutputCharacter; 390 } 377 391 378 392 if ((Flags & FORMAT_UNICODE) != 0) { … … 402 416 // Loop until the end of the format string is reached or the output buffer is full 403 417 // 404 while (FormatCharacter != 0 && Buffer < EndBuffer) { 418 while (FormatCharacter != 0) { 419 if ((Buffer != NULL) && (Buffer >= EndBuffer)) { 420 break; 421 } 405 422 // 406 423 // Clear all the flag bits except those that may have been passed in 407 424 // 408 Flags &= ( OUTPUT_UNICODE | FORMAT_UNICODE | COUNT_ONLY_NO_PRINT);425 Flags &= (UINTN) (OUTPUT_UNICODE | FORMAT_UNICODE | COUNT_ONLY_NO_PRINT); 409 426 410 427 // … … 514 531 // Flag space, +, 0, L & l are invalid for type p. 515 532 // 516 Flags &= ~( PREFIX_BLANK | PREFIX_SIGN | PREFIX_ZERO | LONG_TYPE);533 Flags &= ~((UINTN) (PREFIX_BLANK | PREFIX_SIGN | PREFIX_ZERO | LONG_TYPE)); 517 534 if (sizeof (VOID *) > 4) { 518 535 Flags |= LONG_TYPE; 519 536 } 537 // 538 // break skipped on purpose 539 // 520 540 case 'X': 521 541 Flags |= PREFIX_ZERO; … … 562 582 Radix = 10; 563 583 if (Comma) { 564 Flags &= (~PREFIX_ZERO);584 Flags &= ~((UINTN) PREFIX_ZERO); 565 585 Precision = 1; 566 586 } … … 631 651 } 632 652 if (ArgumentString == NULL) { 633 Flags &= (~ARGUMENT_UNICODE);653 Flags &= ~((UINTN) ARGUMENT_UNICODE); 634 654 ArgumentString = "<null string>"; 635 655 }
Note:
See TracChangeset
for help on using the changeset viewer.