* Convert to code that also works correct in $T+ case.

* Remove typecasts to longint.

git-svn-id: trunk@7940 -
This commit is contained in:
daniel 2007-07-03 21:40:54 +00:00
parent d9b1dbbec9
commit 6d059a0640
2 changed files with 8 additions and 8 deletions

View File

@ -763,8 +763,8 @@ begin
end; end;
MouseEvent:=PendingMouseHead^; MouseEvent:=PendingMouseHead^;
inc(PendingMouseHead); inc(PendingMouseHead);
if ptruint(PendingMouseHead)=ptruint(@PendingMouseEvent)+sizeof(PendingMouseEvent) then if PendingMouseHead=@PendingMouseEvent[0]+MouseEventBufsize then
PendingMouseHead:=PMouseEvent(@PendingMouseEvent); PendingMouseHead:=@PendingMouseEvent[0];
dec(PendingMouseEvents); dec(PendingMouseEvents);
if (LastMouseEvent.x<>MouseEvent.x) or (LastMouseEvent.y<>MouseEvent.y) then if (LastMouseEvent.x<>MouseEvent.x) or (LastMouseEvent.y<>MouseEvent.y) then
MouseEvent.Action:=MouseActionMove; MouseEvent.Action:=MouseActionMove;

View File

@ -275,7 +275,7 @@ begin
WF := Mou_NoWait; WF := Mou_NoWait;
if (MouReadEventQue (SysEvent, WF, Handle) = 0) then if (MouReadEventQue (SysEvent, WF, Handle) = 0) then
begin begin
if PendingMouseHead = @PendingMouseEvent then if PendingMouseHead = @PendingMouseEvent[0] then
P := @PendingMouseEvent [MouseEventBufSize - 1] else P := @PendingMouseEvent [MouseEventBufSize - 1] else
begin begin
P := PendingMouseHead; P := PendingMouseHead;
@ -297,7 +297,7 @@ begin
TranslateEvents (SysEvent, Event); TranslateEvents (SysEvent, Event);
if Event.Action <> MouseActionMove then if Event.Action <> MouseActionMove then
begin begin
if Q = @PendingMouseEvent then if Q = @PendingMouseEvent[0] then
Q := @PendingMouseEvent [MouseEventBufSize - 1] else Dec (Q); Q := @PendingMouseEvent [MouseEventBufSize - 1] else Dec (Q);
if MouseEventOrderHead = 0 then if MouseEventOrderHead = 0 then
MouseEventOrderHead := MouseEventBufSize - 1 else MouseEventOrderHead := MouseEventBufSize - 1 else
@ -359,8 +359,8 @@ begin
LastMouseEvent := MouseEvent; LastMouseEvent := MouseEvent;
end; end;
Inc (PendingMouseHead); Inc (PendingMouseHead);
if longint (PendingMouseHead) = longint (@PendingMouseEvent) if PendingMouseHead = @PendingMouseEvent[0]+MouseEventBufsize then
+ SizeOf (PendingMouseEvent) then PendingMouseHead := @PendingMouseEvent; PendingMouseHead := @PendingMouseEvent[0];
Inc (MouseEventOrderHead); Inc (MouseEventOrderHead);
if MouseEventOrderHead = MouseEventBufSize then MouseEventOrderHead := 0; if MouseEventOrderHead = MouseEventBufSize then MouseEventOrderHead := 0;
Dec (PendingMouseEvents); Dec (PendingMouseEvents);
@ -374,8 +374,8 @@ begin
begin begin
PendingMouseTail^ := MouseEvent; PendingMouseTail^ := MouseEvent;
Inc (PendingMouseTail); Inc (PendingMouseTail);
if longint (PendingMouseTail) = longint (@PendingMouseEvent) + if PendingMouseTail=@PendingMouseEvent[0]+MouseEventBufSize then
SizeOf (PendingMouseEvent) then PendingMouseTail := @PendingMouseEvent; PendingMouseTail := @PendingMouseEvent[0];
MouGetNumQueEl (QI, Handle); MouGetNumQueEl (QI, Handle);
PendingMouseEventOrder [MouseEventOrderTail] := QI.cEvents; PendingMouseEventOrder [MouseEventOrderTail] := QI.cEvents;
Inc (MouseEventOrderTail); Inc (MouseEventOrderTail);