Sign in Join

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

Mailing lists / fpc-pascal / 2014-04

minigzip example does not compile (?)

8 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

Juha Manninen

I also have a gzip related issue.
I try to test with paszlib/examples/minigzip but the compiler gives :

minigzip.pas(73,40) Error: Call by var for arg no. 2 has to match
exactly: Got "LongInt" expected "SmallInt"

FPC 2.6.4 and FPC trunk seem to have identical code here.

It is possible I do something stupid. Should I add compiler flags?

Regards,
Juha

Reply by email

Michael Van Canneyt
to Juha Manninen
Juha Manninen wrote 8 lines
On Tue, Apr 1, 2014 at 11:09 AM, Juha Manninen wrote: > Got "LongInt" expected "SmallInt" I opened the example program in Lazarus for debugging it. Lazarus project uses mode objfpc by default. Changing 2 variables from Integer to SmalInt solved the compilation problem. IMO the type should be corrected as debugging with Lazarus is often a good idea.

Or we add a {$mode fpc} to the sources.

Michael.

Reply by email

Marco van de Voort
to Juha Manninen

In our previous episode, Juha Manninen said:

BTW, does anybody know of a Delphi compatible version of this compression lib? The new Unicode Delphis do not need to be supported. What about some other similar Delphi compatible lib?

Newer delphi's come with a zstream iirc, and contrary to D7(*), you don't need to do anything. (unit zlib, tzcompressionstream and -de variant + helper procedures). I use them for the png compression in my ported fcl-image parts.

(*) IIRC, long time ago

Reply by email

Juha Manninen
to Marco van de Voort
Marco van de Voort wrote
Newer delphi's come with a zstream iirc, and contrary to D7(*), you don't need to do anything. (unit zlib, tzcompressionstream and -de variant + helper procedures). I use them for the png compression in my ported fcl-image parts.

Yes but we still have Delphi 2007.
It only has TCompressionStream but no TZCompressionStream. Maybe we could just add our own metadata wrapper instead of gzip or a zlib wrapper.
Well, it does not sound like a clever thing to do.

We have used tpabbrevia but it has a bug with very big files (like 6 GB). Its code is not easy to understand and I would rather not start searching the bug.

Marco, what was the FPC counterpart for TZCompressionStream in your Delphi-compatible code? FPC does not have TZCompressionStream either.

Juha

Reply by email

Marco van de Voort
to Juha Manninen

In our previous episode, Juha Manninen said:

Show quoted text 10 lines
Maybe we could just add our own metadata wrapper instead of gzip or a zlib wrapper. Well, it does not sound like a clever thing to do. We have used tpabbrevia but it has a bug with very big files (like 6 GB). Its code is not easy to understand and I would rather not start searching the bug. Marco, what was the FPC counterpart for TZCompressionStream in your Delphi-compatible code? FPC does not have TZCompressionStream either.

Afaik I use the zstream ones.

I do know from zipfile component that there are two forms of inflate/deflate (which is also zlib), one with a header before, and one with a header appended (the streaming variant)

Reply by email