Re: foddex - r21842 - in abiword-plugins/branches/abicollab-packet-rewrite/tools/abicollab: backends/xp core/packet/xp

From: J.M. Maurer <uwog_at_uwog.net>
Date: Sat Aug 25 2007 - 01:27:15 CEST

On Fri, 2007-08-24 at 16:14 -0400, Dominic Lachowicz wrote:
> Aren't "uninitialized" UTF8Strings initially "empty"? What does this
> patch do other than obfuscate the change history?

Make valgrind happy...

Dunno why exactly though, but maybe this is it: UT_UTF8Strings are
indeed initially empty (their size is inited to 0). However, the 'data'
member of the UTF8String's member variable pImpl (UT_UTF8Buffer thingy)
is not initialized. Maybe valgrind found a way to get to that data
member.

Marc

> On 8/24/07, cvs@abisource.com <cvs@abisource.com> wrote:
> >
> > Author: foddex
> > Date: 2007-08-24 22:12:40 +0200 (Fri, 24 Aug 2007)
> > New Revision: 21842
> >
> > Modified:
> > abiword-plugins/branches/abicollab-packet-rewrite/tools/abicollab/backends/xp/SessionEvent.h
> > abiword-plugins/branches/abicollab-packet-rewrite/tools/abicollab/core/packet/xp/AbiCollab_Packet.h
> > Log:
> > Several uninitialized UT_UTF8String related problems fixed
> >
> > Modified: abiword-plugins/branches/abicollab-packet-rewrite/tools/abicollab/backends/xp/SessionEvent.h
> > ===================================================================
> > --- abiword-plugins/branches/abicollab-packet-rewrite/tools/abicollab/backends/xp/SessionEvent.h 2007-08-24 14:55:22 UTC (rev 21841)
> > +++ abiword-plugins/branches/abicollab-packet-rewrite/tools/abicollab/backends/xp/SessionEvent.h 2007-08-24 20:12:40 UTC (rev 21842)
> > @@ -47,7 +47,7 @@
> > {
> > public:
> > DECLARE_PACKET(JoinSessionEvent);
> > - JoinSessionEvent() {}
> > + JoinSessionEvent() : m_sSessionId("") {}
> > JoinSessionEvent(const UT_UTF8String& sessionId)
> > : m_sSessionId(sessionId)
> > {
> > @@ -73,9 +73,12 @@
> > {
> > public:
> > DECLARE_PACKET(JoinSessionRequestResponseEvent);
> > - JoinSessionRequestResponseEvent() {}
> > + JoinSessionRequestResponseEvent() : m_sDocumentName(""), m_sDocumentId(""), m_sSessionId("") {}
> > JoinSessionRequestResponseEvent(const UT_UTF8String& sessionId)
> > : m_sSessionId(sessionId)
> > + , m_iRev(0)
> > + , m_sDocumentName("")
> > + , m_sDocumentId("")
> > {
> > UT_ASSERT(m_sSessionId != "");
> > }
> > @@ -96,7 +99,7 @@
> > {
> > public:
> > DECLARE_PACKET(DisjoinSessionEvent);
> > - DisjoinSessionEvent() {}
> > + DisjoinSessionEvent() : m_sSessionId("") {}
> > DisjoinSessionEvent(const UT_UTF8String& sessionId)
> > : m_sSessionId(sessionId)
> > {
> > @@ -114,7 +117,7 @@
> > {
> > public:
> > DECLARE_PACKET(CloseSessionEvent);
> > - CloseSessionEvent() {}
> > + CloseSessionEvent() : m_sSessionId("") {}
> > CloseSessionEvent(const UT_UTF8String& sessionId)
> > : m_sSessionId(sessionId)
> > {
> >
> > Modified: abiword-plugins/branches/abicollab-packet-rewrite/tools/abicollab/core/packet/xp/AbiCollab_Packet.h
> > ===================================================================
> > --- abiword-plugins/branches/abicollab-packet-rewrite/tools/abicollab/core/packet/xp/AbiCollab_Packet.h 2007-08-24 14:55:22 UTC (rev 21841)
> > +++ abiword-plugins/branches/abicollab-packet-rewrite/tools/abicollab/core/packet/xp/AbiCollab_Packet.h 2007-08-24 20:12:40 UTC (rev 21842)
> > @@ -196,7 +196,7 @@
> > DECLARE_ABSTRACT_PACKET(SessionPacket);
> > DECLARE_SERIALIZABLE_PACKET;
> >
> > - SessionPacket() {}
> > + SessionPacket() : m_sSessionId("") {}
> > SessionPacket(const UT_UTF8String& sSessionId);
> >
> > virtual PacketType getType() const
> > @@ -255,7 +255,7 @@
> > {
> > public:
> > DECLARE_PACKET(ChangeRecordSessionPacket);
> > - ChangeRecordSessionPacket() : m_cType(PX_ChangeRecord::PXType(0)), m_crType(PacketSessionType(0)) {}
> > + ChangeRecordSessionPacket() : m_cType(PX_ChangeRecord::PXType(0)), m_crType(PacketSessionType(0)), m_sDocUUID(""), m_sText("") {}
> > ChangeRecordSessionPacket(
> > const UT_UTF8String& sSessionId,
> > PX_ChangeRecord::PXType cType,
> > @@ -322,7 +322,7 @@
> > class ABI_EXPORT InsertSpan_ChangeRecordSessionPacket : public ChangeRecordSessionPacket {
> > public:
> > DECLARE_PACKET(InsertSpan_ChangeRecordSessionPacket);
> > - InsertSpan_ChangeRecordSessionPacket() {}
> > + InsertSpan_ChangeRecordSessionPacket() : m_sText("") {}
> > InsertSpan_ChangeRecordSessionPacket(
> > const UT_UTF8String& sSessionId,
> > PX_ChangeRecord::PXType cType,
> > @@ -332,6 +332,7 @@
> > int iPos,
> > PacketSessionType crType)
> > : ChangeRecordSessionPacket( sSessionId, cType, sDocUUID, iRev, iRemoteRev, iPos, crType )
> > + , m_sText("")
> > {}
> >
> > // XXX: make proper setters/getters when done!
> >
> > -----------------------------------------------
> > To unsubscribe from this list, send a message to
> > abisource-cvs-commit-request@abisource.com with the word
> > unsubscribe in the message body.
> >
>
>
Received on Sat Aug 25 01:28:08 2007

This archive was generated by hypermail 2.1.8 : Sat Aug 25 2007 - 01:28:08 CEST