How would this be correct when on 64bit platform in XE2?
type
PRGB24 = ^TRGB24;
TRGB24 = packed record
B: Byte;
G: Byte;
R: Byte;
end;
var
s1: pRGB24;
ptrD: integer;
....
inc(Integer(s1), PtrD); <- gives error here "Left side cannot be assigned to"
Integer type is 32-bit long, pointer type is 64-bit long on 64-bit platform, hence the error. I can’t test it now, but
should fix the problem.
BTW:
Incprocedure can accept pointers, so normally there is no need to cast pointer to integer here. The same result can be obtained byTo avoid
s1casting at all is even betterbut it changes the meaning of the code – its equivalent is