Commit 140c26c1 authored by Kurt Hindenburg's avatar Kurt Hindenburg

old style cast -> reinterpret_cast/static_cast

parent f667db3e
......@@ -270,7 +270,7 @@ bool HistoryScrollFile::isWrappedLine(int lineno)
{
if (lineno >= 0 && lineno <= getLines()) {
unsigned char flag = 0;
_lineflags.get((char *)&flag, sizeof(unsigned char),
_lineflags.get(reinterpret_cast<char *>(&flag), sizeof(unsigned char),
(lineno)*sizeof(unsigned char));
return flag != 0u;
}
......@@ -284,7 +284,7 @@ qint64 HistoryScrollFile::startOfLine(int lineno)
}
if (lineno <= getLines()) {
qint64 res;
_index.get((char*)&res, sizeof(qint64), (lineno - 1)*sizeof(qint64));
_index.get(reinterpret_cast<char*>(&res), sizeof(qint64), (lineno - 1)*sizeof(qint64));
return res;
}
return _cells.len();
......@@ -292,20 +292,20 @@ qint64 HistoryScrollFile::startOfLine(int lineno)
void HistoryScrollFile::getCells(int lineno, int colno, int count, Character res[])
{
_cells.get((char*)res, count * sizeof(Character), startOfLine(lineno) + colno * sizeof(Character));
_cells.get(reinterpret_cast<char*>(res), count * sizeof(Character), startOfLine(lineno) + colno * sizeof(Character));
}
void HistoryScrollFile::addCells(const Character text[], int count)
{
_cells.add((char*)text, count * sizeof(Character));
_cells.add(reinterpret_cast<const char*>(text), count * sizeof(Character));
}
void HistoryScrollFile::addLine(bool previousWrapped)
{
qint64 locn = _cells.len();
_index.add((char *)&locn, sizeof(qint64));
_index.add(reinterpret_cast<char *>(&locn), sizeof(qint64));
unsigned char flags = previousWrapped ? 0x01 : 0x00;
_lineflags.add((char *)&flags, sizeof(char));
_lineflags.add(reinterpret_cast<char *>(&flags), sizeof(char));
}
// History Scroll None //////////////////////////////////////
......@@ -443,9 +443,9 @@ CompactHistoryLine::CompactHistoryLine(const TextLine &line, CompactHistoryBlock
}
////qDebug() << "number of different formats in string: " << _formatLength;
_formatArray = (CharacterFormat *)_blockListRef.allocate(sizeof(CharacterFormat) * _formatLength);
_formatArray = static_cast<CharacterFormat *>(_blockListRef.allocate(sizeof(CharacterFormat) * _formatLength));
Q_ASSERT(_formatArray != nullptr);
_text = (quint16 *)_blockListRef.allocate(sizeof(quint16) * line.size());
_text = static_cast<quint16 *>(_blockListRef.allocate(sizeof(quint16) * line.size()));
Q_ASSERT(_text != nullptr);
_length = line.size();
......@@ -577,7 +577,7 @@ void CompactHistoryScroll::getCells(int lineNumber, int startColumn, int count,
Q_ASSERT(lineNumber < _lines.size());
CompactHistoryLine *line = _lines[lineNumber];
Q_ASSERT(startColumn >= 0);
Q_ASSERT((unsigned int)startColumn <= line->getLength() - count);
Q_ASSERT(static_cast<unsigned int>(startColumn) <= line->getLength() - count);
line->getCharacters(buffer, count, startColumn);
}
......
......@@ -206,7 +206,7 @@ class CompactHistoryBlock
public:
CompactHistoryBlock() :
_blockLength(4096 * 64), // 256kb
_head((quint8 *)mmap(0, _blockLength, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0)),
_head(static_cast<quint8 *>(mmap(0, _blockLength, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0))),
_tail(0),
_blockStart(0),
_allocCount(0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment