From 16d5aef58f3273081ba77fd2eed33b885a2687dd Mon Sep 17 00:00:00 2001 From: root Date: Wed, 21 Dec 2005 14:19:19 +0000 Subject: [PATCH] *** empty log message *** --- src/rxvtutil.h | 14 ++++++++------ src/screen.C | 11 ++++++----- src/xpm.C | 8 ++++---- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/src/rxvtutil.h b/src/rxvtutil.h index a7361d31..6be9bf6d 100644 --- a/src/rxvtutil.h +++ b/src/rxvtutil.h @@ -14,12 +14,14 @@ public: static bool vax () { return e == 0x44332211; }; } byteorder; -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 T clamp (T v, U a, V b) { return v < (T)a ? a : v >(T)b ? b : v; } +template static inline T min (T a, U b) { return a < (T)b ? a : (T)b; } +template static inline void min_it (T &a, U b) { a = 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 max_it (T &a, U b) { a = a > (T)b ? a : (T)b; } + +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 clamp_it (T &v, U a, V b) { v = 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; } diff --git a/src/screen.C b/src/screen.C index 45b57d1f..11394f66 100644 --- a/src/screen.C +++ b/src/screen.C @@ -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 */ diff --git a/src/xpm.C b/src/xpm.C index f59771d8..b9f88156 100644 --- 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; -- 2.34.1