}
/* we have fewer rows so fix up cursor position */
- MIN_IT (screen.cur.row, (int32_t)nrow - 1);
+ min_it (screen.cur.row, (int32_t)nrow - 1);
scr_reset_realloc (); /* realloc _last_ */
}
#ifdef DEBUG_STRICT
assert (screen.cur.row < nrow);
#else /* drive with your eyes closed */
- MIN_IT (screen.cur.row, nrow - 1);
+ min_it (screen.cur.row, nrow - 1);
#endif
ncol = ocol; // save b/c scr_blank_screen_mem uses this
}
lresize (swap_save[p]);
}
- MIN_IT (screen.cur.col, (int16_t)ncol - 1);
+ min_it (screen.cur.col, (int16_t)ncol - 1);
delete old_ta;
delete old_ra;
}
/* boundary check in case screen size changed between SAVE and RESTORE */
- MIN_IT (s->cur.row, nrow - 1);
- MIN_IT (s->cur.col, ncol - 1);
+ min_it (s->cur.row, nrow - 1);
+ min_it (s->cur.col, ncol - 1);
#ifdef DEBUG_STRICT
assert (s->cur.row >= 0);
assert (s->cur.col >= 0);
#else /* drive with your eyes closed */
- MAX_IT (s->cur.row, 0);
- MAX_IT (s->cur.col, 0);
+ max_it (s->cur.row, 0);
+ max_it (s->cur.col, 0);
#endif
}
assert ((screen.cur.row < nrow)
&& (screen.cur.row >= - (int32_t)nsaved));
#else /* drive with your eyes closed */
- MIN_IT (screen.cur.col, last_col - 1);
- MIN_IT (screen.cur.row, (int32_t)nrow - 1);
- MAX_IT (screen.cur.row, - (int32_t)nsaved);
+ min_it (screen.cur.col, last_col - 1);
+ min_it (screen.cur.row, (int32_t)nrow - 1);
+ max_it (screen.cur.row, - (int32_t)nsaved);
#endif
row = screen.cur.row;
if (c == C0_LF)
{
if (!line->is_longer ()) /* XXX: think about this */
- MAX_IT (line->l, screen.cur.col);
+ max_it (line->l, screen.cur.col);
screen.flags &= ~Screen_WrapNext;
else if (c == C0_CR)
{
if (!line->is_longer ()) /* XXX: think about this */
- MAX_IT (line->l, screen.cur.col);
+ max_it (line->l, screen.cur.col);
screen.flags &= ~Screen_WrapNext;
screen.cur.col = 0;
}
if (!line->is_longer ()) /* XXX: think about this */
- MAX_IT (line->l, screen.cur.col);
+ max_it (line->l, screen.cur.col);
#ifdef DEBUG_STRICT
assert (screen.cur.row >= 0);
#else /* drive with your eyes closed */
- MAX_IT (screen.cur.row, 0);
+ max_it (screen.cur.row, 0);
#endif
}
base_rend = SET_FONT (base_rend, 0);
if (!l.is_longer ()) /* XXX: think about this */
- MAX_IT (l.l, x);
+ max_it (l.l, x);
i = screen.cur.col;
ZERO_SCROLLBACK ();
screen.cur.col = relative & C_RELATIVE ? screen.cur.col + col : col;
- MAX_IT (screen.cur.col, 0);
- MIN_IT (screen.cur.col, (int32_t)ncol - 1);
+ max_it (screen.cur.col, 0);
+ min_it (screen.cur.col, (int32_t)ncol - 1);
screen.flags &= ~Screen_WrapNext;
if (screen.flags & Screen_Relative)
{ /* relative origin mode */
screen.cur.row = row + screen.tscroll;
- MIN_IT (screen.cur.row, screen.bscroll);
+ min_it (screen.cur.row, screen.bscroll);
}
else
screen.cur.row = row;
}
- MAX_IT (screen.cur.row, 0);
- MIN_IT (screen.cur.row, (int32_t)nrow - 1);
+ max_it (screen.cur.row, 0);
+ min_it (screen.cur.row, (int32_t)nrow - 1);
}
/* ------------------------------------------------------------------------- */
else
screen.cur.row += dirn;
- MAX_IT (screen.cur.row, 0);
- MIN_IT (screen.cur.row, (int32_t)nrow - 1);
+ max_it (screen.cur.row, 0);
+ min_it (screen.cur.row, (int32_t)nrow - 1);
selection_check (0);
}
case 0: /* erase to end of line */
col = screen.cur.col;
num = ncol - col;
- MIN_IT (ROW(row).l, (int16_t)col);
+ min_it (ROW(row).l, (int16_t)col);
if (ROWCOL_IN_ROW_AT_OR_AFTER (selection.beg, screen.cur)
|| ROWCOL_IN_ROW_AT_OR_AFTER (selection.end, screen.cur))
CLEAR_SELECTION ();
if (row >= nrow) /* Out Of Bounds */
return;
- MIN_IT (num, (nrow - row));
+ min_it (num, (nrow - row));
if (rstyle & (RS_RVid | RS_Uline))
ren = (rend_t) ~RS_None;
scr_do_wrap ();
selection_check (1);
- MIN_IT (count, (ncol - screen.cur.col));
+ min_it (count, (ncol - screen.cur.col));
row = screen.cur.row;
if (!line->is_longer ())
{
line->l += count;
- MIN_IT (line->l, ncol);
+ min_it (line->l, ncol);
}
if (selection.op && current_screen == selection.screen
void
rxvt_term::scr_scroll_region (int top, int bot)
{
- MAX_IT (top, 0);
- MIN_IT (bot, (int)nrow - 1);
+ max_it (top, 0);
+ min_it (bot, (int)nrow - 1);
if (top > bot)
return;
/* sanity checks */
for (i = PART_BEG; i < RC_COUNT; i++)
{
- MIN_IT (rc[i].col, ncol - 1);
- MIN_IT (rc[i].row, nrow - 1);
+ min_it (rc[i].col, ncol - 1);
+ min_it (rc[i].row, nrow - 1);
}
for (i = rc[PART_BEG].row; i <= rc[PART_END].row; i++)
{
/* 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),
if (invert)
{
- SWAP_IT (fore, back, int);
+ ::swap (fore, back);
#ifndef NO_BOLD_UNDERLINE_REVERSE
if (ISSET_PIXCOLOR (Color_RV))
#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
}
rxvt_term::pixel_position (int *x, int *y)
{
*x = Pixel2Col (*x);
- /* MAX_IT (*x, 0); MIN_IT (*x, (int)ncol - 1); */
+ /* max_it (*x, 0); min_it (*x, (int)ncol - 1); */
*y = Pixel2Row (*y);
- /* MAX_IT (*y, 0); MIN_IT (*y, (int)nrow - 1); */
+ /* max_it (*y, 0); min_it (*y, (int)nrow - 1); */
}
/* ------------------------------------------------------------------------- */
if (y < 0) y = nrow - h;
// make space for border
- w += 2; MIN_IT (w, ncol);
- h += 2; MIN_IT (h, nrow);
+ w += 2; min_it (w, ncol);
+ h += 2; min_it (h, nrow);
- x -= 1; MAX_IT (x, 0);
- y -= 1; MAX_IT (y, 0);
+ x -= 1; max_it (x, 0);
+ y -= 1; max_it (y, 0);
- MIN_IT (x, ncol - w);
- MIN_IT (y, nrow - h);
+ min_it (x, ncol - w);
+ min_it (y, nrow - h);
ov_x = x; ov_y = y;
ov_w = w; ov_h = h;