From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 5390F3858411 for ; Tue, 28 Sep 2021 19:40:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5390F3858411 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-338-BBkI5RFsNhqIaaXobqLFdw-1; Tue, 28 Sep 2021 15:40:36 -0400 X-MC-Unique: BBkI5RFsNhqIaaXobqLFdw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6E21D8064A5; Tue, 28 Sep 2021 19:40:35 +0000 (UTC) Received: from localhost (unknown [10.33.36.241]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1E64C5C1B4; Tue, 28 Sep 2021 19:40:34 +0000 (UTC) Date: Tue, 28 Sep 2021 20:40:34 +0100 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Remove obfuscating typedefs in Message-ID: MIME-Version: 1.0 X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/mixed; boundary="D6BHZ80op448jDSA" Content-Disposition: inline X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2021 19:40:39 -0000 --D6BHZ80op448jDSA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline There is no benefit to using _SizeT instead of size_t, and IterT tells you less about the type than const _CharT*. This removes some unhelpful typedefs. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * include/bits/regex_automaton.h (_NFA_base::_SizeT): Remove. * include/bits/regex_compiler.h (_Compiler::_IterT): Remove. * include/bits/regex_compiler.tcc: Likewise. * include/bits/regex_scanner.h (_Scanner::_IterT): Remove. * include/bits/regex_scanner.tcc: Likewise. Tested x86_64-linux. Committed to trunk. --D6BHZ80op448jDSA Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="patch.txt" commit c44c5f3d9f46705a262911c2098c1568d7e8ac2d Author: Jonathan Wakely Date: Tue Sep 28 13:39:36 2021 libstdc++: Remove obfuscating typedefs in There is no benefit to using _SizeT instead of size_t, and IterT tells you less about the type than const _CharT*. This removes some unhelpful typedefs. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * include/bits/regex_automaton.h (_NFA_base::_SizeT): Remove. * include/bits/regex_compiler.h (_Compiler::_IterT): Remove. * include/bits/regex_compiler.tcc: Likewise. * include/bits/regex_scanner.h (_Scanner::_IterT): Remove. * include/bits/regex_scanner.tcc: Likewise. diff --git a/libstdc++-v3/include/bits/regex_automaton.h b/libstdc++-v3/include/bits/regex_automaton.h index 02d81f3e417..f108675f35e 100644 --- a/libstdc++-v3/include/bits/regex_automaton.h +++ b/libstdc++-v3/include/bits/regex_automaton.h @@ -183,7 +183,6 @@ namespace __detail struct _NFA_base { - typedef size_t _SizeT; typedef regex_constants::syntax_option_type _FlagT; explicit @@ -206,14 +205,14 @@ namespace __detail _M_start() const noexcept { return _M_start_state; } - _SizeT + size_t _M_sub_count() const noexcept { return _M_subexpr_count; } _GLIBCXX_STD_C::vector _M_paren_stack; _FlagT _M_flags; _StateIdT _M_start_state; - _SizeT _M_subexpr_count; + size_t _M_subexpr_count; bool _M_has_backref; }; diff --git a/libstdc++-v3/include/bits/regex_compiler.h b/libstdc++-v3/include/bits/regex_compiler.h index 423ab823194..646766ebdf9 100644 --- a/libstdc++-v3/include/bits/regex_compiler.h +++ b/libstdc++-v3/include/bits/regex_compiler.h @@ -58,11 +58,10 @@ namespace __detail { public: typedef typename _TraitsT::char_type _CharT; - typedef const _CharT* _IterT; typedef _NFA<_TraitsT> _RegexT; typedef regex_constants::syntax_option_type _FlagT; - _Compiler(_IterT __b, _IterT __e, + _Compiler(const _CharT* __b, const _CharT* __e, const typename _TraitsT::locale_type& __traits, _FlagT __flags); shared_ptr diff --git a/libstdc++-v3/include/bits/regex_compiler.tcc b/libstdc++-v3/include/bits/regex_compiler.tcc index 9f04c1be686..1bd30972cbb 100644 --- a/libstdc++-v3/include/bits/regex_compiler.tcc +++ b/libstdc++-v3/include/bits/regex_compiler.tcc @@ -63,7 +63,7 @@ namespace __detail { template _Compiler<_TraitsT>:: - _Compiler(_IterT __b, _IterT __e, + _Compiler(const _CharT* __b, const _CharT* __e, const typename _TraitsT::locale_type& __loc, _FlagT __flags) : _M_flags((__flags & (regex_constants::ECMAScript diff --git a/libstdc++-v3/include/bits/regex_scanner.h b/libstdc++-v3/include/bits/regex_scanner.h index 05d8172a0ad..4e7d5efb34b 100644 --- a/libstdc++-v3/include/bits/regex_scanner.h +++ b/libstdc++-v3/include/bits/regex_scanner.h @@ -211,12 +211,11 @@ namespace __detail : public _ScannerBase { public: - typedef const _CharT* _IterT; typedef std::basic_string<_CharT> _StringT; typedef regex_constants::syntax_option_type _FlagT; typedef const std::ctype<_CharT> _CtypeT; - _Scanner(_IterT __begin, _IterT __end, + _Scanner(const _CharT* __begin, const _CharT* __end, _FlagT __flags, std::locale __loc); void @@ -257,8 +256,8 @@ namespace __detail void _M_eat_class(char); - _IterT _M_current; - _IterT _M_end; + const _CharT* _M_current; + const _CharT* _M_end; _CtypeT& _M_ctype; _StringT _M_value; void (_Scanner::* _M_eat_escape)(); diff --git a/libstdc++-v3/include/bits/regex_scanner.tcc b/libstdc++-v3/include/bits/regex_scanner.tcc index a9d6a613648..b2b709ce3cb 100644 --- a/libstdc++-v3/include/bits/regex_scanner.tcc +++ b/libstdc++-v3/include/bits/regex_scanner.tcc @@ -54,8 +54,7 @@ namespace __detail { template _Scanner<_CharT>:: - _Scanner(typename _Scanner::_IterT __begin, - typename _Scanner::_IterT __end, + _Scanner(const _CharT* __begin, const _CharT* __end, _FlagT __flags, std::locale __loc) : _ScannerBase(__flags), _M_current(__begin), _M_end(__end), --D6BHZ80op448jDSA--