mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 01:15:09 +00:00
[CONSRV]: Use InterlockedExchange16 to exchange Begin and End COORD structure members.
svn path=/trunk/; revision=63573
This commit is contained in:
parent
5ed8d5d62e
commit
55c189531f
1 changed files with 3 additions and 12 deletions
|
@ -12,7 +12,7 @@
|
|||
/* INCLUDES *******************************************************************/
|
||||
|
||||
#include <consrv.h>
|
||||
|
||||
#include <intrin.h>
|
||||
#include <windowsx.h>
|
||||
|
||||
#define NDEBUG
|
||||
|
@ -694,17 +694,8 @@ GetSelectionBeginEnd(PCOORD Begin, PCOORD End,
|
|||
/* Exchange Begin / End if Begin > End lexicographically */
|
||||
if (Begin->Y > End->Y || (Begin->Y == End->Y && Begin->X > End->X))
|
||||
{
|
||||
SHORT tmp;
|
||||
|
||||
// End->X = InterlockedExchange16(&Begin->X, End->X);
|
||||
tmp = Begin->X;
|
||||
Begin->X = End->X;
|
||||
End->X = tmp;
|
||||
|
||||
// End->Y = InterlockedExchange16(&Begin->Y, End->Y);
|
||||
tmp = Begin->Y;
|
||||
Begin->Y = End->Y;
|
||||
End->Y = tmp;
|
||||
End->X = _InterlockedExchange16(&Begin->X, End->X);
|
||||
End->Y = _InterlockedExchange16(&Begin->Y, End->Y);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue