diff options
author | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2016-07-15 19:12:21 -0500 |
---|---|---|
committer | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2016-07-15 19:12:21 -0500 |
commit | 666a01d3357ee7327e6cef6453f183f5c4c3a016 (patch) | |
tree | 6a407c1b265f022360bd5147b1a13b5b983bdd21 | |
parent | 5b102d108d9a02f3c697638a6cd7877f19f3173f (diff) |
Use references for output variables
While I grew to dislike references for this case, there are other functions in
the source that use references so switch to that for consistency.
-rw-r--r-- | src/pugixml.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/pugixml.cpp b/src/pugixml.cpp index c92e66e..d2f0d6b 100644 --- a/src/pugixml.cpp +++ b/src/pugixml.cpp @@ -1895,7 +1895,7 @@ PUGI__NS_BEGIN return is_little_endian() ? encoding_utf32_le : encoding_utf32_be; } - PUGI__FN bool parse_declaration_encoding(const uint8_t* data, size_t size, const uint8_t** out_encoding, size_t* out_length) + PUGI__FN bool parse_declaration_encoding(const uint8_t* data, size_t size, const uint8_t*& out_encoding, size_t& out_length) { #define PUGI__SCANCHAR(ch) { if (offset >= size || data[offset] != ch) return false; offset++; } #define PUGI__SCANCHARTYPE(ct) { while (offset < size && PUGI__IS_CHARTYPE(data[offset], ct)) offset++; } @@ -1931,11 +1931,11 @@ PUGI__NS_BEGIN size_t start = offset; - *out_encoding = data + offset; + out_encoding = data + offset; PUGI__SCANCHARTYPE(ct_symbol); - *out_length = offset - start; + out_length = offset - start; PUGI__SCANCHAR(delimiter); @@ -1977,7 +1977,7 @@ PUGI__NS_BEGIN const uint8_t* enc = 0; size_t enc_length = 0; - if (d0 == 0x3c && d1 == 0x3f && d2 == 0x78 && d3 == 0x6d && parse_declaration_encoding(data, size, &enc, &enc_length)) + if (d0 == 0x3c && d1 == 0x3f && d2 == 0x78 && d3 == 0x6d && parse_declaration_encoding(data, size, enc, enc_length)) { // iso-8859-1 (case-insensitive) if (enc_length == 10 |