From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id EA637385023D; Thu, 7 Jul 2022 23:33:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EA637385023D MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r11-10132] libstdc++: Remove obfuscating typedefs in X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/releases/gcc-11 X-Git-Oldrev: 7c3f20c0bea51017d2cb2da74d82ec802b294e25 X-Git-Newrev: f6eee16f3416f8a7caf8ebaf9a073dbabb05dea1 Message-Id: <20220707233325.EA637385023D@sourceware.org> Date: Thu, 7 Jul 2022 23:33:25 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jul 2022 23:33:26 -0000 https://gcc.gnu.org/g:f6eee16f3416f8a7caf8ebaf9a073dbabb05dea1 commit r11-10132-gf6eee16f3416f8a7caf8ebaf9a073dbabb05dea1 Author: Jonathan Wakely Date: Tue Sep 28 13:39:36 2021 +0100 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. (cherry picked from commit c44c5f3d9f46705a262911c2098c1568d7e8ac2d) Diff: --- libstdc++-v3/include/bits/regex_automaton.h | 5 ++--- libstdc++-v3/include/bits/regex_compiler.h | 3 +-- libstdc++-v3/include/bits/regex_compiler.tcc | 2 +- libstdc++-v3/include/bits/regex_scanner.h | 7 +++---- libstdc++-v3/include/bits/regex_scanner.tcc | 3 +-- 5 files changed, 8 insertions(+), 12 deletions(-) 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 497b701a694..bae2138e309 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 7769a9e63a3..9000aec8e25 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(_S_validate(__flags)), _M_scanner(__b, __e, _M_flags, __loc), 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 04f78f0baee..473dc888a20 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),