Joy
Joy

Reputation: 1

Operation with Psingle type in Delphi Xe works fine, but not in Delphi Rio

I'm compiling a function that worked correctly in delphi XE, but now compiling it in delphi Rio gives me the following error: [dcc32 Error] sBuffer.pas (330): E2015 Operator not applicable to this operand type

//type of variables used:

Buffer: Psingle;
bufferPos: Cardinal;
fchannels: Cardinal;


function sbuffer.Ptrbegin: Psingle;
begin
     Result := (buffer + bufferPos * fchannels); //---> Error
end;

[dcc32 Error] sBuffer.pas (330): E2015 Operator not applicable to this operand type

Upvotes: 0

Views: 179

Answers (1)

David Heffernan
David Heffernan

Reputation: 613311

You need to enable the pointer math option:

{$POINTERMATH ON} 

Upvotes: 2

Related Questions