diff --git a/src/modules/autoseed.c b/src/modules/autoseed.c index 9343ab0d4..cc0d0752c 100644 --- a/src/modules/autoseed.c +++ b/src/modules/autoseed.c @@ -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; diff --git a/src/util/goodies.h b/src/util/goodies.h index 8c4d299ff..39bf6a54c 100644 --- a/src/util/goodies.h +++ b/src/util/goodies.h @@ -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