# HG changeset patch # User alfadur # Date 1566583976 -10800 # Node ID 410a83aa9d9a2d110b304c541c1a1d8c42c9285e # Parent 3907c95227b858061e38515d3acbd13e1df50f2e reduce casting diff -r 3907c95227b8 -r 410a83aa9d9a hedgewars/uLandObjects.pas --- a/hedgewars/uLandObjects.pas Fri Aug 23 21:04:40 2019 +0300 +++ b/hedgewars/uLandObjects.pas Fri Aug 23 21:12:56 2019 +0300 @@ -348,7 +348,7 @@ procedure ChecksumLandObjectImage(Image: PSDL_Surface; alphaOnly: boolean); var y, x: LongInt; -var rowData: PByte; +var rowData: PByteArray; begin if Image = nil then exit; @@ -369,7 +369,7 @@ if alphaOnly then begin for x := 0 to Image^.w - 1 do - PByteArray(rowData)^[x] := PByteArray(Image^.pixels)^[y * Image^.pitch + x * 4 + AByteIndex]; + rowData^[x] := PByteArray(Image^.pixels)^[y * Image^.pitch + x * 4 + AByteIndex]; syncedPixelDigest:= Adler32Update(syncedPixelDigest, rowData, Image^.w); end else diff -r 3907c95227b8 -r 410a83aa9d9a hedgewars/uStore.pas --- a/hedgewars/uStore.pas Fri Aug 23 21:04:40 2019 +0300 +++ b/hedgewars/uStore.pas Fri Aug 23 21:12:56 2019 +0300 @@ -386,7 +386,7 @@ ai: TAmmoType; tmpsurf, tmpoverlay: PSDL_Surface; i, y, x, imflags: LongInt; - rowData: PByte; + rowData: PByteArray; keyConfirm, keyQuit: shortstring; begin AddFileLog('StoreLoad()'); @@ -438,7 +438,7 @@ for y := 0 to tmpsurf^.h-1 do begin for x := 0 to tmpsurf^.w - 1 do - PByteArray(rowData)^[x] := PByteArray(tmpsurf^.pixels)^[y * tmpsurf^.pitch + x * 4 + AByteIndex]; + rowData^[x] := PByteArray(tmpsurf^.pixels)^[y * tmpsurf^.pitch + x * 4 + AByteIndex]; syncedPixelDigest:= Adler32Update(syncedPixelDigest, rowData, tmpsurf^.w); end; FreeMem(rowData, tmpsurf^.w);