summaryrefslogtreecommitdiffstats
path: root/src/corelib/serialization
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-04-16 12:56:58 +0200
committerLars Knoll <lars.knoll@qt.io>2020-05-10 11:31:50 +0200
commitbabcabfbc899d5a72b282f8cf0b510840e91ba0e (patch)
treed4e89b175401d8daa0ca83675ab6b2f24de109e7 /src/corelib/serialization
parenta77b19a911c4d6c47c185a8e59ebbcec8b14bcca (diff)
Clean up state handling for ICU and iconv based codecs
Get rid of the hack for the FreeFunction and instead add a proper function pointer to clear the data to the ConverterState struct. Change-Id: I104aae1a4381c69f1a254713ec76e1aeaa862cdc Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib/serialization')
-rw-r--r--src/corelib/serialization/qtextstream.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/corelib/serialization/qtextstream.cpp b/src/corelib/serialization/qtextstream.cpp
index 9325cd9163..cb72b28511 100644
--- a/src/corelib/serialization/qtextstream.cpp
+++ b/src/corelib/serialization/qtextstream.cpp
@@ -364,12 +364,14 @@ static void copyConverterStateHelper(QTextCodec::ConverterState *dest,
{
// ### QTextCodec::ConverterState's copy constructors and assignments are
// private. This function copies the structure manually.
- Q_ASSERT(!src->d);
+ Q_ASSERT(!src->clearFn);
dest->flags = src->flags;
+ dest->remainingChars = src->remainingChars;
dest->invalidChars = src->invalidChars;
dest->state_data[0] = src->state_data[0];
dest->state_data[1] = src->state_data[1];
dest->state_data[2] = src->state_data[2];
+ dest->state_data[3] = src->state_data[3];
}
#endif
@@ -787,7 +789,7 @@ inline void QTextStreamPrivate::consume(int size)
inline void QTextStreamPrivate::saveConverterState(qint64 newPos)
{
#if QT_CONFIG(textcodec)
- if (readConverterState.d) {
+ if (readConverterState.clearFn) {
// converter cannot be copied, so don't save anything
// don't update readBufferStartDevicePos either
return;