summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2026-01-18 14:14:58 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2026-01-21 12:17:15 +0900
commitec615dc3b52d4faafbebd7b4229fd4a1ea2a75ee (patch)
tree14eec856a52cf6f7791fca58a79f0e4c859658e4
parentb6ba99e65a0cc61fe3ddb84123779630e103f4d6 (diff)
downloadtqt-master.tar.gz
tqt-master.zip
Don't look up '0-serialized' pointers in TQGDict. This replaces PR #263HEADmaster
It makes no logical sense to serialize a pointer value and in fact 0 is written. So the call to look_ptr is never executed when deserializing a pointer. Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
-rw-r--r--src/tools/tqgdict.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/tools/tqgdict.cpp b/src/tools/tqgdict.cpp
index d810cbe0f..b587eb9fb 100644
--- a/src/tools/tqgdict.cpp
+++ b/src/tools/tqgdict.cpp
@@ -945,12 +945,8 @@ TQDataStream &TQGDict::read( TQDataStream &s )
TQ_UINT32 k;
s >> k;
read( s, d );
- // ### cannot insert 0 - this renders the thing
- // useless since all pointers are written as 0,
- // but hey, serializing pointers? can it be done
- // at all, ever?
- if ( k )
- look_ptr( (void *)k, d, op_insert );
+ // Pointer real values are not serialized, so it doesn't make sense
+ // to insert null values back into the dictionary by calling 'look_ptr' here
}
break;
}
@@ -980,7 +976,7 @@ TQDataStream& TQGDict::write( TQDataStream &s ) const
s << (TQ_UINT32)((TQIntBucket*)n)->getKey();
break;
case PtrKey:
- s << (TQ_UINT32)0; // ### cannot serialize a pointer
+ s << (TQ_UINT32)0; // ### it doesn't make sense to serialize a pointer's value
break;
}
write( s, n->getData() ); // write data