Message ID | 20220919100350.9661-1-hexiaole1994@126.com |
---|---|
State | New |
Headers |
Return-Path: <libabigail-bounces+patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 76C233858D32 for <patchwork@sourceware.org>; Mon, 19 Sep 2022 10:04:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 76C233858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1663581861; bh=+Vrz30MOuuw6O6ytBIPKxdQuLF3j+u+achJ/unMcW8w=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Help: List-Subscribe:From:Reply-To:Cc:From; b=QrRZNPYwG/IYTaPrgvaSAYgfYx7fA4ESfmcM3p/GGn2EDaDS5GfAY5D8qcdnlKYyx jOXIE3O/xTWUrrNR+ChQVqBiVotr9moS43Qdf1HnKCg43GooKZWiMdk3F3TmY1DZ+G ZEv/yx8prQXksHekEPOqakTRRlaPuNCnDtUyTXO4= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from m15111.mail.126.com (m15111.mail.126.com [220.181.15.111]) by sourceware.org (Postfix) with ESMTP id 1D69A3858D32 for <libabigail@sourceware.org>; Mon, 19 Sep 2022 10:04:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1D69A3858D32 Received: from localhost.localdomain (unknown [123.150.8.42]) by smtp1 (Coremail) with SMTP id C8mowADHzJCaPihj6ZaPBw--.45282S2; Mon, 19 Sep 2022 18:04:12 +0800 (CST) To: libabigail@sourceware.org Subject: [PATCH] abg-reader: fix comment of function Date: Mon, 19 Sep 2022 18:03:50 +0800 Message-Id: <20220919100350.9661-1-hexiaole1994@126.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: C8mowADHzJCaPihj6ZaPBw--.45282S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7tr45JF4DCFWxJr4kCw1kGrg_yoW8WFyDpF WrCr1jkw1DGF4fCF92qw4fXFy0k3ykZF4UAws8CrW2y3s5Xw1SgrWfta4Ygry2yr4xCw1F qr4ag3sxG3yrArJanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0zRA9NxUUUUU= X-Originating-IP: [123.150.8.42] X-CM-SenderInfo: 5kh0xt5rohimizu6ij2wof0z/1tbicwh8BlpEB+u+mwABsX X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_VALIDITY_RPBL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list of the Libabigail project <libabigail.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libabigail>, <mailto:libabigail-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libabigail/> List-Help: <mailto:libabigail-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libabigail>, <mailto:libabigail-request@sourceware.org?subject=subscribe> From: Xiaole He via Libabigail <libabigail@sourceware.org> Reply-To: Xiaole He <hexiaole1994@126.com> Cc: Xiaole He <hexiaole@kylinos.cn>, Xiaole He <hexiaole1994@126.com> Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libabigail" <libabigail-bounces+patchwork=sourceware.org@sourceware.org> |
Series |
abg-reader: fix comment of function
|
|
Commit Message
Xiaole He
Sept. 19, 2022, 10:03 a.m. UTC
In 'src/abg-reader.cc', the function
'walk_xml_node_to_map_type_ids(read_context& ctxt, xmlNodePtr node)'
find all of the child nodes of 'node' that has the 'id' attribute,
and then put the child node into map where the 'id' of the child node
as key and the child node itself as the value.
But the comment for this function writes:
/* src/abg-reader.cc begin */
/// Walk an entire XML sub-tree to build a map where the key is the
/// the value of the 'id' attribute (for type definitions) and the key
/// is the xml node containing the 'id' attribute.
...
static void
walk_xml_node_to_map_type_ids(read_context& ctxt,
xmlNodePtr node)
...
/* src/abg-reader.cc end */
The second and third lines of the comment above says the the child node
as the key of the map, but it should be the value of the map.
This patch fix the problematic comment described above, from
'and the key is the xml node' to 'and the value is the xml node'.
* src/abg-reader.cc (walk_xml_node_to_map_type_ids): fix comment
Signed-off-by: Xiaole He <hexiaole@kylinos.cn>
---
src/abg-reader.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Hello, Xiaole He via Libabigail <libabigail@sourceware.org> a écrit: > In 'src/abg-reader.cc', the function > 'walk_xml_node_to_map_type_ids(read_context& ctxt, xmlNodePtr node)' > find all of the child nodes of 'node' that has the 'id' attribute, > and then put the child node into map where the 'id' of the child node > as key and the child node itself as the value. > But the comment for this function writes: > /* src/abg-reader.cc begin */ > /// Walk an entire XML sub-tree to build a map where the key is the > /// the value of the 'id' attribute (for type definitions) and the key > /// is the xml node containing the 'id' attribute. > ... > static void > walk_xml_node_to_map_type_ids(read_context& ctxt, > xmlNodePtr node) > ... > /* src/abg-reader.cc end */ > The second and third lines of the comment above says the the child node > as the key of the map, but it should be the value of the map. > This patch fix the problematic comment described above, from > 'and the key is the xml node' to 'and the value is the xml node'. > > * src/abg-reader.cc (walk_xml_node_to_map_type_ids): fix comment Thanks for catching that typo! You are spot on! I've applied the patch to the master branch. [...] Cheers,
Copy that, thank you for reviewing. At 2022-09-20 16:22:46, "Dodji Seketeli" <dodji@seketeli.org> wrote: >Hello, > >Xiaole He via Libabigail <libabigail@sourceware.org> a écrit: > >> In 'src/abg-reader.cc', the function >> 'walk_xml_node_to_map_type_ids(read_context& ctxt, xmlNodePtr node)' >> find all of the child nodes of 'node' that has the 'id' attribute, >> and then put the child node into map where the 'id' of the child node >> as key and the child node itself as the value. >> But the comment for this function writes: >> /* src/abg-reader.cc begin */ >> /// Walk an entire XML sub-tree to build a map where the key is the >> /// the value of the 'id' attribute (for type definitions) and the key >> /// is the xml node containing the 'id' attribute. >> ... >> static void >> walk_xml_node_to_map_type_ids(read_context& ctxt, >> xmlNodePtr node) >> ... >> /* src/abg-reader.cc end */ >> The second and third lines of the comment above says the the child node >> as the key of the map, but it should be the value of the map. >> This patch fix the problematic comment described above, from >> 'and the key is the xml node' to 'and the value is the xml node'. >> >> * src/abg-reader.cc (walk_xml_node_to_map_type_ids): fix comment > >Thanks for catching that typo! You are spot on! > >I've applied the patch to the master branch. > >[...] > >Cheers, > >-- > Dodji
diff --git a/src/abg-reader.cc b/src/abg-reader.cc index be2b8c13..b6372e50 100644 --- a/src/abg-reader.cc +++ b/src/abg-reader.cc @@ -1538,7 +1538,7 @@ advance_cursor(read_context& ctxt) } /// Walk an entire XML sub-tree to build a map where the key is the -/// the value of the 'id' attribute (for type definitions) and the key +/// the value of the 'id' attribute (for type definitions) and the value /// is the xml node containing the 'id' attribute. /// /// @param ctxt the context of the reader.