Forum > General

How to resolve "Conversion between ordinals and pointers"

(1/5) > >>

Zaher:
This lines give me warning

--- Code: ---function RangeToProcessor(Range: Pointer): Byte;
begin
  Result := PtrUInt(Range); <----
end;     

Error:
Hint: Conversion between ordinals and pointers is not portable

--- End code ---

How to make it portable?
I want to take my byte from that pointer, that i save it before in another function.

there is another problem but in linux only, windows works fine


--- Code: ---
  TRangeState = (rsUnknown, rsComment, rsString);

  FRange: TRangeState;

function TSynFirebirdSyn.GetRange: Pointer;
begin
  Result := Pointer(FRange);
end;

Error:
   Illegal type conversion: "TRangeState" to "Pointer"

--- End code ---

Thanks in advance

EDIT:
removed " and $FF"

eny:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---PtrUInt(Range)^ and $FF?

Zaher:
No that not work, i want just type casting.

Zaher:
The second problem i fixed it like this

Result := Pointer(PtrUInt(FRange));

eny:

--- Quote from: Zaher on January 01, 2016, 11:04:06 pm ---No that not work, i want just type casting.
--- End quote ---
Why do you want to 'and'  a pointer with $FF?

Navigation

[0] Message Index

[#] Next page

Go to full version