Sign in Join

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

Mailing lists / lazarus / 2002-12

setposition-seek problem found

8 messages · 5 people ·

Reply by email Subscribe to this list Your subscription

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

Unknown author
to Peter Vreman: The problem is not in the compiler but in the FCL: There are 2 seek methods:…
Peter Vreman wrote 19 lines
The problem is not in the compiler but in the FCL: There are 2 seek methods: Seek(int64,TSeekOrigin); Seek(Longint,Word); And in Setposition(int64) is the following code: Seek(pos,soFromBeginning); with soFromBeginning defined as: { TStream seek origins } const soFromBeginning = 0; And this is an integer value that is not compatible with the TSeekOrigin enumarted type. So the Seek(longint,Word) will be called.

I have changed it. All compiles with 1.0.7 and 1.1

Michael

Reply by email

Mattias Gaertner
to Peter Vreman: The problem is not in the compiler but in the FCL: There are 2 seek methods:…
Show quoted text 20 lines
On Wed, 18 Dec 2002, Peter Vreman wrote: > The problem is not in the compiler but in the FCL: > > There are 2 seek methods: > > Seek(int64,TSeekOrigin); > Seek(Longint,Word); > > And in Setposition(int64) is the following code: > > Seek(pos,soFromBeginning); > > with soFromBeginning defined as: > > { TStream seek origins } > const > soFromBeginning = 0;

Must be a borland invention ;)

> And this is an integer value that is not compatible with the TSeekOrigin > enumarted type. So the Seek(longint,Word) will be called. I have changed it. All compiles with 1.0.7 and 1.1

I found two other bugs. The first is is an unset function result in

  function TStream.Seek(Offset: Int64; Origin: TSeekorigin): Int64;
    begin
      // Backwards compatibility that calls the longint Seek
      if (Offset<Low(longint)) or
         (Offset>High(longint)) then
        raise ERangeError.Create(SRangeError);
      Result:=Seek(longint(Offset),ord(Origin));
    end;

The other one can destroy xml files. I'm searching ...

Mattias

Reply by email

Mattias Gaertner
to Peter Vreman: The problem is not in the compiler but in the FCL: There are 2 seek methods:…
Show quoted text 5 lines
> I found two other bugs. The first is is an unset function result in > > function TStream.Seek(Offset: Int64; Origin: TSeekorigin): Int64; Fixed

The other one was the widestring usage of the lazarus xml units. I deactivated it.
Now lazarus seems to work with 1.1. :)
So many nice new features. :)

Big thx to the FPC team.

I will add interface support to the codetools in the next days.

Mattias

Reply by email

Peter Vreman
to Mattias Gaertner
Show quoted text 10 lines
> The other one was the widestring usage of the lazarus xml units. I > deactivated it. > Now lazarus seems to work with 1.1. :) > So many nice new features. :) > Will there be a fpc 1.1 rpm, which can compile lazarus, on the lazarus site? Or is fpc 1.1 still to much changing and unstable?

1.1 is "stable". The only thing is that it sometimes can be broken (like the current CVS version) for a few days. So always keeping a working 1.1 as backup is recommended.

The rpm building should still work for 1.1, there are no changes in directory structure.

Reply by email

Peter Vreman

The problem is not in the compiler but in the FCL:

There are 2 seek methods:

Seek(int64,TSeekOrigin);
Seek(Longint,Word);

And in Setposition(int64) is the following code:

Seek(pos,soFromBeginning);

with soFromBeginning defined as:

{ TStream seek origins }
const
  soFromBeginning = 0;

And this is an integer value that is not compatible with the TSeekOrigin enumarted type. So the Seek(longint,Word) will be called.

Reply by email

Marc Weustink
to Vincent Snijders: Will there be a fpc 1.1 rpm, which can compile lazarus, on the lazarus site? Or is fpc…
Peter Vreman wrote 17 lines
> >> The other one was the widestring usage of the lazarus xml units. I >> deactivated it. >> Now lazarus seems to work with 1.1. :) >> So many nice new features. :) >> > > Will there be a fpc 1.1 rpm, which can compile lazarus, on the lazarus > site? > Or is fpc 1.1 still to much changing and unstable? 1.1 is "stable". The only thing is that it sometimes can be broken (like the current CVS version) for a few days. So always keeping a working 1.1 as backup is recommended. The rpm building should still work for 1.1, there are no changes in directory structure.

OK, so I'll start to build a RPM. This may take some days (trying etc)

Marc

Reply by email