From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <3qq-iXggKCo8z8A7v1wtz77z4x.v7541utu1zt14B7DAvxFtAx.7Az@flex--gprocida.bounces.google.com> Received: from mail-wr1-x449.google.com (mail-wr1-x449.google.com [IPv6:2a00:1450:4864:20::449]) by sourceware.org (Postfix) with ESMTPS id 9A1603893643 for ; Fri, 24 Apr 2020 09:21:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9A1603893643 Received: by mail-wr1-x449.google.com with SMTP id 11so4492628wrc.3 for ; Fri, 24 Apr 2020 02:21:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=+IV9bGPdHAwaTvig0ZwNuZtYB27AP/q5K0ACCPOgeBU=; b=h8Rt5GnjGnYqiCNm7lq7apHDX4/BSPXFp5rI+AnrhlmJS1MvdhRgdZb0PMvRslcNyR KCkAxbvZwq8QQkKjh2PCkpHx8v8W1VzotEmpogT8me/DUPyY+vNEHe47U7U4nrJzcLuR FmfyPGfZ5ZiRmn7xyB8sCMf8+wy/84Rsb3t/7w37Nk+dBcKfPzIgVaIQdBCQpwZqJj8h fIY+sfDXaQ7C8m5EiKeKegJmroGpbWa48K5ZPKaOTfjRYQZip+lmjmT5WT7wJgC2RGaO F32CgGzd2UXDRopOZ3Dz7TTE5+tlt5EeKWcIT+fcwOZC/ZLbLR0ONMFeHVALVwpaUM8N Wblw== X-Gm-Message-State: AGi0PuY/KuVTo170EX1Vnx96uI++k174ds7IkoXoUyq8/mV7dxR8p4xB W5XLLDm7n2+yDO3J2YKJZVzHNe+bnEoxgfPud7ZOIrdCcss31hh+QkIJcW8dyJcs0B2ins8fwD8 ud+BEmVg3LX3BJB4sdsNgCsl6SMdDT+zqgV0pElpQ/UEPN66JPzf/JCvUUZojmVbHuqL+KHc= X-Google-Smtp-Source: APiQypJKKx8Yir/+wDpesfu1Jx1sYLFQr6Jv8YMghOgXQ3KC/enD0cxim86jSk0fi/ZHx9qMefIV9gspakGFfA== X-Received: by 2002:adf:8b1d:: with SMTP id n29mr9722406wra.196.1587720106423; Fri, 24 Apr 2020 02:21:46 -0700 (PDT) Date: Fri, 24 Apr 2020 10:21:13 +0100 In-Reply-To: <20200424092132.150547-1-gprocida@google.com> Message-Id: <20200424092132.150547-3-gprocida@google.com> Mime-Version: 1.0 References: <20200423154441.170531-1-gprocida@google.com> <20200424092132.150547-1-gprocida@google.com> X-Mailer: git-send-email 2.26.2.303.gf8c07b1a785-goog Subject: [PATCH v3 02/21] Move libxml bits out of abg-sptr-utils.h. From: Giuliano Procida To: libabigail@sourceware.org Cc: dodji@seketeli.org, kernel-team@android.com, gprocida@google.com, maennich@google.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-33.7 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libabigail mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Apr 2020 09:21:49 -0000 The header file abg-sptr-utils.h contains generic things relating to shared pointers. It also contains shared pointer typedefs (in the sptr_utils namespace) and template specialisations for XML types. The last of these more naturally belong in abg-libxml-utils.h (and in the xml namespace). This patch moves them. There are no behavioural changes. * include/abg-sptr-utils.h: Remove reader_sptr and xml_char_sptr typedefs, from namespace sptr_utils. (build_sptr): Remove corresponding template function specialisations for these types. * include/abg-libxml-utils.h: Add reader_sptr and xml_char_sptr typedefs, to namespace xml. (build_sptr): Add corresponding template function specialisations for these types. Signed-off-by: Giuliano Procida --- include/abg-libxml-utils.h | 21 +++++++++++++++++++-- include/abg-sptr-utils.h | 17 +---------------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/include/abg-libxml-utils.h b/include/abg-libxml-utils.h index 6331bde5..1e46d950 100644 --- a/include/abg-libxml-utils.h +++ b/include/abg-libxml-utils.h @@ -23,7 +23,10 @@ #ifndef __ABG_LIBXML_UTILS_H__ #define __ABG_LIBXML_UTILS_H__ +#include + #include + #include "abg-sptr-utils.h" #include "abg-cxx-compat.h" @@ -36,8 +39,12 @@ namespace xml using sptr_utils::build_sptr; using abg_compat::shared_ptr; -using sptr_utils::reader_sptr; -using sptr_utils::xml_char_sptr; + +/// A convenience typedef for a shared pointer of xmlTextReader. +typedef shared_ptr reader_sptr; + +/// A convenience typedef for a shared pointer of xmlChar. +typedef shared_ptr xml_char_sptr; /// This functor is used to instantiate a shared_ptr for the /// xmlTextReader. @@ -121,5 +128,15 @@ std::string unescape_xml_comment(const std::string& str); }//end namespace xml + +/// Specialization of sptr_utils::build_sptr for xmlTextReader +template<> +xml::reader_sptr +sptr_utils::build_sptr(xmlTextReader *p); + +/// Specialization of build_str for xmlChar. +template<> +xml::xml_char_sptr sptr_utils::build_sptr(xmlChar *p); + }//end namespace abigail #endif //__ABG_LIBXML_UTILS_H__ diff --git a/include/abg-sptr-utils.h b/include/abg-sptr-utils.h index 9737fe5f..2a12707b 100644 --- a/include/abg-sptr-utils.h +++ b/include/abg-sptr-utils.h @@ -26,7 +26,7 @@ #define __ABG_SPTR_UTILS_H__ #include -#include + #include "abg-cxx-compat.h" namespace abigail @@ -63,21 +63,6 @@ template shared_ptr build_sptr(); -/// A convenience typedef for a shared pointer of xmlTextReader. -typedef shared_ptr reader_sptr; - -/// Specialization of sptr_utils::build_sptr for xmlTextReader -template<> -reader_sptr -build_sptr(xmlTextReader *p); - -/// A convenience typedef for a shared pointer of xmlChar. -typedef shared_ptr xml_char_sptr; - -/// Specialization of build_str for xmlChar. -template<> -xml_char_sptr build_sptr(xmlChar *p); - /// A deleter for shared pointers that ... doesn't delete the object /// managed by the shared pointer. struct noop_deleter -- 2.26.2.303.gf8c07b1a785-goog