Ticket #4016: boost_property_tree_gcc_warning_cleanup.diff

File boost_property_tree_gcc_warning_cleanup.diff, 26.1 KB (added by Tatu Kilappa <tatu.kilappa@…>, 13 years ago)
  • boost/property_tree/detail/exception_implementation.hpp

     
    3030    ///////////////////////////////////////////////////////////////////////////
    3131    // ptree_error
    3232
    33     inline ptree_error::ptree_error(const std::string &what):
    34         std::runtime_error(what)
     33    inline ptree_error::ptree_error(const std::string &p_what):
     34        std::runtime_error(p_what)
    3535    {
    3636    }
    3737
     
    4343    // ptree_bad_data
    4444
    4545    template<class D> inline
    46     ptree_bad_data::ptree_bad_data(const std::string &what, const D &data):
    47         ptree_error(what), m_data(data)
     46    ptree_bad_data::ptree_bad_data(const std::string &p_what, const D &p_data):
     47        ptree_error(p_what), m_data(p_data)
    4848    {
    4949    }
    5050
     
    6262    // ptree_bad_path
    6363
    6464    template<class P> inline
    65     ptree_bad_path::ptree_bad_path(const std::string &what, const P &path):
    66         ptree_error(detail::prepare_bad_path_what(what, path)), m_path(path)
     65    ptree_bad_path::ptree_bad_path(const std::string &p_what, const P &p_path):
     66        ptree_error(detail::prepare_bad_path_what(p_what, p_path)), m_path(p_path)
    6767    {
    6868
    6969    }
  • boost/property_tree/detail/file_parser_error.hpp

     
    2626        // Construction & destruction
    2727
    2828        // Construct error
    29         file_parser_error(const std::string &message,
    30                           const std::string &filename,
    31                           unsigned long line) :
    32             ptree_error(format_what(message, filename, line)),
    33             m_message(message), m_filename(filename), m_line(line)
     29        file_parser_error(const std::string &p_message,
     30                          const std::string &p_filename,
     31                          unsigned long p_line) :
     32            ptree_error(format_what(p_message, p_filename, p_line)),
     33            m_message(p_message), m_filename(p_filename), m_line(p_line)
    3434        {
    3535        }
    3636
  • boost/property_tree/detail/rapidxml.hpp

     
    5050    public:
    5151   
    5252        //! Constructs parse error
    53         parse_error(const char *what, void *where)
    54             : m_what(what)
    55             , m_where(where)
     53        parse_error(const char *p_what, void *p_where)
     54            : m_what(p_what)
     55            , m_where(p_where)
    5656        {
    5757        }
    5858
     
    688688        //! Use name(const Ch *) function to have the length automatically calculated (string must be zero terminated).
    689689        //! \param name Name of node to set. Does not have to be zero terminated.
    690690        //! \param size Size of name, in characters. This does not include zero terminator, if one is present.
    691         void name(const Ch *name, std::size_t size)
     691        void name(const Ch *p_name, std::size_t size)
    692692        {
    693             m_name = const_cast<Ch *>(name);
     693            m_name = const_cast<Ch *>(p_name);
    694694            m_name_size = size;
    695695        }
    696696
    697697        //! Sets name of node to a zero-terminated string.
    698698        //! See also \ref ownership_of_strings and xml_node::name(const Ch *, std::size_t).
    699699        //! \param name Name of node to set. Must be zero terminated.
    700         void name(const Ch *name)
     700        void name(const Ch *p_name)
    701701        {
    702             this->name(name, internal::measure(name));
     702            this->name(p_name, internal::measure(p_name));
    703703        }
    704704
    705705        //! Sets value of node to a non zero-terminated string.
     
    718718        //! If you want to manipulate data of elements using values, use parser flag rapidxml::parse_no_data_nodes to prevent creation of data nodes by the parser.
    719719        //! \param value value of node to set. Does not have to be zero terminated.
    720720        //! \param size Size of value, in characters. This does not include zero terminator, if one is present.
    721         void value(const Ch *value, std::size_t size)
     721        void value(const Ch *p_value, std::size_t size)
    722722        {
    723             m_value = const_cast<Ch *>(value);
     723            m_value = const_cast<Ch *>(p_value);
    724724            m_value_size = size;
    725725        }
    726726
    727727        //! Sets value of node to a zero-terminated string.
    728728        //! See also \ref ownership_of_strings and xml_node::value(const Ch *, std::size_t).
    729729        //! \param value Vame of node to set. Must be zero terminated.
    730         void value(const Ch *value)
     730        void value(const Ch *p_value)
    731731        {
    732             this->value(value, internal::measure(value));
     732            this->value(p_value, internal::measure(p_value));
    733733        }
    734734
    735735        ///////////////////////////////////////////////////////////////////////////
     
    803803        //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string
    804804        //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters
    805805        //! \return Pointer to found attribute, or 0 if not found.
    806         xml_attribute<Ch> *previous_attribute(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const
     806        xml_attribute<Ch> *previous_attribute(const Ch *p_name = 0, std::size_t p_name_size = 0, bool case_sensitive = true) const
    807807        {
    808             if (name)
     808            if (p_name)
    809809            {
    810                 if (name_size == 0)
    811                     name_size = internal::measure(name);
     810                if (p_name_size == 0)
     811                    p_name_size = internal::measure(p_name);
    812812                for (xml_attribute<Ch> *attribute = m_prev_attribute; attribute; attribute = attribute->m_prev_attribute)
    813                     if (internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive))
     813                    if (internal::compare(attribute->name(), attribute->name_size(), p_name, p_name_size, case_sensitive))
    814814                        return attribute;
    815815                return 0;
    816816            }
     
    823823        //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string
    824824        //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters
    825825        //! \return Pointer to found attribute, or 0 if not found.
    826         xml_attribute<Ch> *next_attribute(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const
     826        xml_attribute<Ch> *next_attribute(const Ch *p_name = 0, std::size_t p_name_size = 0, bool case_sensitive = true) const
    827827        {
    828             if (name)
     828            if (p_name)
    829829            {
    830                 if (name_size == 0)
    831                     name_size = internal::measure(name);
     830                if (p_name_size == 0)
     831                    p_name_size = internal::measure(p_name);
    832832                for (xml_attribute<Ch> *attribute = m_next_attribute; attribute; attribute = attribute->m_next_attribute)
    833                     if (internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive))
     833                    if (internal::compare(attribute->name(), attribute->name_size(), p_name, p_name_size, case_sensitive))
    834834                        return attribute;
    835835                return 0;
    836836            }
     
    868868        //! Constructs an empty node with the specified type.
    869869        //! Consider using memory_pool of appropriate document to allocate nodes manually.
    870870        //! \param type Type of node to construct.
    871         xml_node(node_type type)
    872             : m_type(type)
     871        xml_node(node_type p_type)
     872            : m_type(p_type)
    873873            , m_first_node(0)
    874874            , m_first_attribute(0)
    875875        {
     
    903903        //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string
    904904        //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters
    905905        //! \return Pointer to found child, or 0 if not found.
    906         xml_node<Ch> *first_node(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const
     906        xml_node<Ch> *first_node(const Ch *p_name = 0, std::size_t p_name_size = 0, bool case_sensitive = true) const
    907907        {
    908             if (name)
     908            if (p_name)
    909909            {
    910                 if (name_size == 0)
    911                     name_size = internal::measure(name);
     910                if (p_name_size == 0)
     911                    p_name_size = internal::measure(p_name);
    912912                for (xml_node<Ch> *child = m_first_node; child; child = child->next_sibling())
    913                     if (internal::compare(child->name(), child->name_size(), name, name_size, case_sensitive))
     913                    if (internal::compare(child->name(), child->name_size(), p_name, p_name_size, case_sensitive))
    914914                        return child;
    915915                return 0;
    916916            }
     
    925925        //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string
    926926        //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters
    927927        //! \return Pointer to found child, or 0 if not found.
    928         xml_node<Ch> *last_node(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const
     928        xml_node<Ch> *last_node(const Ch *p_name = 0, std::size_t p_name_size = 0, bool case_sensitive = true) const
    929929        {
    930930            assert(m_first_node);  // Cannot query for last child if node has no children
    931             if (name)
     931            if (p_name)
    932932            {
    933                 if (name_size == 0)
    934                     name_size = internal::measure(name);
     933                if (p_name_size == 0)
     934                    p_name_size = internal::measure(p_name);
    935935                for (xml_node<Ch> *child = m_last_node; child; child = child->previous_sibling())
    936                     if (internal::compare(child->name(), child->name_size(), name, name_size, case_sensitive))
     936                    if (internal::compare(child->name(), child->name_size(), p_name, p_name_size, case_sensitive))
    937937                        return child;
    938938                return 0;
    939939            }
     
    948948        //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string
    949949        //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters
    950950        //! \return Pointer to found sibling, or 0 if not found.
    951         xml_node<Ch> *previous_sibling(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const
     951        xml_node<Ch> *previous_sibling(const Ch *p_name = 0, std::size_t p_name_size = 0, bool case_sensitive = true) const
    952952        {
    953953            assert(this->m_parent);     // Cannot query for siblings if node has no parent
    954             if (name)
     954            if (p_name)
    955955            {
    956                 if (name_size == 0)
    957                     name_size = internal::measure(name);
     956                if (p_name_size == 0)
     957                    p_name_size = internal::measure(p_name);
    958958                for (xml_node<Ch> *sibling = m_prev_sibling; sibling; sibling = sibling->m_prev_sibling)
    959                     if (internal::compare(sibling->name(), sibling->name_size(), name, name_size, case_sensitive))
     959                    if (internal::compare(sibling->name(), sibling->name_size(), p_name, p_name_size, case_sensitive))
    960960                        return sibling;
    961961                return 0;
    962962            }
     
    971971        //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string
    972972        //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters
    973973        //! \return Pointer to found sibling, or 0 if not found.
    974         xml_node<Ch> *next_sibling(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const
     974        xml_node<Ch> *next_sibling(const Ch *p_name = 0, std::size_t p_name_size = 0, bool case_sensitive = true) const
    975975        {
    976976            assert(this->m_parent);     // Cannot query for siblings if node has no parent
    977             if (name)
     977            if (p_name)
    978978            {
    979                 if (name_size == 0)
    980                     name_size = internal::measure(name);
     979                if (p_name_size == 0)
     980                    p_name_size = internal::measure(p_name);
    981981                for (xml_node<Ch> *sibling = m_next_sibling; sibling; sibling = sibling->m_next_sibling)
    982                     if (internal::compare(sibling->name(), sibling->name_size(), name, name_size, case_sensitive))
     982                    if (internal::compare(sibling->name(), sibling->name_size(), p_name, p_name_size, case_sensitive))
    983983                        return sibling;
    984984                return 0;
    985985            }
     
    992992        //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string
    993993        //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters
    994994        //! \return Pointer to found attribute, or 0 if not found.
    995         xml_attribute<Ch> *first_attribute(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const
     995        xml_attribute<Ch> *first_attribute(const Ch *p_name = 0, std::size_t p_name_size = 0, bool case_sensitive = true) const
    996996        {
    997             if (name)
     997            if (p_name)
    998998            {
    999                 if (name_size == 0)
    1000                     name_size = internal::measure(name);
     999                if (p_name_size == 0)
     1000                    p_name_size = internal::measure(p_name);
    10011001                for (xml_attribute<Ch> *attribute = m_first_attribute; attribute; attribute = attribute->m_next_attribute)
    1002                     if (internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive))
     1002                    if (internal::compare(attribute->name(), attribute->name_size(), p_name, p_name_size, case_sensitive))
    10031003                        return attribute;
    10041004                return 0;
    10051005            }
     
    10121012        //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string
    10131013        //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters
    10141014        //! \return Pointer to found attribute, or 0 if not found.
    1015         xml_attribute<Ch> *last_attribute(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const
     1015        xml_attribute<Ch> *last_attribute(const Ch *p_name = 0, std::size_t p_name_size = 0, bool case_sensitive = true) const
    10161016        {
    1017             if (name)
     1017            if (p_name)
    10181018            {
    1019                 if (name_size == 0)
    1020                     name_size = internal::measure(name);
     1019                if (p_name_size == 0)
     1020                    p_name_size = internal::measure(p_name);
    10211021                for (xml_attribute<Ch> *attribute = m_last_attribute; attribute; attribute = attribute->m_prev_attribute)
    1022                     if (internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive))
     1022                    if (internal::compare(attribute->name(), attribute->name_size(), p_name, p_name_size, case_sensitive))
    10231023                        return attribute;
    10241024                return 0;
    10251025            }
     
    10321032   
    10331033        //! Sets type of node.
    10341034        //! \param type Type of node to set.
    1035         void type(node_type type)
     1035        void type(node_type p_type)
    10361036        {
    1037             m_type = type;
     1037            m_type = p_type;
    10381038        }
    10391039
    10401040        ///////////////////////////////////////////////////////////////////////////
     
    17571757            }
    17581758
    17591759            // Remember value start
    1760             Ch *value = text;
     1760            Ch *text_value = text;
    17611761
    17621762            // Skip until end of comment
    17631763            while (text[0] != Ch('-') || text[1] != Ch('-') || text[2] != Ch('>'))
     
    17691769
    17701770            // Create comment node
    17711771            xml_node<Ch> *comment = this->allocate_node(node_comment);
    1772             comment->value(value, text - value);
     1772            comment->value(text_value, text - text_value);
    17731773           
    17741774            // Place zero terminator after comment value
    17751775            if (!(Flags & parse_no_string_terminators))
     
    17841784        xml_node<Ch> *parse_doctype(Ch *&text)
    17851785        {
    17861786            // Remember value start
    1787             Ch *value = text;
     1787            Ch *text_value = text;
    17881788
    17891789            // Skip to >
    17901790            while (*text != Ch('>'))
     
    18061806                            case Ch('['): ++depth; break;
    18071807                            case Ch(']'): --depth; break;
    18081808                            case 0: BOOST_PROPERTY_TREE_RAPIDXML_PARSE_ERROR("unexpected end of data", text);
     1809                                                                                                                default: break;
    18091810                        }
    18101811                        ++text;
    18111812                    }
     
    18281829            {
    18291830                // Create a new doctype node
    18301831                xml_node<Ch> *doctype = this->allocate_node(node_doctype);
    1831                 doctype->value(value, text - value);
     1832                doctype->value(text_value, text - text_value);
    18321833               
    18331834                // Place zero terminator after value
    18341835                if (!(Flags & parse_no_string_terminators))
     
    18561857                xml_node<Ch> *pi = this->allocate_node(node_pi);
    18571858
    18581859                // Extract PI target name
    1859                 Ch *name = text;
     1860                Ch *text_name = text;
    18601861                skip<node_name_pred, Flags>(text);
    1861                 if (text == name)
     1862                if (text == text_name)
    18621863                    BOOST_PROPERTY_TREE_RAPIDXML_PARSE_ERROR("expected PI target", text);
    1863                 pi->name(name, text - name);
     1864                pi->name(text_name, text - text_name);
    18641865               
    18651866                // Skip whitespace between pi target and pi
    18661867                skip<whitespace_pred, Flags>(text);
    18671868
    18681869                // Remember start of pi
    1869                 Ch *value = text;
     1870                Ch *text_value = text;
    18701871               
    18711872                // Skip to '?>'
    18721873                while (text[0] != Ch('?') || text[1] != Ch('>'))
     
    18771878                }
    18781879
    18791880                // Set pi value (verbatim, no entity expansion or whitespace normalization)
    1880                 pi->value(value, text - value);     
     1881                pi->value(text_value, text - text_value);     
    18811882               
    18821883                // Place zero terminator after name and value
    18831884                if (!(Flags & parse_no_string_terminators))
     
    19141915                text = contents_start;     
    19151916           
    19161917            // Skip until end of data
    1917             Ch *value = text, *end;
     1918            Ch *text_value = text, *end;
    19181919            if (Flags & parse_normalize_whitespace)
    19191920                end = skip_and_expand_character_refs<text_pred, text_pure_with_ws_pred, Flags>(text);   
    19201921            else
     
    19421943            if (!(Flags & parse_no_data_nodes))
    19431944            {
    19441945                xml_node<Ch> *data = this->allocate_node(node_data);
    1945                 data->value(value, end - value);
     1946                data->value(text_value, end - text_value);
    19461947                node->append_node(data);
    19471948            }
    19481949
    19491950            // Add data to parent node if no data exists yet
    19501951            if (!(Flags & parse_no_element_values))
    19511952                if (*node->value() == Ch('\0'))
    1952                     node->value(value, end - value);
     1953                    node->value(text_value, end - text_value);
    19531954
    19541955            // Place zero terminator after value
    19551956            if (!(Flags & parse_no_string_terminators))
     
    19821983            }
    19831984
    19841985            // Skip until end of cdata
    1985             Ch *value = text;
     1986            Ch *text_value = text;
    19861987            while (text[0] != Ch(']') || text[1] != Ch(']') || text[2] != Ch('>'))
    19871988            {
    19881989                if (!text[0])
     
    19921993
    19931994            // Create new cdata node
    19941995            xml_node<Ch> *cdata = this->allocate_node(node_cdata);
    1995             cdata->value(value, text - value);
     1996            cdata->value(text_value, text - text_value);
    19961997
    19971998            // Place zero terminator after value
    19981999            if (!(Flags & parse_no_string_terminators))
     
    20102011            xml_node<Ch> *element = this->allocate_node(node_element);
    20112012
    20122013            // Extract element name
    2013             Ch *name = text;
     2014            Ch *text_name = text;
    20142015            skip<node_name_pred, Flags>(text);
    2015             if (text == name)
     2016            if (text == text_name)
    20162017                BOOST_PROPERTY_TREE_RAPIDXML_PARSE_ERROR("expected element name", text);
    2017             element->name(name, text - name);
     2018            element->name(text_name, text - text_name);
    20182019           
    20192020            // Skip whitespace between element name and attributes or >
    20202021            skip<whitespace_pred, Flags>(text);
     
    21152116                        text += 9;      // skip '!DOCTYPE '
    21162117                        return parse_doctype<Flags>(text);
    21172118                    }
     2119                                                                                break;
    21182120
     2121                                                                default: break;
     2122
    21192123                }   // switch
    21202124
    21212125                // Attempt to skip other, unrecognized node types starting with <!
     
    22112215            while (attribute_name_pred::test(*text))
    22122216            {
    22132217                // Extract attribute name
    2214                 Ch *name = text;
     2218                Ch *text_name = text;
    22152219                ++text;     // Skip first character of attribute name
    22162220                skip<attribute_name_pred, Flags>(text);
    2217                 if (text == name)
    2218                     BOOST_PROPERTY_TREE_RAPIDXML_PARSE_ERROR("expected attribute name", name);
     2221                if (text == text_name)
     2222                    BOOST_PROPERTY_TREE_RAPIDXML_PARSE_ERROR("expected attribute name", text_name);
    22192223
    22202224                // Create new attribute
    22212225                xml_attribute<Ch> *attribute = this->allocate_attribute();
    2222                 attribute->name(name, text - name);
     2226                attribute->name(text_name, text - text_name);
    22232227                node->append_attribute(attribute);
    22242228
    22252229                // Skip whitespace after attribute name
     
    22442248                ++text;
    22452249
    22462250                // Extract attribute value and expand char refs in it
    2247                 Ch *value = text, *end;
     2251                Ch *text_value = text, *end;
    22482252                const int AttFlags = Flags & ~parse_normalize_whitespace;   // No whitespace normalization in attributes
    22492253                if (quote == Ch('\''))
    22502254                    end = skip_and_expand_character_refs<attribute_value_pred<Ch('\'')>, attribute_value_pure_pred<Ch('\'')>, AttFlags>(text);
     
    22522256                    end = skip_and_expand_character_refs<attribute_value_pred<Ch('"')>, attribute_value_pure_pred<Ch('"')>, AttFlags>(text);
    22532257               
    22542258                // Set attribute value
    2255                 attribute->value(value, end - value);
     2259                attribute->value(text_value, end - text_value);
    22562260               
    22572261                // Make sure that end quote is present
    22582262                if (*text != quote)
  • boost/property_tree/detail/ptree_implementation.hpp

     
    185185    }
    186186
    187187    template<class K, class D, class C> inline
    188     basic_ptree<K, D, C>::basic_ptree(const data_type &data)
    189         : m_data(data), m_children(new typename subs::base_container)
     188    basic_ptree<K, D, C>::basic_ptree(const data_type &p_data)
     189        : m_data(p_data), m_children(new typename subs::base_container)
    190190    {
    191191    }
    192192
  • boost/property_tree/detail/xml_parser_error.hpp

     
    2020    class xml_parser_error: public file_parser_error
    2121    {
    2222    public:
    23         xml_parser_error(const std::string &message,
    24                          const std::string &filename,
    25                          unsigned long line):
    26             file_parser_error(message, filename, line)
     23        xml_parser_error(const std::string &p_message,
     24                         const std::string &p_filename,
     25                         unsigned long p_line):
     26            file_parser_error(p_message, p_filename, p_line)
    2727        {
    2828        }
    2929    };
  • boost/property_tree/detail/xml_parser_writer_settings.hpp

     
    3535    class xml_writer_settings
    3636    {
    3737    public:
    38         xml_writer_settings(Ch indent_char = Ch(' '),
    39                 typename std::basic_string<Ch>::size_type indent_count = 0,
    40                 const std::basic_string<Ch> &encoding = widen<Ch>("utf-8"))
    41             : indent_char(indent_char)
    42             , indent_count(indent_count)
    43             , encoding(encoding)
     38        xml_writer_settings(Ch p_indent_char = Ch(' '),
     39                typename std::basic_string<Ch>::size_type p_indent_count = 0,
     40                const std::basic_string<Ch> &p_encoding = widen<Ch>("utf-8"))
     41            : indent_char(p_indent_char)
     42            , indent_count(p_indent_count)
     43            , encoding(p_encoding)
    4444        {
    4545        }
    4646