[libc-commits] [libc] 6e8a751 - [libc] Clean up remaining use of *_WIDTH macros in printf (#102679)
via libc-commits
libc-commits at lists.llvm.org
Fri Aug 9 13:46:53 PDT 2024
Author: Roland McGrath
Date: 2024-08-09T13:46:49-07:00
New Revision: 6e8a751ef124465b6e05ace84c3d69c0166151c8
URL: https://github.com/llvm/llvm-project/commit/6e8a751ef124465b6e05ace84c3d69c0166151c8
DIFF: https://github.com/llvm/llvm-project/commit/6e8a751ef124465b6e05ace84c3d69c0166151c8.diff
LOG: [libc] Clean up remaining use of *_WIDTH macros in printf (#102679)
The previous change missed the second spot doing the same thing.
Bug: https://issues.fuchsia.dev/358196552
Added:
Modified:
libc/src/stdio/printf_core/parser.h
Removed:
################################################################################
diff --git a/libc/src/stdio/printf_core/parser.h b/libc/src/stdio/printf_core/parser.h
index 684911a567569..1084cdc4349da 100644
--- a/libc/src/stdio/printf_core/parser.h
+++ b/libc/src/stdio/printf_core/parser.h
@@ -597,11 +597,11 @@ template <typename ArgProvider> class Parser {
break;
case (LengthModifier::w):
case (LengthModifier::wf):
- if (bw <= INT_WIDTH) {
+ if (bw <= cpp::numeric_limits<unsigned int>::digits) {
conv_size = type_desc_from_type<int>();
- } else if (bw <= LONG_WIDTH) {
+ } else if (bw <= cpp::numeric_limits<unsigned long>::digits) {
conv_size = type_desc_from_type<long>();
- } else if (bw <= LLONG_WIDTH) {
+ } else if (bw <= cpp::numeric_limits<unsigned long long>::digits) {
conv_size = type_desc_from_type<long long>();
} else {
conv_size = type_desc_from_type<intmax_t>();
More information about the libc-commits
mailing list