Code: Alles auswählen
Hallo,
ich versuche gerade ein Projekt von Delphi 6 auf Free Pascal (Version hier 2.4.4) zu migrieren.
Dazu verwende ich die FreePascal Version von Direct Mysql
https://sourceforge.net/projects/directsql/files/Direct%20Mysql%20Objects/
erhalte dabei den Fehler Incompatible type for arg no. 3: Got "Pbyte" expected "open array of byte" in mysqlnet.pas Line:152
[code=text]
function my_compress_alloc(const packet:PByte;_len:PLongint; complen:PLongint):PByte;
var compbuf:PByte;
tmp:Longint;
begin
//how much we need
complen^ := trunc(_len^ * 120 / 100 + 12); // should be integer
getmem(compbuf,complen^);
if (compbuf=nil)then //out of memory?
begin
result:=nil;
exit;
end;
"Fehlerhafte Zeile ->" if (compress(compbuf,complen^, packet, _len^ ) <> 0) then //compress it
begin
freemem(compbuf); //we got an error
result:=nil;
exit;
end;
if (complen^ >= _len^) then //compressed packet is bigger than the uncompressed one ?
begin
complen^:=0;
freemem(compbuf);
result:=nil;
exit;
end;
tmp:=_len^; //return the compressed packet
_len^:=complen^;
complen^:=tmp;
result:=compbuf;
end;
PS.: Ja ich weiß, alles alt und lange nicht mehr gepflegt.
Trotzdem bitte keinen Hinweis auf neuere Komponenten oder sonstiges.
[Problem vorerst gelöst bzw. muss noch geprüft werden!]