summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2016-05-14 21:50:34 +0200
committerHaru <haru@dotalux.com>2016-05-14 21:50:34 +0200
commit8f753b8af57ff852ff8dfb210a580ddcf07e17c2 (patch)
tree5d005372528957dd35102ed936b1c7a9cf79f2b9
parent87916f29b5e1a482387b40c16c224fa9a586f747 (diff)
parent525f902e92f2391840816c53a043ffbe2f883a05 (diff)
downloadhercules-8f753b8af57ff852ff8dfb210a580ddcf07e17c2.tar.gz
hercules-8f753b8af57ff852ff8dfb210a580ddcf07e17c2.tar.bz2
hercules-8f753b8af57ff852ff8dfb210a580ddcf07e17c2.tar.xz
hercules-8f753b8af57ff852ff8dfb210a580ddcf07e17c2.zip
Merge pull request #1289 from mkbu95/master
Remove swap testing code (leftover in cbasetypes)
-rw-r--r--src/common/cbasetypes.h18
1 files changed, 0 insertions, 18 deletions
diff --git a/src/common/cbasetypes.h b/src/common/cbasetypes.h
index 78e5512ba..d3db86543 100644
--- a/src/common/cbasetypes.h
+++ b/src/common/cbasetypes.h
@@ -329,24 +329,6 @@ typedef char bool;
//#define swap(a,b) if (a != b) ((a ^= b), (b ^= a), (a ^= b))
// but is vulnerable to 'if (foo) swap(bar, baz); else quux();', causing the else to nest incorrectly.
#define swap(a,b) do { if ((a) != (b)) { (a) ^= (b); (b) ^= (a); (a) ^= (b); } } while(0)
-#if 0 //to be activated soon, more tests needed on how VS works with the macro above
-#ifdef WIN32
-#undef swap
-#define swap(a,b)__asm { \
- __asm mov eax, dword ptr [a] \
- __asm cmp eax, dword ptr [b] \
- __asm je _ret \
- __asm xor eax, dword ptr [b] \
- __asm mov dword ptr [a], eax \
- __asm xor eax, dword ptr [b] \
- __asm mov dword ptr [b], eax \
- __asm xor eax, dword ptr [a] \
- __asm mov dword ptr [a], eax \
- __asm _ret: \
-}
-#endif
-#endif
-
#define swap_ptr(a,b) do { if ((a) != (b)) (a) = (void*)((intptr_t)(a) ^ (intptr_t)(b)); (b) = (void*)((intptr_t)(a) ^ (intptr_t)(b)); (a) = (void*)((intptr_t)(a) ^ (intptr_t)(b)); } while(0)
#ifndef max