From b8c3fc07717347da61cc8d7ed669cb370cf16d33 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Mon, 14 Jul 2014 15:42:34 +0000 Subject: [PATCH] adding in place replacements avoiding self assignment git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76918 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/defs.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/wx/defs.h b/include/wx/defs.h index 1f5b091184..f89e132165 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -1527,6 +1527,11 @@ typedef double wxDouble; #define wxINT64_SWAP_ON_BE(val) wxINT64_SWAP_ALWAYS(val) #define wxINT64_SWAP_ON_LE(val) (val) #endif + + wxUINT16_SWAP_ON_BE_IN_PLACE(val) val = wxUINT16_SWAP_ALWAYS(val) + wxUINT16_SWAP_ON_LE_IN_PLACE(val) + wxUINT32_SWAP_ON_BE_IN_PLACE(val) val = wxUINT32_SWAP_ALWAYS(val) + wxUINT32_SWAP_ON_LE_IN_PLACE(val) #else #define wxUINT16_SWAP_ON_LE(val) wxUINT16_SWAP_ALWAYS(val) #define wxINT16_SWAP_ON_LE(val) wxINT16_SWAP_ALWAYS(val) @@ -1542,6 +1547,11 @@ typedef double wxDouble; #define wxINT64_SWAP_ON_LE(val) wxINT64_SWAP_ALWAYS(val) #define wxINT64_SWAP_ON_BE(val) (val) #endif + + wxUINT16_SWAP_ON_BE_IN_PLACE(val) + wxUINT16_SWAP_ON_LE_IN_PLACE(val) val = wxUINT16_SWAP_ALWAYS(val) + wxUINT32_SWAP_ON_BE_IN_PLACE(val) + wxUINT32_SWAP_ON_LE_IN_PLACE(val) val = wxUINT32_SWAP_ALWAYS(val) #endif /* ---------------------------------------------------------------------------- */