From 2f60abb38183e1acf9e7e88f73792769b7e3c014 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 21 Dec 2005 10:34:24 +0000 Subject: [PATCH] *** empty log message *** --- src/init.C | 2 +- src/rxvtutil.h | 6 ++++-- src/screen.C | 8 ++++---- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/init.C b/src/init.C index 70fbc72b..e4acca9a 100644 --- a/src/init.C +++ b/src/init.C @@ -460,7 +460,7 @@ rxvt_term::init_resources (int argc, const char *const *argv) #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 */ diff --git a/src/rxvtutil.h b/src/rxvtutil.h index 3e7cf35b..a7361d31 100644 --- a/src/rxvtutil.h +++ b/src/rxvtutil.h @@ -18,8 +18,10 @@ template static inline T min (T a, U b) { return a < (T)b ? a : (T)b; } template static inline T max (T a, U b) { return a > (T)b ? a : (T)b; } -template -static inline void swap (T& a, T& b) { T t=a; a=b; b=t; } +template +static inline T clamp (T v, U a, V b) { return v < (T)a ? a : v >(T)b ? b : v; } +template +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) \ diff --git a/src/screen.C b/src/screen.C index dbc9add8..b1458bcc 100644 --- a/src/screen.C +++ b/src/screen.C @@ -1619,7 +1619,7 @@ rxvt_term::scr_rvideo_mode (int mode) 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 @@ -2132,7 +2132,7 @@ rxvt_term::scr_refresh (unsigned char refresh_type) { /* 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), @@ -2274,7 +2274,7 @@ rxvt_term::scr_refresh (unsigned char refresh_type) if (invert) { - SWAP_IT (fore, back, int); + ::swap (fore, back); #ifndef NO_BOLD_UNDERLINE_REVERSE if (ISSET_PIXCOLOR (Color_RV)) @@ -3366,7 +3366,7 @@ rxvt_term::selection_extend_colrow (int32_t col, int32_t row, int button3, int b #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 } -- 2.34.1