[libc-commits] [libc] [libc] Clean up remaining use of *_WIDTH macros in printf (PR #102679)

via libc-commits libc-commits at lists.llvm.org
Fri Aug 9 13:36:54 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Roland McGrath (frobtech)

<details>
<summary>Changes</summary>

The previous change missed the second spot doing the same thing.

Bug: https://issues.fuchsia.dev/358196552


---
Full diff: https://github.com/llvm/llvm-project/pull/102679.diff


1 Files Affected:

- (modified) libc/src/stdio/printf_core/parser.h (+3-3) 


``````````diff
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>();

``````````

</details>


https://github.com/llvm/llvm-project/pull/102679


More information about the libc-commits mailing list