From 4834b3544d93379cea5cd3ae76e759437f0d3d69 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Sun, 19 Aug 2012 20:59:28 +0200 Subject: [PATCH] Avoid value narrowing; prevents warnings --- src/common/xml/xml.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/common/xml/xml.h b/src/common/xml/xml.h index 540b62d7b..67b3075de 100644 --- a/src/common/xml/xml.h +++ b/src/common/xml/xml.h @@ -44,9 +44,9 @@ public: class invalid_attribute_x: public exception { protected: std::string m_message, m_node, m_attribute; - size_t m_position; + ptrdiff_t m_position; public: - invalid_attribute_x(std::string const &node, std::string const &attribute, size_t position) + invalid_attribute_x(std::string const &node, std::string const &attribute, ptrdiff_t position) : m_node(node) , m_attribute(attribute) , m_position(position) @@ -63,9 +63,9 @@ public: class invalid_child_node_x: public exception { protected: std::string m_message, m_node, m_parent; - size_t m_position; + ptrdiff_t m_position; public: - invalid_child_node_x(std::string const &node, std::string const &parent, size_t position) + invalid_child_node_x(std::string const &node, std::string const &parent, ptrdiff_t position) : m_node(node) , m_parent(parent) , m_position(position) @@ -82,9 +82,9 @@ public: class duplicate_child_node_x: public exception { protected: std::string m_message, m_node, m_parent; - size_t m_position; + ptrdiff_t m_position; public: - duplicate_child_node_x(std::string const &node, std::string const &parent, size_t position) + duplicate_child_node_x(std::string const &node, std::string const &parent, ptrdiff_t position) : m_node(node) , m_parent(parent) , m_position(position) @@ -101,9 +101,9 @@ public: class malformed_data_x: public exception { protected: std::string m_message, m_node; - size_t m_position; + ptrdiff_t m_position; public: - malformed_data_x(std::string const &node, size_t position, std::string const &details = std::string{}) + malformed_data_x(std::string const &node, ptrdiff_t position, std::string const &details = std::string{}) : m_node(node) , m_position(position) { @@ -121,9 +121,9 @@ public: class out_of_range_x: public exception { protected: std::string m_message, m_node; - size_t m_position; + ptrdiff_t m_position; public: - out_of_range_x(std::string const &node, size_t position, std::string const &details = std::string{}) + out_of_range_x(std::string const &node, ptrdiff_t position, std::string const &details = std::string{}) : m_node(node) , m_position(position) {