#ifndef XTERM_REVERSE_VIDEO
/* this is how we implement reverseVideo */
if (options & Opt_reverseVideo)
- SWAP_IT (rs[Rs_color + Color_fg], rs[Rs_color + Color_bg], const char *);
+ ::swap (rs[Rs_color + Color_fg], rs[Rs_color + Color_bg]);
#endif
/* convenient aliases for setting fg/bg to colors */
static inline T min (T a, U b) { return a < (T)b ? a : (T)b; }
template<typename T, typename U>
static inline T max (T a, U b) { return a > (T)b ? a : (T)b; }
-template<typename T>
-static inline void swap (T& a, T& b) { T t=a; a=b; b=t; }
+template<typename T, typename U, typename V>
+static inline T clamp (T v, U a, V b) { return v < (T)a ? a : v >(T)b ? b : v; }
+template<typename T, typename U>
+static inline void swap (T& a, U& b) { T t=a; a=(T)b; b=(U)t; }
// in range including end
#define IN_RANGE_INC(val,beg,end) \
if (rvideo != mode)
{
rvideo = mode;
- SWAP_IT (pix_colors[Color_fg], pix_colors[Color_bg], rxvt_color);
+ ::swap (pix_colors[Color_fg], pix_colors[Color_bg]);
#if XPM_BACKGROUND
if (bgPixmap.pixmap == None)
#endif
{
/* also comes here at end if needed because of >= above */
if (wlen < len)
- SWAP_IT (wlen, len, int);
+ ::swap (wlen, len);
XCopyArea (display->display, vt, vt,
gc, 0, Row2Pixel (len + i),
if (invert)
{
- SWAP_IT (fore, back, int);
+ ::swap (fore, back);
#ifndef NO_BOLD_UNDERLINE_REVERSE
if (ISSET_PIXCOLOR (Color_RV))
#if ENABLE_FRILLS
if (selection.rect && selection.beg.col > selection.end.col)
- SWAP_IT (selection.beg.col, selection.end.col, int);
+ ::swap (selection.beg.col, selection.end.col);
#endif
}