w2m
New Member
Posts: 27
|
Post by w2m on Sept 16, 2009 19:44:50 GMT -5
I did a build of a VCL Zip demo and the compiler returned a warning: [DCC Warning] VCLZip.pas(788): W1035 Return value of function 'TVCLZip.ZipFromBuffer' might be undefined. function TVCLZip.ZipFromBuffer(Buffer: PAnsiChar; Amount: LongInt; FName: kpWString; DateTime: TDateTime): Integer; begin FStreamTime := DateTime; try ZipFromBuffer(Buffer, Amount, FName); finally FStreamTime := 0; end; end;
function TVCLZip.ZipFromBuffer(Buffer: PAnsiChar; Amount: LongInt; FName: kpWString): Integer; begin Result := 0; if (Trim(FName) = '') or (Amount = 0) then exit; MemBuffer := Buffer; CurrMem := Buffer; MemLen := Amount; MemLeft := Amount; MemZipping := True; FilesList.Clear; FilesList.Add(Fname); try Result := Zip; finally MemZipping := False; CloseZip; end; end; Shouldn't the first of this overload be something like? : function TVCLZip.ZipFromBuffer(Buffer: PAnsiChar; Amount: LongInt; FName: kpWString; DateTime: TDateTime): Integer; begin FStreamTime := DateTime; try Result := ZipFromBuffer(Buffer, Amount, FName); finally FStreamTime := 0; end; end; ...this eliminates the warning here. Bill
|
|
w2m
New Member
Posts: 27
|
Post by w2m on Sept 16, 2009 19:47:28 GMT -5
I can not seem to be able to edit my own posts so... the Message title should have been TVCLZip.ZipFromBuffer...
|
|
|
Post by Kevin on Sept 17, 2009 7:19:53 GMT -5
Yes, that does make sense. Thanks.
|
|