forked from github/server
better SWAP() macro
This commit is contained in:
parent
6e3ed568ea
commit
1ec18b8fd9
|
@ -949,8 +949,8 @@ static void smooth_island(region_list * island)
|
|||
r = rlist->data;
|
||||
runhash(r);
|
||||
runhash(rn[n]);
|
||||
SWAP_VARS(int, r->x, rn[n]->x);
|
||||
SWAP_VARS(int, r->y, rn[n]->y);
|
||||
SWAP_INTS(r->x, rn[n]->x);
|
||||
SWAP_INTS(r->y, rn[n]->y);
|
||||
rhash(r);
|
||||
rhash(rn[n]);
|
||||
rlist->data = r;
|
||||
|
|
|
@ -53,7 +53,7 @@ extern "C" {
|
|||
#define HASH1 JENKINS_HASH1
|
||||
#define HASH2 JENKINS_HASH2
|
||||
|
||||
#define SWAP_VARS(T, a, b) { T x = a; a = b; b = x; }
|
||||
#define SWAP_INTS(a, b) { a^=b; b^=a; a^=b; }
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue