--- rxvt-unicode/src/rxvt.h 2005/12/20 19:30:59 1.163 +++ rxvt-unicode/src/rxvt.h 2005/12/21 14:19:19 1.166 @@ -164,17 +164,7 @@ unsigned int button; /* detail */ }; -#define MAX_IT(current, other) if ((other) > (current)) (current) = (other) -#define MIN_IT(current, other) if ((other) < (current)) (current) = (other) -#define SWAP_IT(one, two, typeof) \ - do { \ - typeof swapittmp; \ - (swapittmp) = (one); (one) = (two); (two) = (swapittmp); \ - } while (/* CONSTCOND */ 0) -#define BOUND_POSITIVE_INT16(val) \ - (int16_t) ((val) <= 0 \ - ? 0 \ - : min ((val), (((uint16_t)-1)>>1))) +#define MAX_POSITIVE_INT16 (((uint16_t)-1)>>1) // TODO: configure/limits #if ENABLE_FRILLS typedef struct _mwmhints { @@ -827,8 +817,11 @@ #define Width2Pixel(n) ((int32_t)(n) * (int32_t)fwidth) #define Height2Pixel(n) ((int32_t)(n) * (int32_t)fheight) -#define TermWin_TotalWidth() ((int32_t)width) -#define TermWin_TotalHeight() ((int32_t)height) +#define TermWin_TotalWidth() ((int32_t)this->width) +#define TermWin_TotalHeight() ((int32_t)this->height) + +#define LINENO(n) (((n) + term_start + total_rows) % total_rows) +#define ROW(n) (save [LINENO (n)]) /* how to build & extract colors and attributes */ #define GET_BASEFG(x) (((x) & RS_fgMask)) @@ -1490,7 +1483,7 @@ l.t = (text_t *)talloc->alloc (l.t, prev_ncol * sizeof (text_t)); l.r = (rend_t *)ralloc->alloc (l.r, prev_ncol * sizeof (rend_t)); - MIN_IT (l.l, (int16_t)ncol); + l.l = min (l.l, ncol); if (ncol > prev_ncol) scr_blank_line (l, prev_ncol, ncol - prev_ncol, DEFAULT_RSTYLE); @@ -1498,7 +1491,7 @@ void scr_blank_line (line_t &l, unsigned int col, unsigned int width, rend_t efs); void scr_blank_screen_mem (line_t &l, rend_t efs); - int scr_scroll_text (int row1, int row2, int count, int spec); + int scr_scroll_text (int row1, int row2, int count); void scr_reset (); void scr_reset_realloc (); void scr_release ();