[CONSRV]: Use InterlockedExchange16 to exchange Begin and End COORD structure members.

svn path=/trunk/; revision=63573
This commit is contained in:
Hermès Bélusca-Maïto 2014-06-08 23:02:40 +00:00
parent 5ed8d5d62e
commit 55c189531f

View file

@ -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);
}
}