Ticket #9892: 0001-property_tree-fix-GCC-Wshadow-warnings.patch

File 0001-property_tree-fix-GCC-Wshadow-warnings.patch, 17.7 KB (added by mstahl@…, 9 years ago)
  • include/boost/property_tree/detail/json_parser_error.hpp

    From 72e4480d96fe8b74ff484e3c1debca310e4090a8 Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Fridrich=20=C5=A0trba?= <fridrich.strba@bluewin.ch>
    Date: Mon, 14 Apr 2014 12:13:58 +0200
    Subject: [PATCH 1/2] property_tree: fix GCC -Wshadow warnings
    
    Signed-off-by: Michael Stahl <mstahl@redhat.com>
    ---
     .../property_tree/detail/json_parser_error.hpp     |  8 +--
     .../property_tree/detail/json_parser_read.hpp      | 16 ++---
     .../property_tree/detail/ptree_implementation.hpp  | 84 +++++++++++-----------
     include/boost/property_tree/string_path.hpp        | 18 ++---
     4 files changed, 63 insertions(+), 63 deletions(-)
    
    diff --git a/include/boost/property_tree/detail/json_parser_error.hpp b/include/boost/property_tree/detail/json_parser_error.hpp
    index d48c72f..c9dc3ff 100644
    a b namespace boost { namespace property_tree { namespace json_parser  
    2020    class json_parser_error: public file_parser_error
    2121    {
    2222    public:
    23         json_parser_error(const std::string &message,
    24                           const std::string &filename,
    25                           unsigned long line):
    26             file_parser_error(message, filename, line)
     23        json_parser_error(const std::string &message_,
     24                          const std::string &filename_,
     25                          unsigned long line_):
     26            file_parser_error(message_, filename_, line_)
    2727        {
    2828        }
    2929    };
  • include/boost/property_tree/detail/json_parser_read.hpp

    diff --git a/include/boost/property_tree/detail/json_parser_read.hpp b/include/boost/property_tree/detail/json_parser_read.hpp
    index f8a374c..b4a8018 100644
    a b namespace boost { namespace property_tree { namespace json_parser  
    4545        struct a_object_s
    4646        {
    4747            context &c;
    48             a_object_s(context &c): c(c) { }
     48            a_object_s(context &c_): c(c_) { }
    4949            void operator()(Ch) const
    5050            {
    5151                if (c.stack.empty())
    namespace boost { namespace property_tree { namespace json_parser  
    6363        struct a_object_e
    6464        {
    6565            context &c;
    66             a_object_e(context &c): c(c) { }
     66            a_object_e(context &c_): c(c_) { }
    6767            void operator()(Ch) const
    6868            {
    6969                BOOST_ASSERT(c.stack.size() >= 1);
    namespace boost { namespace property_tree { namespace json_parser  
    7474        struct a_name
    7575        {
    7676            context &c;
    77             a_name(context &c): c(c) { }
     77            a_name(context &c_): c(c_) { }
    7878            void operator()(It, It) const
    7979            {
    8080                c.name.swap(c.string);
    namespace boost { namespace property_tree { namespace json_parser  
    8585        struct a_string_val
    8686        {
    8787            context &c;
    88             a_string_val(context &c): c(c) { }
     88            a_string_val(context &c_): c(c_) { }
    8989            void operator()(It, It) const
    9090            {
    9191                BOOST_ASSERT(c.stack.size() >= 1);
    namespace boost { namespace property_tree { namespace json_parser  
    9898        struct a_literal_val
    9999        {
    100100            context &c;
    101             a_literal_val(context &c): c(c) { }
     101            a_literal_val(context &c_): c(c_) { }
    102102            void operator()(It b, It e) const
    103103            {
    104104                BOOST_ASSERT(c.stack.size() >= 1);
    namespace boost { namespace property_tree { namespace json_parser  
    112112        struct a_char
    113113        {
    114114            context &c;
    115             a_char(context &c): c(c) { }
     115            a_char(context &c_): c(c_) { }
    116116            void operator()(It b, It) const
    117117            {
    118118                c.string += *b;
    namespace boost { namespace property_tree { namespace json_parser  
    122122        struct a_escape
    123123        {
    124124            context &c;
    125             a_escape(context &c): c(c) { }
     125            a_escape(context &c_): c(c_) { }
    126126            void operator()(Ch ch) const
    127127            {
    128128                switch (ch)
    namespace boost { namespace property_tree { namespace json_parser  
    143143        struct a_unicode
    144144        {
    145145            context &c;
    146             a_unicode(context &c): c(c) { }
     146            a_unicode(context &c_): c(c_) { }
    147147            void operator()(unsigned long u) const
    148148            {
    149149                u = (std::min)(u, static_cast<unsigned long>((std::numeric_limits<Ch>::max)()));
  • include/boost/property_tree/detail/ptree_implementation.hpp

    diff --git a/include/boost/property_tree/detail/ptree_implementation.hpp b/include/boost/property_tree/detail/ptree_implementation.hpp
    index 31d60e3..0c85a28 100644
    a b namespace boost { namespace property_tree  
    549549
    550550    template<class K, class D, class C>
    551551    basic_ptree<K, D, C> &
    552         basic_ptree<K, D, C>::get_child(const path_type &path)
     552        basic_ptree<K, D, C>::get_child(const path_type &path_)
    553553    {
    554         path_type p(path);
     554        path_type p(path_);
    555555        self_type *n = walk_path(p);
    556556        if (!n) {
    557             BOOST_PROPERTY_TREE_THROW(ptree_bad_path("No such node", path));
     557            BOOST_PROPERTY_TREE_THROW(ptree_bad_path("No such node", path_));
    558558        }
    559559        return *n;
    560560    }
    561561
    562562    template<class K, class D, class C> inline
    563563    const basic_ptree<K, D, C> &
    564         basic_ptree<K, D, C>::get_child(const path_type &path) const
     564        basic_ptree<K, D, C>::get_child(const path_type &path_) const
    565565    {
    566         return const_cast<self_type*>(this)->get_child(path);
     566        return const_cast<self_type*>(this)->get_child(path_);
    567567    }
    568568
    569569    template<class K, class D, class C> inline
    570570    basic_ptree<K, D, C> &
    571         basic_ptree<K, D, C>::get_child(const path_type &path,
     571        basic_ptree<K, D, C>::get_child(const path_type &path_,
    572572                                        self_type &default_value)
    573573    {
    574         path_type p(path);
     574        path_type p(path_);
    575575        self_type *n = walk_path(p);
    576576        return n ? *n : default_value;
    577577    }
    578578
    579579    template<class K, class D, class C> inline
    580580    const basic_ptree<K, D, C> &
    581         basic_ptree<K, D, C>::get_child(const path_type &path,
     581        basic_ptree<K, D, C>::get_child(const path_type &path_,
    582582                                        const self_type &default_value) const
    583583    {
    584         return const_cast<self_type*>(this)->get_child(path,
     584        return const_cast<self_type*>(this)->get_child(path_,
    585585            const_cast<self_type&>(default_value));
    586586    }
    587587
    588588
    589589    template<class K, class D, class C>
    590590    optional<basic_ptree<K, D, C> &>
    591         basic_ptree<K, D, C>::get_child_optional(const path_type &path)
     591        basic_ptree<K, D, C>::get_child_optional(const path_type &path_)
    592592    {
    593         path_type p(path);
     593        path_type p(path_);
    594594        self_type *n = walk_path(p);
    595595        if (!n) {
    596596            return optional<self_type&>();
    namespace boost { namespace property_tree  
    600600
    601601    template<class K, class D, class C>
    602602    optional<const basic_ptree<K, D, C> &>
    603         basic_ptree<K, D, C>::get_child_optional(const path_type &path) const
     603        basic_ptree<K, D, C>::get_child_optional(const path_type &path_) const
    604604    {
    605         path_type p(path);
     605        path_type p(path_);
    606606        self_type *n = walk_path(p);
    607607        if (!n) {
    608608            return optional<const self_type&>();
    namespace boost { namespace property_tree  
    612612
    613613    template<class K, class D, class C>
    614614    basic_ptree<K, D, C> &
    615         basic_ptree<K, D, C>::put_child(const path_type &path,
     615        basic_ptree<K, D, C>::put_child(const path_type &path_,
    616616                                        const self_type &value)
    617617    {
    618         path_type p(path);
     618        path_type p(path_);
    619619        self_type &parent = force_path(p);
    620620        // Got the parent. Now get the correct child.
    621621        key_type fragment = p.reduce();
    namespace boost { namespace property_tree  
    630630
    631631    template<class K, class D, class C>
    632632    basic_ptree<K, D, C> &
    633         basic_ptree<K, D, C>::add_child(const path_type &path,
     633        basic_ptree<K, D, C>::add_child(const path_type &path_,
    634634                                        const self_type &value)
    635635    {
    636         path_type p(path);
     636        path_type p(path_);
    637637        self_type &parent = force_path(p);
    638638        // Got the parent.
    639639        key_type fragment = p.reduce();
    namespace boost { namespace property_tree  
    719719    template<class K, class D, class C>
    720720    template<class Type, class Translator> inline
    721721    typename boost::enable_if<detail::is_translator<Translator>, Type>::type
    722     basic_ptree<K, D, C>::get(const path_type &path,
     722    basic_ptree<K, D, C>::get(const path_type &path_,
    723723                              Translator tr) const
    724724    {
    725         return get_child(path).BOOST_NESTED_TEMPLATE get_value<Type>(tr);
     725        return get_child(path_).BOOST_NESTED_TEMPLATE get_value<Type>(tr);
    726726    }
    727727
    728728    template<class K, class D, class C>
    729729    template<class Type> inline
    730     Type basic_ptree<K, D, C>::get(const path_type &path) const
     730    Type basic_ptree<K, D, C>::get(const path_type &path_) const
    731731    {
    732         return get_child(path).BOOST_NESTED_TEMPLATE get_value<Type>();
     732        return get_child(path_).BOOST_NESTED_TEMPLATE get_value<Type>();
    733733    }
    734734
    735735    template<class K, class D, class C>
    736736    template<class Type, class Translator> inline
    737     Type basic_ptree<K, D, C>::get(const path_type &path,
     737    Type basic_ptree<K, D, C>::get(const path_type &path_,
    738738                                   const Type &default_value,
    739739                                   Translator tr) const
    740740    {
    741         return get_optional<Type>(path, tr).get_value_or(default_value);
     741        return get_optional<Type>(path_, tr).get_value_or(default_value);
    742742    }
    743743
    744744    template<class K, class D, class C>
    namespace boost { namespace property_tree  
    748748        std::basic_string<Ch>
    749749    >::type
    750750    basic_ptree<K, D, C>::get(
    751         const path_type &path, const Ch *default_value, Translator tr) const
     751        const path_type &path_, const Ch *default_value, Translator tr) const
    752752    {
    753         return get<std::basic_string<Ch>, Translator>(path, default_value, tr);
     753        return get<std::basic_string<Ch>, Translator>(path_, default_value, tr);
    754754    }
    755755
    756756    template<class K, class D, class C>
    757757    template<class Type> inline
    758758    typename boost::disable_if<detail::is_translator<Type>, Type>::type
    759     basic_ptree<K, D, C>::get(const path_type &path,
     759    basic_ptree<K, D, C>::get(const path_type &path_,
    760760                              const Type &default_value) const
    761761    {
    762         return get_optional<Type>(path).get_value_or(default_value);
     762        return get_optional<Type>(path_).get_value_or(default_value);
    763763    }
    764764
    765765    template<class K, class D, class C>
    namespace boost { namespace property_tree  
    769769        std::basic_string<Ch>
    770770    >::type
    771771    basic_ptree<K, D, C>::get(
    772         const path_type &path, const Ch *default_value) const
     772        const path_type &path_, const Ch *default_value) const
    773773    {
    774         return get< std::basic_string<Ch> >(path, default_value);
     774        return get< std::basic_string<Ch> >(path_, default_value);
    775775    }
    776776
    777777    template<class K, class D, class C>
    778778    template<class Type, class Translator>
    779     optional<Type> basic_ptree<K, D, C>::get_optional(const path_type &path,
     779    optional<Type> basic_ptree<K, D, C>::get_optional(const path_type &path_,
    780780                                                         Translator tr) const
    781781    {
    782         if (optional<const self_type&> child = get_child_optional(path))
     782        if (optional<const self_type&> child = get_child_optional(path_))
    783783            return child.get().
    784784                BOOST_NESTED_TEMPLATE get_value_optional<Type>(tr);
    785785        else
    namespace boost { namespace property_tree  
    789789    template<class K, class D, class C>
    790790    template<class Type>
    791791    optional<Type> basic_ptree<K, D, C>::get_optional(
    792                                                 const path_type &path) const
     792                                                const path_type &path_) const
    793793    {
    794         if (optional<const self_type&> child = get_child_optional(path))
     794        if (optional<const self_type&> child = get_child_optional(path_))
    795795            return child.get().BOOST_NESTED_TEMPLATE get_value_optional<Type>();
    796796        else
    797797            return optional<Type>();
    namespace boost { namespace property_tree  
    820820    template<class K, class D, class C>
    821821    template<class Type, typename Translator>
    822822    basic_ptree<K, D, C> & basic_ptree<K, D, C>::put(
    823         const path_type &path, const Type &value, Translator tr)
     823        const path_type &path_, const Type &value, Translator tr)
    824824    {
    825         if(optional<self_type &> child = get_child_optional(path)) {
     825        if(optional<self_type &> child = get_child_optional(path_)) {
    826826            child.get().put_value(value, tr);
    827827            return *child;
    828828        } else {
    829             self_type &child2 = put_child(path, self_type());
     829            self_type &child2 = put_child(path_, self_type());
    830830            child2.put_value(value, tr);
    831831            return child2;
    832832        }
    namespace boost { namespace property_tree  
    835835    template<class K, class D, class C>
    836836    template<class Type> inline
    837837    basic_ptree<K, D, C> & basic_ptree<K, D, C>::put(
    838         const path_type &path, const Type &value)
     838        const path_type &path_, const Type &value)
    839839    {
    840         return put(path, value,
     840        return put(path_, value,
    841841                   typename translator_between<data_type, Type>::type());
    842842    }
    843843
    844844    template<class K, class D, class C>
    845845    template<class Type, typename Translator> inline
    846846    basic_ptree<K, D, C> & basic_ptree<K, D, C>::add(
    847         const path_type &path, const Type &value, Translator tr)
     847        const path_type &path_, const Type &value, Translator tr)
    848848    {
    849         self_type &child = add_child(path, self_type());
     849        self_type &child = add_child(path_, self_type());
    850850        child.put_value(value, tr);
    851851        return child;
    852852    }
    namespace boost { namespace property_tree  
    854854    template<class K, class D, class C>
    855855    template<class Type> inline
    856856    basic_ptree<K, D, C> & basic_ptree<K, D, C>::add(
    857         const path_type &path, const Type &value)
     857        const path_type &path_, const Type &value)
    858858    {
    859         return add(path, value,
     859        return add(path_, value,
    860860                   typename translator_between<data_type, Type>::type());
    861861    }
    862862
  • include/boost/property_tree/string_path.hpp

    diff --git a/include/boost/property_tree/string_path.hpp b/include/boost/property_tree/string_path.hpp
    index d4bc686..27f977a 100644
    a b namespace boost { namespace property_tree  
    8888        typedef typename String::value_type char_type;
    8989
    9090        /// Create an empty path.
    91         explicit string_path(char_type separator = char_type('.'));
     91        explicit string_path(char_type separator_ = char_type('.'));
    9292        /// Create a path by parsing the given string.
    9393        /// @param value A sequence, possibly with separators, that describes
    9494        ///              the path, e.g. "one.two.three".
    9595        /// @param separator The separator used in parsing. Defaults to '.'.
    9696        /// @param tr The translator used by this path to convert the individual
    9797        ///           parts to keys.
    98         string_path(const String &value, char_type separator = char_type('.'),
     98        string_path(const String &value, char_type separator_ = char_type('.'),
    9999                    Translator tr = Translator());
    100100        /// Create a path by parsing the given string.
    101101        /// @param value A zero-terminated array of values. Only use if zero-
    namespace boost { namespace property_tree  
    106106        /// @param tr The translator used by this path to convert the individual
    107107        ///           parts to keys.
    108108        string_path(const char_type *value,
    109                     char_type separator = char_type('.'),
     109                    char_type separator_ = char_type('.'),
    110110                    Translator tr = Translator());
    111111
    112112        // Default copying doesn't do the right thing with the iterator
    namespace boost { namespace property_tree  
    162162    };
    163163
    164164    template <typename String, typename Translator> inline
    165     string_path<String, Translator>::string_path(char_type separator)
    166         : m_separator(separator), m_start(m_value.begin())
     165    string_path<String, Translator>::string_path(char_type separator_)
     166        : m_separator(separator_), m_start(m_value.begin())
    167167    {}
    168168
    169169    template <typename String, typename Translator> inline
    170170    string_path<String, Translator>::string_path(const String &value,
    171                                                  char_type separator,
     171                                                 char_type separator_,
    172172                                                 Translator tr)
    173         : m_value(value), m_separator(separator),
     173        : m_value(value), m_separator(separator_),
    174174          m_tr(tr), m_start(m_value.begin())
    175175    {}
    176176
    177177    template <typename String, typename Translator> inline
    178178    string_path<String, Translator>::string_path(const char_type *value,
    179                                                  char_type separator,
     179                                                 char_type separator_,
    180180                                                 Translator tr)
    181         : m_value(value), m_separator(separator),
     181        : m_value(value), m_separator(separator_),
    182182          m_tr(tr), m_start(m_value.begin())
    183183    {}
    184184