fpspreadsheet: Fix type conversion issues in FPC 3.3.1

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9346 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz 2024-05-09 12:52:07 +00:00
parent 344d9b00e1
commit 8fdb399acd
2 changed files with 7 additions and 7 deletions

View File

@ -647,7 +647,7 @@ begin
OpenedStreams[0].Handle:=0;
OpenedStreams[0].Context:=FFATIndirect.DirectoryContext;
while true do begin
EffectiveRead:=FFATIndirect.ReadData(FFATIndirect.DirectoryContext,@Dir,Sizeof(Dir));
EffectiveRead:=FFATIndirect.ReadData(FFATIndirect.DirectoryContext,PByte(@Dir),Sizeof(Dir));
SwapEndian_Record(Dir);
if EffectiveRead=Sizeof(Dir) Then begin
if Dir._cb>0 then begin
@ -679,11 +679,11 @@ begin
FDirectory[0]._ulSize:=FFATIndirect.MiniFATDataContext.Size;
FFATIndirect.StreamSeekPosition(FFATIndirect.DirectoryContext,0,soBeginning);
for j := 0 to High(FDirectory) do begin
FFATIndirect.WriteData(FFATIndirect.DirectoryContext,@FDirectory[j],sizeof(FDirectory[j]));
FFATIndirect.WriteData(FFATIndirect.DirectoryContext,PByte(@FDirectory[j]),sizeof(FDirectory[j]));
end;
EmptyDir._sidRightSib:=0; //Avoid uninitialize hint.
FillByte(EmptyDir,sizeof(EmptyDir),0);
FFATIndirect.WriteData(FFATIndirect.DirectoryContext,@EmptyDir,sizeof(EmptyDir));
FFATIndirect.WriteData(FFATIndirect.DirectoryContext,PByte(@EmptyDir),sizeof(EmptyDir));
end;
FreeAndNIL(FFATIndirect);
inherited Destroy();

View File

@ -134,7 +134,7 @@ begin
RootDir._cb:=0;
FillByte(RootDir,sizeof(RootDir),0);
StreamSeekPosition(DirectoryContext,0,soBeginning);
ReadData(DirectoryContext,@RootDir,SizeOf(RootDir));
ReadData(DirectoryContext,PByte(@RootDir),SizeOf(RootDir));
StreamSeekPosition(DirectoryContext,0,soBeginning);
MiniFATDataContext.FATFirstIndex:=RootDir._sectStart;
MiniFATDataContext.FATIndex:=RootDir._sectStart;
@ -397,7 +397,7 @@ begin
EffectiveRead:=ReadData(MiniFATDataContext,FMiscSectorBuffer,ThisRead);
AStream.Write(FMiscSectorBuffer^,EffectiveRead);
StreamSeekPosition(MiniFATContext,int64(NextSector)*BYTES_PER_FAT_ENTRY,soBeginning);
ReadData(MiniFATContext,@NextSector,BYTES_PER_FAT_ENTRY);
ReadData(MiniFATContext,PByte(@NextSector),BYTES_PER_FAT_ENTRY);
Dec(ReadBytes,EffectiveRead);
if ThisRead<>EffectiveRead then exit;
end;
@ -1063,9 +1063,9 @@ begin
DirectoryContext.MiniStream:=nil;
DirectoryContext.AccessMode:=fmOpenReadWrite;
WriteData(DirectoryContext,@RootEntry,SizeOf(RootEntry));
WriteData(DirectoryContext,PByte(@RootEntry),SizeOf(RootEntry));
FillByte(RootEntry,sizeof(RootEntry),0);
WriteData(DirectoryContext,@RootEntry,SizeOf(RootEntry));
WriteData(DirectoryContext,PByte(@RootEntry),SizeOf(RootEntry));
FHeader._sectDirStart:=DirectoryContext.FATFirstIndex;