*** empty log message ***
authorroot <root>
Wed, 21 Dec 2005 14:19:19 +0000 (14:19 +0000)
committerroot <root>
Wed, 21 Dec 2005 14:19:19 +0000 (14:19 +0000)
src/rxvtutil.h
src/screen.C
src/xpm.C

index a7361d316f18d8d4c0e332f8eda4443c77b5c763..6be9bf6dd38bfa12798b6b06b2ef7caef6791d45 100644 (file)
@@ -14,12 +14,14 @@ public:
   static bool vax           () { return e == 0x44332211; };
 } byteorder;
 
-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, 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 T    min    (T  a, U b) { return a < (T)b ? a : (T)b; }
+template<typename T, typename U> static inline void min_it (T &a, U b) {    a = 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, typename U> static inline void max_it (T &a, U b) {    a = a > (T)b ? a : (T)b; }
+
+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, typename V> static inline void clamp_it (T &v, U a, V b) {    v = 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; }
 
index 45b57d1f97f34bc0eb1ddf0853d3c2d596986e85..11394f666450241aa3b76b7463ee5caf9b2dc361 100644 (file)
@@ -1480,7 +1480,7 @@ rxvt_term::scr_insdel_chars (int count, int insdel)
         if (line->is_longer ()) /* break line continuation */
           line->l = ncol;
         
-        line->l = max (line->l - count, 0);
+        max_it (line->l - count, 0);
 
         if (selection.op && current_screen == selection.screen
             && ROWCOL_IN_ROW_AT_OR_AFTER (selection.beg, screen.cur))
@@ -1765,10 +1765,11 @@ rxvt_term::scr_expose (int x, int y, int ewidth, int eheight, bool refresh)
 #endif
 
 #ifdef DEBUG_STRICT
-  x = max (x, 0);
-  x = min (x, (int)width);
-  y = max (y, 0);
-  y = min (y, (int)height);
+#if 0
+  // that's not debugging //TODO //FIXME
+  clamp_it (x, 0, width);
+  clamp_it (y, 0, height);
+#endif
 #endif
 
   /* round down */
index f59771d8140ddf6a29582ff095de4d2d8d026228..b9f881569818444efd527cad32fbe433dafdc2c3 100644 (file)
--- a/src/xpm.C
+++ b/src/xpm.C
@@ -138,10 +138,10 @@ rxvt_term::scale_pixmap (const char *geom)
           if (flags & YNegative)
             y += 100;
         }
-      MIN_IT (x, 100);
-      MIN_IT (y, 100);
-      MAX_IT (x, 0);
-      MAX_IT (y, 0);
+      min_it (x, 100);
+      min_it (y, 100);
+      max_it (x, 0);
+      max_it (y, 0);
       if (bgpixmap->x != x)
         {
           bgpixmap->x = x;