Replace obsolete QMAX() and QMIN() with qMax() and qMin().

svn path=/trunk/KDE/kdebase/konsole/; revision=510739
This commit is contained in:
Allen Winter
2006-02-17 21:54:55 +00:00
parent aeb606473a
commit 5dcffa8adc
3 changed files with 35 additions and 35 deletions

View File

@@ -138,8 +138,8 @@ void TEScreen::cursorUp(int n)
{
if (n == 0) n = 1; // Default
int stop = cuY < tmargin ? 0 : tmargin;
cuX = QMIN(columns-1,cuX); // nowrap!
cuY = QMAX(stop,cuY-n);
cuX = qMin(columns-1,cuX); // nowrap!
cuY = qMax(stop,cuY-n);
}
/*!
@@ -153,8 +153,8 @@ void TEScreen::cursorDown(int n)
{
if (n == 0) n = 1; // Default
int stop = cuY > bmargin ? lines-1 : bmargin;
cuX = QMIN(columns-1,cuX); // nowrap!
cuY = QMIN(stop,cuY+n);
cuX = qMin(columns-1,cuX); // nowrap!
cuY = qMin(stop,cuY+n);
}
/*!
@@ -167,8 +167,8 @@ void TEScreen::cursorLeft(int n)
//=CUB
{
if (n == 0) n = 1; // Default
cuX = QMIN(columns-1,cuX); // nowrap!
cuX = QMAX(0,cuX-n);
cuX = qMin(columns-1,cuX); // nowrap!
cuX = qMax(0,cuX-n);
}
/*!
@@ -181,7 +181,7 @@ void TEScreen::cursorRight(int n)
//=CUF
{
if (n == 0) n = 1; // Default
cuX = QMIN(columns-1,cuX+n);
cuX = qMin(columns-1,cuX+n);
}
/*!
@@ -265,7 +265,7 @@ void TEScreen::NextLine()
void TEScreen::eraseChars(int n)
{
if (n == 0) n = 1; // Default
int p = QMAX(0,QMIN(cuX+n-1,columns-1));
int p = qMax(0,qMin(cuX+n-1,columns-1));
clearImage(loc(cuX,cuY),loc(p,cuY),' ');
}
@@ -277,7 +277,7 @@ void TEScreen::eraseChars(int n)
void TEScreen::deleteChars(int n)
{
if (n == 0) n = 1; // Default
int p = QMAX(0,QMIN(cuX+n,columns-1));
int p = qMax(0,qMin(cuX+n,columns-1));
moveImage(loc(cuX,cuY),loc(p,cuY),loc(columns-1,cuY));
clearImage(loc(columns-n,cuY),loc(columns-1,cuY),' ');
}
@@ -290,8 +290,8 @@ void TEScreen::deleteChars(int n)
void TEScreen::insertChars(int n)
{
if (n == 0) n = 1; // Default
int p = QMAX(0,QMIN(columns-1-n,columns-1));
int q = QMAX(0,QMIN(cuX+n,columns-1));
int p = qMax(0,qMin(columns-1-n,columns-1));
int q = qMax(0,qMin(cuX+n,columns-1));
moveImage(loc(q,cuY),loc(cuX,cuY),loc(p,cuY));
clearImage(loc(cuX,cuY),loc(q-1,cuY),' ');
}
@@ -378,8 +378,8 @@ void TEScreen::saveCursor()
void TEScreen::restoreCursor()
{
cuX = QMIN(sa_cuX,columns-1);
cuY = QMIN(sa_cuY,lines-1);
cuX = qMin(sa_cuX,columns-1);
cuY = qMin(sa_cuY,lines-1);
cu_re = sa_cu_re;
cu_fg = sa_cu_fg;
cu_bg = sa_cu_bg;
@@ -432,8 +432,8 @@ void TEScreen::resizeImage(int new_lines, int new_columns)
}
newwrapped[y]=false;
}
int cpy_lines = QMIN(new_lines, lines);
int cpy_columns = QMIN(new_columns,columns);
int cpy_lines = qMin(new_lines, lines);
int cpy_columns = qMin(new_columns,columns);
// copy to new image
for (int y = 0; y < cpy_lines; y++) {
for (int x = 0; x < cpy_columns; x++)
@@ -450,8 +450,8 @@ void TEScreen::resizeImage(int new_lines, int new_columns)
line_wrapped = newwrapped;
lines = new_lines;
columns = new_columns;
cuX = QMIN(cuX,columns-1);
cuY = QMIN(cuY,lines-1);
cuX = qMin(cuX,columns-1);
cuY = qMin(cuY,lines-1);
// FIXME: try to keep values, evtl.
tmargin=0;
@@ -547,7 +547,7 @@ ca* TEScreen::getCookedImage()
// kDebug(1211) << "InGetCookedImage" << endl;
for (y = 0; (y < lines) && (y < (hist->getLines()-histCursor)); y++)
{
int len = QMIN(columns,hist->getLineLen(y+histCursor));
int len = qMin(columns,hist->getLineLen(y+histCursor));
int yp = y*columns;
// kDebug(1211) << "InGetCookedImage - In first For. Y =" << y << "histCursor = " << histCursor << endl;
@@ -649,7 +649,7 @@ void TEScreen::clear()
void TEScreen::BackSpace()
{
cuX = QMAX(0,cuX-1);
cuX = qMax(0,cuX-1);
if (BS_CLEARS) image[loc(cuX,cuY)].c = ' ';
}
@@ -842,7 +842,7 @@ void TEScreen::setCursorX(int x)
{
if (x == 0) x = 1; // Default
x -= 1; // Adjust
cuX = QMAX(0,QMIN(columns-1, x));
cuX = qMax(0,qMin(columns-1, x));
}
/*! Set the cursor to y-th line. */
@@ -851,7 +851,7 @@ void TEScreen::setCursorY(int y)
{
if (y == 0) y = 1; // Default
y -= 1; // Adjust
cuY = QMAX(0,QMIN(lines -1, y + (getMode(MODE_Origin) ? tmargin : 0) ));
cuY = qMax(0,qMin(lines -1, y + (getMode(MODE_Origin) ? tmargin : 0) ));
}
/*! set cursor to the `left upper' corner of the screen (1,1).

View File

@@ -627,10 +627,10 @@ void TEWidget::drawAttrStr(QPainter &paint, const QRect& rect,
Q_UINT8 dalpha = 255 - salpha;
int a, r, g, b;
a = QMIN( (qAlpha (col) * salpha) / 255 + (qAlpha (blend_color) * dalpha) / 255, 255 );
r = QMIN( (qRed (col) * salpha) / 255 + (qRed (blend_color) * dalpha) / 255, 255 );
g = QMIN( (qGreen (col) * salpha) / 255 + (qGreen (blend_color) * dalpha) / 255, 255 );
b = QMIN( (qBlue (col) * salpha) / 255 + (qBlue (blend_color) * dalpha) / 255, 255 );
a = qMin( (qAlpha (col) * salpha) / 255 + (qAlpha (blend_color) * dalpha) / 255, 255 );
r = qMin( (qRed (col) * salpha) / 255 + (qRed (blend_color) * dalpha) / 255, 255 );
g = qMin( (qGreen (col) * salpha) / 255 + (qGreen (blend_color) * dalpha) / 255, 255 );
b = qMin( (qBlue (col) * salpha) / 255 + (qBlue (blend_color) * dalpha) / 255, 255 );
col = a << 24 | r << 16 | g << 8 | b;
int pixel = a << 24 | (r * a / 255) << 16 | (g * a / 255) << 8 | (b * a / 255);
@@ -814,8 +814,8 @@ void TEWidget::setImage(const ca* const newimg, int lines, int columns)
int cb = -1; // undefined
int cr = -1; // undefined
int lins = QMIN(this->lines, QMAX(0,lines ));
int cols = QMIN(this->columns,QMAX(0,columns));
int lins = qMin(this->lines, qMax(0,lines ));
int cols = qMin(this->columns,qMax(0,columns));
QChar *disstrU = new QChar[cols];
char *dirtyMask = (char *) malloc(cols+2);
QRegion dirtyRegion;
@@ -1045,10 +1045,10 @@ void TEWidget::paintContents(QPainter &paint, const QRect &rect, bool pm)
int tLx = tL.x();
int tLy = tL.y();
int lux = QMIN(columns-1, QMAX(0,(rect.left() - tLx - bX ) / font_w));
int luy = QMIN(lines-1, QMAX(0,(rect.top() - tLy - bY ) / font_h));
int rlx = QMIN(columns-1, QMAX(0,(rect.right() - tLx - bX ) / font_w));
int rly = QMIN(lines-1, QMAX(0,(rect.bottom() - tLy - bY ) / font_h));
int lux = qMin(columns-1, qMax(0,(rect.left() - tLx - bX ) / font_w));
int luy = qMin(lines-1, qMax(0,(rect.top() - tLy - bY ) / font_h));
int rlx = qMin(columns-1, qMax(0,(rect.right() - tLx - bX ) / font_w));
int rly = qMin(lines-1, qMax(0,(rect.bottom() - tLy - bY ) / font_h));
QChar *disstrU = new QChar[columns];
for (int y = luy; y <= rly; y++)
@@ -1150,8 +1150,8 @@ void TEWidget::updateImageSize()
int oldcol = columns;
makeImage();
// we copy the old image to reduce flicker
int lins = QMIN(oldlin,lines);
int cols = QMIN(oldcol,columns);
int lins = qMin(oldlin,lines);
int cols = qMin(oldcol,columns);
if (oldimg)
{
for (int lin = 0; lin < lins; lin++)

View File

@@ -237,14 +237,14 @@ void TEmuVt102::addDigit(int dig)
void TEmuVt102::addArgument()
{
argc = QMIN(argc+1,MAXARGS-1);
argc = qMin(argc+1,MAXARGS-1);
argv[argc] = 0;
}
void TEmuVt102::pushToToken(int cc)
{
pbuf[ppos] = cc;
ppos = QMIN(ppos+1,MAXPBUF-1);
ppos = qMin(ppos+1,MAXPBUF-1);
}
// Character Classes used while decoding