public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-6293] libstdc++: Fix misleading typedef name in <format>
@ 2023-12-07 20:57 Jonathan Wakely
  0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2023-12-07 20:57 UTC (permalink / raw)
  To: gcc-cvs, libstdc++-cvs

https://gcc.gnu.org/g:cab0083dc72dfd22a1b2016b068f9313beb7f091

commit r14-6293-gcab0083dc72dfd22a1b2016b068f9313beb7f091
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Dec 7 12:40:18 2023 +0000

    libstdc++: Fix misleading typedef name in <format>
    
    This local typedef for uintptr_t was accidentally named uint64_t,
    probably from a careless code completion shortcut. We don't need the
    typedef at all since it's only used once. Just use __UINTPTR_TYPE__
    directly instead.
    
    libstdc++-v3/ChangeLog:
    
            * include/std/format (_Iter_sink<charT, contiguous_iterator>):
            Remove uint64_t local type.

Diff:
---
 libstdc++-v3/include/std/format | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libstdc++-v3/include/std/format b/libstdc++-v3/include/std/format
index 01f0a58392a..04d03e0ceb7 100644
--- a/libstdc++-v3/include/std/format
+++ b/libstdc++-v3/include/std/format
@@ -2809,7 +2809,6 @@ namespace __format
     requires same_as<iter_value_t<_OutIter>, _CharT>
     class _Iter_sink<_CharT, _OutIter> : public _Sink<_CharT>
     {
-      using uint64_t = __UINTPTR_TYPE__;
       _OutIter _M_first;
       iter_difference_t<_OutIter> _M_max = -1;
     protected:
@@ -2883,7 +2882,7 @@ namespace __format
 	  return {__ptr, __bytes / sizeof(_CharT)};
 #endif
 	// Avoid forming a pointer to a different memory page.
-	uint64_t __off = reinterpret_cast<uint64_t>(__ptr) % 1024;
+	const auto __off = reinterpret_cast<__UINTPTR_TYPE__>(__ptr) % 1024;
 	__n = (1024 - __off) / sizeof(_CharT);
 	if (__n > 0) [[likely]]
 	  return {__ptr, static_cast<size_t>(__n)};

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-12-07 20:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-07 20:57 [gcc r14-6293] libstdc++: Fix misleading typedef name in <format> Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).