From patchwork Tue Sep 28 19:40:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 1534058 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=RRoY14ZH; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HJqpt73YGz9t0k for ; Wed, 29 Sep 2021 05:49:57 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 071AB3857C42 for ; Tue, 28 Sep 2021 19:49:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 071AB3857C42 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1632858595; bh=TMOUTRZAm8cU0epTuLquHPpOPJ8pVDut820X6irO//o=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=RRoY14ZHnZn34m4zehpab0nm+sGJ5NmVoqqPFh/SlFRfaG1U8r+2YdDnEhlrlB5RC ZUXNCPugdYKPz1woZncZjXLuBXbhOqgiaOE4d5jnZ2hAvFop6fV+Dwfu2fxHIhwNmi YXiIV0b5eBL7EbyktO/1jsjcmMJCQ845yCFsgZ64= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org 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 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-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-Patchwork-Original-From: Jonathan Wakely via Gcc-patches From: Jonathan Wakely Reply-To: Jonathan Wakely Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" 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. 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),