summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/common/cbasetypes.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/common/cbasetypes.h b/src/common/cbasetypes.h
index eca0d056c..1a1cd22a9 100644
--- a/src/common/cbasetypes.h
+++ b/src/common/cbasetypes.h
@@ -230,7 +230,9 @@ typedef char bool;
// hmm only ints?
//#define swap(a,b) { int temp=a; a=b; b=temp;}
// if using macros then something that is type independent
-#define swap(a,b) ((a == b) || ((a ^= b), (b ^= a), (a ^= b)))
+//#define swap(a,b) ((a == b) || ((a ^= b), (b ^= a), (a ^= b)))
+// Avoid "value computed is not used" warning and generates the same assembly code
+#define swap(a,b) if (a != b) ((a ^= b), (b ^= a), (a ^= b))
#ifndef max
#define max(a,b) (((a) > (b)) ? (a) : (b))