Replaced int with ptrdiff_t for offset_debug() and last parsed offset in xml_parse_result
git-svn-id: http://pugixml.googlecode.com/svn/trunk@248 99668b35-9821-0410-8761-19e4c4f06640
This commit is contained in:
parent
f5bdc4b9dc
commit
a78e1ec91c
@ -839,7 +839,7 @@ namespace
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inline xml_parse_result make_parse_result(xml_parse_status status, unsigned int offset, unsigned int line)
|
inline xml_parse_result make_parse_result(xml_parse_status status, ptrdiff_t offset, unsigned int line)
|
||||||
{
|
{
|
||||||
xml_parse_result result = {status, offset, line};
|
xml_parse_result result = {status, offset, line};
|
||||||
return result;
|
return result;
|
||||||
@ -859,7 +859,7 @@ namespace
|
|||||||
#define SCANFOR(X) { while (*s != 0 && !(X)) ++s; }
|
#define SCANFOR(X) { while (*s != 0 && !(X)) ++s; }
|
||||||
#define SCANWHILE(X) { while ((X)) ++s; }
|
#define SCANWHILE(X) { while ((X)) ++s; }
|
||||||
#define ENDSEG() { ch = *s; *s = 0; ++s; }
|
#define ENDSEG() { ch = *s; *s = 0; ++s; }
|
||||||
#define THROW_ERROR(err, m) return make_parse_result(err, static_cast<unsigned int>(m - buffer_start), __LINE__)
|
#define THROW_ERROR(err, m) return make_parse_result(err, m - buffer_start, __LINE__)
|
||||||
#define CHECK_ERROR(err, m) { if (*s == 0) THROW_ERROR(err, m); }
|
#define CHECK_ERROR(err, m) { if (*s == 0) THROW_ERROR(err, m); }
|
||||||
|
|
||||||
xml_parser(xml_allocator& alloc): alloc(alloc)
|
xml_parser(xml_allocator& alloc): alloc(alloc)
|
||||||
@ -2718,7 +2718,7 @@ namespace pugi
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int xml_node::offset_debug() const
|
ptrdiff_t xml_node::offset_debug() const
|
||||||
{
|
{
|
||||||
xml_node_struct* r = root()._root;
|
xml_node_struct* r = root()._root;
|
||||||
|
|
||||||
@ -2736,12 +2736,12 @@ namespace pugi
|
|||||||
case node_element:
|
case node_element:
|
||||||
case node_declaration:
|
case node_declaration:
|
||||||
case node_pi:
|
case node_pi:
|
||||||
return _root->name_allocated ? -1 : static_cast<int>(_root->name - buffer);
|
return _root->name_allocated ? -1 : _root->name - buffer;
|
||||||
|
|
||||||
case node_pcdata:
|
case node_pcdata:
|
||||||
case node_cdata:
|
case node_cdata:
|
||||||
case node_comment:
|
case node_comment:
|
||||||
return _root->value_allocated ? -1 : static_cast<int>(_root->value - buffer);
|
return _root->value_allocated ? -1 : _root->value - buffer;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
@ -1374,7 +1374,7 @@ namespace pugi
|
|||||||
* if element node name has significantly changed; this is guaranteed to return correct offset only for nodes that have not changed
|
* if element node name has significantly changed; this is guaranteed to return correct offset only for nodes that have not changed
|
||||||
* since parsing.
|
* since parsing.
|
||||||
*/
|
*/
|
||||||
int offset_debug() const;
|
ptrdiff_t offset_debug() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef __BORLANDC__
|
#ifdef __BORLANDC__
|
||||||
@ -1697,7 +1697,7 @@ namespace pugi
|
|||||||
xml_parse_status status;
|
xml_parse_status status;
|
||||||
|
|
||||||
/// Last parsed offset (in bytes from file/string start)
|
/// Last parsed offset (in bytes from file/string start)
|
||||||
unsigned int offset;
|
ptrdiff_t offset;
|
||||||
|
|
||||||
/// Line in parser source which reported this
|
/// Line in parser source which reported this
|
||||||
unsigned int line;
|
unsigned int line;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user