# HG changeset patch # User Matti Hamalainen # Date 1588074344 -10800 # Node ID 6d12670e0248d7b989fd7f04d563279f1da6b875 # Parent fce2ed3f681ff66c695fafba95e96316e598218f Rename DM_SWAP() macro to DM_SWAP_IF(). diff -r fce2ed3f681f -r 6d12670e0248 src/dmlib.h --- a/src/dmlib.h Tue Apr 28 14:16:50 2020 +0300 +++ b/src/dmlib.h Tue Apr 28 14:45:44 2020 +0300 @@ -273,7 +273,8 @@ // Macro for swapping two lvalues of same type -#define DM_SWAP(T, A, B) { if ((B) < (A)) { T swtmp = (B); B = (A); A = swtmp; } } +#define DM_SWAP(T, A, B) { T swtmp = (B); B = (A); A = swtmp; } +#define DM_SWAP_IF(T, A, B) { if ((B) < (A)) { T swtmp = (B); B = (A); A = swtmp; } } /* Drawing modes used by blitting and some other functions. diff -r fce2ed3f681f -r 6d12670e0248 tools/libgutil.c --- a/tools/libgutil.c Tue Apr 28 14:16:50 2020 +0300 +++ b/tools/libgutil.c Tue Apr 28 14:45:44 2020 +0300 @@ -26,7 +26,7 @@ cx1 = screen->clip_rect.x + screen->clip_rect.w - 1, cy1 = screen->clip_rect.y + screen->clip_rect.h - 1; - DM_SWAP(int, x0, x1); + DM_SWAP_IF(int, x0, x1); if (yc < cy0|| yc > cy1 || x1 < cx0 || x0 > cx1) return; if (x0 < cx0) x0 = cx0; if (x1 > cx1) x1 = cx1; @@ -59,7 +59,7 @@ cx1 = screen->clip_rect.x + screen->clip_rect.w - 1, cy1 = screen->clip_rect.y + screen->clip_rect.h - 1; - DM_SWAP(int, y0, y1); + DM_SWAP_IF(int, y0, y1); if (xc < cx0 || xc > cx1 || y1 < cy0 || y0 > cy1) return; if (y0 < cy0) y0 = cy0; if (y1 > cy1) y1 = cy1;