*** empty log message ***
authorroot <root>
Wed, 21 Dec 2005 10:34:24 +0000 (10:34 +0000)
committerroot <root>
Wed, 21 Dec 2005 10:34:24 +0000 (10:34 +0000)
src/init.C
src/rxvtutil.h
src/screen.C

index 70fbc72b6841ca585fdbd04a6c9c531d1ba84aff..e4acca9a4597b441bbb7b1167be868f5059db1f8 100644 (file)
@@ -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 */
index 3e7cf35b8df4fa0708cc7285d5b5d716f3d0c157..a7361d316f18d8d4c0e332f8eda4443c77b5c763 100644 (file)
@@ -18,8 +18,10 @@ template<typename T, typename U>
 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) \
index dbc9add89c4676b5c21ecdcfe2d40b15a3e03acc..b1458bcca73fd5436f4ee6b0f526ece5615ef875 100644 (file)
@@ -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
 }