Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2009-08

DOM patch

10 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Dariusz Mazur

Hi
I use DOM from fcl-xml both for Delphi and FPC development. I work with older version, till I notice serious bugs. Today i've upgrade it from current svn. And problem: Delphi don't compile I've made several changes in dom, xmlutil. Diff attached.

As i expect, bugs in new version disappear.

It's not change much.
Can someone review it?

Darek

Reply by email

Michael Van Canneyt
to Dariusz Mazur
Dariusz Mazur wrote 11 lines
Hi I use DOM from fcl-xml both for Delphi and FPC development. I work with older version, till I notice serious bugs. Today i've upgrade it from current svn. And problem: Delphi don't compile I've made several changes in dom, xmlutil. Diff attached. As i expect, bugs in new version disappear. It's not change much. Can someone review it?

Reviewed and applied. Thanks !

Michael.

Reply by email

Marco van de Voort
to Michael Van Canneyt

In our previous episode, Michael Van Canneyt said:

Show quoted text 7 lines
> As i expect, bugs in new version disappear. > > > It's not change much. > Can someone review it? Reviewed and applied. Thanks !

I also use parts of fcl-xml under Delphi, and also some fpimage parts.

Since D2009, a lot less patches are needed due to $pointermath

Reply by email

Michael Van Canneyt
to Michael Van Canneyt: Reviewed and applied. Thanks ! Michael.
Michael Van Canneyt wrote 17 lines
On Thu, 27 Aug 2009, Dariusz Mazur wrote: > Hi > I use DOM from fcl-xml both for Delphi and FPC development. > I work with older version, till I notice serious bugs. Today i've upgrade > it from current svn. And problem: Delphi don't compile > I've made several changes in dom, xmlutil. Diff attached. > > As i expect, bugs in new version disappear. > > > It's not change much. > Can someone review it? Reviewed and applied. Thanks !

Hm. Something strange with compilation.
I reversed the patch, because xmlutils.pp does not compile with the patch.

Strange that I didn't notice the first time I called make ?

Could you look at FPC compilation and make a new patch ?

Michael.

Reply by email

Sergei Gorelkin
to Michael Van Canneyt
Michael Van Canneyt wrote 8 lines
Hm. Something strange with compilation. I reversed the patch, because xmlutils.pp does not compile with the patch. Strange that I didn't notice the first time I called make ? Could you look at FPC compilation and make a new patch ?

To my knowledge,
- To make it compilable with Delphi, at least avl_tree.pp from fcl-base

   must be patched, too;

- Using PtrInt for doing pointer math is discouraged in favor of

   PtrUInt;

Sergei

Reply by email

Dariusz Mazur
to Michael Van Canneyt: Hm. Something strange with compilation. I reversed the patch, because xmlutils.pp does…

Michael Van Canneyt pisze:

Show quoted text 28 lines
On Thu, 27 Aug 2009, Michael Van Canneyt wrote: > > > On Thu, 27 Aug 2009, Dariusz Mazur wrote: > >> Hi >> I use DOM from fcl-xml both for Delphi and FPC development. >> I work with older version, till I notice serious bugs. Today i've >> upgrade it from current svn. And problem: Delphi don't compile >> I've made several changes in dom, xmlutil. Diff attached. >> >> As i expect, bugs in new version disappear. >> >> >> It's not change much. >> Can someone review it? > > Reviewed and applied. Thanks ! Hm. Something strange with compilation. I reversed the patch, because xmlutils.pp does not compile with the patch. Strange that I didn't notice the first time I called make ? Could you look at FPC compilation and make a new patch ?

new patch attached.
tested with FPC also, but a cant use testgen

changed xmlconf
1. compilation by Delphi
2. added procedure reload

Darek

Darek

Reply by email

Jonas Maebe
to Dariusz Mazur
Dariusz Mazur wrote 12 lines
> - Using PtrInt for doing pointer math is discouraged in favor of > PtrUInt; > I've changed PtrInt do PtrUInt, but its not possible in each place how to resolve tClass= tClass(PtrUInt +ptrInt) FPC claim: combined unsigned and signed make result 64bit, which is incompatible with pointer what is proper way to resolve this

Cast the ptruint to pointer (although I don't know whether this is Delphi-compatible).

Jonas

Reply by email

Dariusz Mazur
to Jonas Maebe

Jonas Maebe pisze:

Show quoted text 18 lines
On 28 Aug 2009, at 13:10, Dariusz Mazur wrote: >> - Using PtrInt for doing pointer math is discouraged in favor of >> PtrUInt; >> > I've changed PtrInt do PtrUInt, but its not possible in each place > > how to resolve > tClass= tClass(PtrUInt +ptrInt) > > FPC claim: combined unsigned and signed make result 64bit, which is > incompatible with pointer > > what is proper way to resolve this Cast the ptruint to pointer (although I don't know whether this is Delphi-compatible).

I know this, but it look strange

 FCurrBlock := TDOMNode(pointer(ptrUInt(ext) + sizeof(TExtent) +
(AElemCount - 1) * FElementSize));

I can change FElementSize and AElemCount to longword but result sizeof is integer

much better look
 FCurrBlock := TDOMNode(ptrInt(ext) + sizeof(TExtent) + (AElemCount - 1)
* FElementSize);
or
ptrUInt( FCurrBlock) := ptrUInt(ext) + sizeof(TExtent) + (AElemCount -
1) * FElementSize;

which is proper?

Darek

Reply by email

Sergei Gorelkin
to Dariusz Mazur: Michael Van Canneyt pisze: new patch attached. tested with FPC also, but a cant use…
Dariusz Mazur wrote 36 lines
Michael Van Canneyt pisze: > > > On Thu, 27 Aug 2009, Michael Van Canneyt wrote: > >> >> >> On Thu, 27 Aug 2009, Dariusz Mazur wrote: >> >>> Hi >>> I use DOM from fcl-xml both for Delphi and FPC development. >>> I work with older version, till I notice serious bugs. Today i've >>> upgrade it from current svn. And problem: Delphi don't compile >>> I've made several changes in dom, xmlutil. Diff attached. >>> >>> As i expect, bugs in new version disappear. >>> >>> >>> It's not change much. >>> Can someone review it? >> >> Reviewed and applied. Thanks ! > > Hm. Something strange with compilation. I reversed the patch, because > xmlutils.pp does not compile with the patch. > > Strange that I didn't notice the first time I called make ? > > Could you look at FPC compilation and make a new patch ? new patch attached. tested with FPC also, but a cant use testgen changed xmlconf 1. compilation by Delphi 2. added procedure reload

This variable was unsigned for a long time, but recently I changed it to signed because it was causing crashes on x86_64 :-)

--- xmlread.pp (wersja 13601)
+++ xmlread.pp (kopia robocza)
@@ -925,7 +925,7 @@

  function TXMLDecodingSource.Reload: Boolean;
  var
-  Remainder: PtrInt;
+  Remainder: ptrUInt;
    r, inLeft: Cardinal;
    rslt: Integer;
  begin

Thank you for the patch. I'll modify it a bit and apply this weekend.

Sergei

Reply by email