Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pugixml dependency to v1.12.1 #4514

Merged
merged 1 commit into from May 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
63 changes: 0 additions & 63 deletions contrib/pugixml/contrib/foreach.hpp

This file was deleted.

6 changes: 3 additions & 3 deletions contrib/pugixml/readme.txt
@@ -1,6 +1,6 @@
pugixml 1.11 - an XML processing library
pugixml 1.12 - an XML processing library

Copyright (C) 2006-2020, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com)
Copyright (C) 2006-2022, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com)
Report bugs and download new versions at https://pugixml.org/

This is the distribution of pugixml, which is a C++ XML processing library,
Expand All @@ -26,7 +26,7 @@ The distribution contains the following folders:

This library is distributed under the MIT License:

Copyright (c) 2006-2019 Arseny Kapoulkine
Copyright (c) 2006-2022 Arseny Kapoulkine

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
Expand Down
6 changes: 3 additions & 3 deletions contrib/pugixml/src/pugiconfig.hpp
@@ -1,7 +1,7 @@
/**
* pugixml parser - version 1.11
* pugixml parser - version 1.12
* --------------------------------------------------------
* Copyright (C) 2006-2020, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com)
* Copyright (C) 2006-2022, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com)
* Report bugs and download new versions at https://pugixml.org/
*
* This library is distributed under the MIT License. See notice at the end
Expand Down Expand Up @@ -52,7 +52,7 @@
#endif

/**
* Copyright (c) 2006-2020 Arseny Kapoulkine
* Copyright (c) 2006-2022 Arseny Kapoulkine
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
Expand Down
45 changes: 27 additions & 18 deletions contrib/pugixml/src/pugixml.cpp
@@ -1,7 +1,7 @@
/**
* pugixml parser - version 1.11
* pugixml parser - version 1.12
* --------------------------------------------------------
* Copyright (C) 2006-2020, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com)
* Copyright (C) 2006-2022, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com)
* Report bugs and download new versions at https://pugixml.org/
*
* This library is distributed under the MIT License. See notice at the end
Expand Down Expand Up @@ -132,8 +132,10 @@ using std::memset;
#endif

// In some environments MSVC is a compiler but the CRT lacks certain MSVC-specific features
#if defined(_MSC_VER) && !defined(__S3E__)
#if defined(_MSC_VER) && !defined(__S3E__) && !defined(_WIN32_WCE)
# define PUGI__MSVC_CRT_VERSION _MSC_VER
#elif defined(_WIN32_WCE)
# define PUGI__MSVC_CRT_VERSION 1310 // MSVC7.1
#endif

// Not all platforms have snprintf; we define a wrapper that uses snprintf if possible. This only works with buffers with a known size.
Expand Down Expand Up @@ -526,7 +528,8 @@ PUGI__NS_BEGIN
xml_memory_page* page = xml_memory_page::construct(memory);
assert(page);

page->allocator = _root->allocator;
assert(this == _root->allocator);
page->allocator = this;

return page;
}
Expand Down Expand Up @@ -4732,7 +4735,7 @@ PUGI__NS_BEGIN
// we need to get length of entire file to load it in memory; the only (relatively) sane way to do it is via seek/tell trick
PUGI__FN xml_parse_status get_file_size(FILE* file, size_t& out_result)
{
#if defined(PUGI__MSVC_CRT_VERSION) && PUGI__MSVC_CRT_VERSION >= 1400 && !defined(_WIN32_WCE)
#if defined(PUGI__MSVC_CRT_VERSION) && PUGI__MSVC_CRT_VERSION >= 1400
// there are 64-bit versions of fseek/ftell, let's use them
typedef __int64 length_type;

Expand Down Expand Up @@ -6735,7 +6738,7 @@ namespace pugi
return const_cast<xml_node*>(&_wrap); // BCC5 workaround
}

PUGI__FN const xml_node_iterator& xml_node_iterator::operator++()
PUGI__FN xml_node_iterator& xml_node_iterator::operator++()
{
assert(_wrap._root);
_wrap._root = _wrap._root->next_sibling;
Expand All @@ -6749,7 +6752,7 @@ namespace pugi
return temp;
}

PUGI__FN const xml_node_iterator& xml_node_iterator::operator--()
PUGI__FN xml_node_iterator& xml_node_iterator::operator--()
{
_wrap = _wrap._root ? _wrap.previous_sibling() : _parent.last_child();
return *this;
Expand Down Expand Up @@ -6796,7 +6799,7 @@ namespace pugi
return const_cast<xml_attribute*>(&_wrap); // BCC5 workaround
}

PUGI__FN const xml_attribute_iterator& xml_attribute_iterator::operator++()
PUGI__FN xml_attribute_iterator& xml_attribute_iterator::operator++()
{
assert(_wrap._attr);
_wrap._attr = _wrap._attr->next_attribute;
Expand All @@ -6810,7 +6813,7 @@ namespace pugi
return temp;
}

PUGI__FN const xml_attribute_iterator& xml_attribute_iterator::operator--()
PUGI__FN xml_attribute_iterator& xml_attribute_iterator::operator--()
{
_wrap = _wrap._attr ? _wrap.previous_attribute() : _parent.last_attribute();
return *this;
Expand Down Expand Up @@ -6857,7 +6860,7 @@ namespace pugi
return const_cast<xml_node*>(&_wrap); // BCC5 workaround
}

PUGI__FN const xml_named_node_iterator& xml_named_node_iterator::operator++()
PUGI__FN xml_named_node_iterator& xml_named_node_iterator::operator++()
{
assert(_wrap._root);
_wrap = _wrap.next_sibling(_name);
Expand All @@ -6871,7 +6874,7 @@ namespace pugi
return temp;
}

PUGI__FN const xml_named_node_iterator& xml_named_node_iterator::operator--()
PUGI__FN xml_named_node_iterator& xml_named_node_iterator::operator--()
{
if (_wrap._root)
_wrap = _wrap.previous_sibling(_name);
Expand Down Expand Up @@ -7091,8 +7094,12 @@ namespace pugi
#endif

// move allocation state
doc->_root = other->_root;
doc->_busy_size = other->_busy_size;
// note that other->_root may point to the embedded document page, in which case we should keep original (empty) state
if (other->_root != PUGI__GETPAGE(other))
{
doc->_root = other->_root;
doc->_busy_size = other->_busy_size;
}

// move buffer state
doc->buffer = other->buffer;
Expand Down Expand Up @@ -8265,7 +8272,7 @@ PUGI__NS_BEGIN
}

// gets mantissa digits in the form of 0.xxxxx with 0. implied and the exponent
#if defined(PUGI__MSVC_CRT_VERSION) && PUGI__MSVC_CRT_VERSION >= 1400 && !defined(_WIN32_WCE)
#if defined(PUGI__MSVC_CRT_VERSION) && PUGI__MSVC_CRT_VERSION >= 1400
PUGI__FN void convert_number_to_mantissa_exponent(double value, char (&buffer)[32], char** out_mantissa, int* out_exponent)
{
// get base values
Expand Down Expand Up @@ -11822,15 +11829,17 @@ PUGI__NS_BEGIN
lexeme_t l = _lexer.current();
_lexer.next();

if (++_depth > xpath_ast_depth_limit)
return error_rec();

if (l == lex_double_slash)
{
n = alloc_node(ast_step, n, axis_descendant_or_self, nodetest_type_node, 0);
if (!n) return 0;

++_depth;
}

if (++_depth > xpath_ast_depth_limit)
return error_rec();

n = parse_step(n);
if (!n) return 0;
}
Expand Down Expand Up @@ -12995,7 +13004,7 @@ namespace pugi
#endif

/**
* Copyright (c) 2006-2020 Arseny Kapoulkine
* Copyright (c) 2006-2022 Arseny Kapoulkine
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
Expand Down
24 changes: 13 additions & 11 deletions contrib/pugixml/src/pugixml.hpp
@@ -1,7 +1,7 @@
/**
* pugixml parser - version 1.11
* pugixml parser - version 1.12
* --------------------------------------------------------
* Copyright (C) 2006-2020, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com)
* Copyright (C) 2006-2022, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com)
* Report bugs and download new versions at https://pugixml.org/
*
* This library is distributed under the MIT License. See notice at the end
Expand All @@ -11,10 +11,10 @@
* Copyright (C) 2003, by Kristen Wegner (kristen@tima.net)
*/

#ifndef PUGIXML_VERSION
// Define version macro; evaluates to major * 1000 + minor * 10 + patch so that it's safe to use in less-than comparisons
// Note: pugixml used major * 100 + minor * 10 + patch format up until 1.9 (which had version identifier 190); starting from pugixml 1.10, the minor version number is two digits
# define PUGIXML_VERSION 1110
#ifndef PUGIXML_VERSION
# define PUGIXML_VERSION 1120 // 1.12
#endif

// Include user configuration file (this can define various configuration macros)
Expand Down Expand Up @@ -312,6 +312,8 @@ namespace pugi
It begin() const { return _begin; }
It end() const { return _end; }

bool empty() const { return _begin == _end; }

private:
It _begin, _end;
};
Expand Down Expand Up @@ -851,10 +853,10 @@ namespace pugi
xml_node& operator*() const;
xml_node* operator->() const;

const xml_node_iterator& operator++();
xml_node_iterator& operator++();
xml_node_iterator operator++(int);

const xml_node_iterator& operator--();
xml_node_iterator& operator--();
xml_node_iterator operator--(int);
};

Expand Down Expand Up @@ -893,10 +895,10 @@ namespace pugi
xml_attribute& operator*() const;
xml_attribute* operator->() const;

const xml_attribute_iterator& operator++();
xml_attribute_iterator& operator++();
xml_attribute_iterator operator++(int);

const xml_attribute_iterator& operator--();
xml_attribute_iterator& operator--();
xml_attribute_iterator operator--(int);
};

Expand Down Expand Up @@ -929,10 +931,10 @@ namespace pugi
xml_node& operator*() const;
xml_node* operator->() const;

const xml_named_node_iterator& operator++();
xml_named_node_iterator& operator++();
xml_named_node_iterator operator++(int);

const xml_named_node_iterator& operator--();
xml_named_node_iterator& operator--();
xml_named_node_iterator operator--(int);

private:
Expand Down Expand Up @@ -1474,7 +1476,7 @@ namespace std
#endif

/**
* Copyright (c) 2006-2020 Arseny Kapoulkine
* Copyright (c) 2006-2022 Arseny Kapoulkine
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
Expand Down