diff options
author | Lars Knoll <lars.knoll@qt.io> | 2019-01-23 10:20:20 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2019-01-25 18:01:32 +0000 |
commit | cdbc19060fafebc407189e19c103826abad981a4 (patch) | |
tree | f934ec99f3610ee6a6482dd1df12b044d502b488 /src/corelib/serialization/qxmlstream.g | |
parent | 991c498905e2083fadfa8ef6e1ea84d5488e92ad (diff) |
Update qxmlstream.g with changes from qxmlstream_p.h
Some updates that made it into qxmlstream_p.h have not been reflected
in qxmlstream.g. Also fix the expected amount of shift/reduce
conflicts.
Fixes: QTBUG-60186
Change-Id: I2a5e1c579dbbe8812a75ca6bb1e3a6a0ba909cdf
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/serialization/qxmlstream.g')
-rw-r--r-- | src/corelib/serialization/qxmlstream.g | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/corelib/serialization/qxmlstream.g b/src/corelib/serialization/qxmlstream.g index 10bfcd491c..e6328a11ac 100644 --- a/src/corelib/serialization/qxmlstream.g +++ b/src/corelib/serialization/qxmlstream.g @@ -41,6 +41,8 @@ %merged_output qxmlstream_p.h +%expect 4 + %token NOTOKEN %token SPACE " " %token LANGLE "<" @@ -144,7 +146,12 @@ %start document + + /. + +#include <QtCore/private/qglobal_p.h> + template <typename T> class QXmlStreamSimpleStack { T *data; int tos, cap; @@ -155,7 +162,8 @@ public: inline void reserve(int extraCapacity) { if (tos + extraCapacity + 1 > cap) { cap = qMax(tos + extraCapacity + 1, cap << 1 ); - data = reinterpret_cast<T *>(realloc(data, cap * sizeof(T))); + void *ptr = realloc(static_cast<void *>(data), cap * sizeof(T)); + data = reinterpret_cast<T *>(ptr); Q_CHECK_PTR(data); } } @@ -753,7 +761,7 @@ bool QXmlStreamReaderPrivate::parse() state_stack[tos] = 0; return true; } else if (act > 0) { - if (++tos == stack_size-1) + if (++tos >= stack_size-1) reallocateStack(); Value &val = sym_stack[tos]; @@ -890,7 +898,7 @@ doctype_decl ::= langle_bang DOCTYPE qname markup space_opt RANGLE; /. case $rule_number: dtdName = symString(3); - // fall through + Q_FALLTHROUGH(); ./ doctype_decl ::= doctype_decl_start external_id space_opt markup space_opt RANGLE; /. |