Commit 94f5aaf8 authored by Filip Gawin's avatar Filip Gawin
Browse files

Remove redundant and c style casts

Only reinterpret cast was needed for:
`reinterpret_cast<qptrdiff>(doc)`
parent 5385c9ff
......@@ -267,7 +267,7 @@ void KateFileTree::contextMenuEvent(QContextMenuEvent *event)
void KateFileTree::slotFixOpenWithMenu()
{
QMenu *menu = (QMenu *)sender();
QMenu *menu = static_cast<QMenu *>(sender());
menu->clear();
KTextEditor::Document *doc = model()->data(m_indexContextMenu, KateFileTreeModel::DocumentRole).value<KTextEditor::Document *>();
......
......@@ -81,9 +81,9 @@ KateFileTreeConfigPage::KateFileTreeConfigPage(QWidget *parent, KateFileTreePlug
cmbSort = new KComboBox(this);
lo2->addWidget(cmbSort);
lSort->setBuddy(cmbSort);
cmbSort->addItem(i18n("Opening Order"), (int)KateFileTreeModel::OpeningOrderRole);
cmbSort->addItem(i18n("Document Name"), (int)Qt::DisplayRole);
cmbSort->addItem(i18n("Url"), (int)KateFileTreeModel::PathRole);
cmbSort->addItem(i18n("Opening Order"), static_cast<int>(KateFileTreeModel::OpeningOrderRole));
cmbSort->addItem(i18n("Document Name"), static_cast<int>(Qt::DisplayRole));
cmbSort->addItem(i18n("Url"), static_cast<int>(KateFileTreeModel::PathRole));
// view mode
QHBoxLayout *lo3 = new QHBoxLayout;
......
......@@ -116,7 +116,7 @@ QDebug operator<<(QDebug dbg, ProxyItem *item)
const void *parent = static_cast<void *>(item->parent());
dbg.nospace() << "ProxyItem(" << (void *)item << ",";
dbg.nospace() << "ProxyItem(" << item << ",";
dbg.nospace() << parent << "," << item->row() << ",";
dbg.nospace() << item->doc() << "," << item->path() << ") ";
return dbg.maybeSpace();
......@@ -144,7 +144,7 @@ QDebug operator<<(QDebug dbg, ProxyItemDir *item)
const void *parent = static_cast<void *>(item->parent());
dbg.nospace() << "ProxyItemDir(" << (void *)item << ",";
dbg.nospace() << "ProxyItemDir(" << item << ",";
dbg.nospace() << parent << "," << item->row() << ",";
dbg.nospace() << item->path() << ", children:" << item->childCount() << ") ";
return dbg.maybeSpace();
......
......@@ -467,7 +467,7 @@ void ConfigView::slotBrowseExec()
exe = view->document()->url().toLocalFile();
}
}
m_executable->setText(QFileDialog::getOpenFileName((QWidget *)nullptr, QString(), exe, QStringLiteral("application/x-executable")));
m_executable->setText(QFileDialog::getOpenFileName(nullptr, QString(), exe, QStringLiteral("application/x-executable")));
}
void ConfigView::slotBrowseDir()
......
......@@ -609,7 +609,7 @@ QString KatePluginGDBView::currentWord()
}
startPos--;
}
while (endPos < (int)linestr.length() &&
while (endPos < linestr.length() &&
(linestr[endPos].isLetterOrNumber() || linestr[endPos] == QLatin1Char('_') || ((endPos < lindex - 1) && (linestr[endPos] == QLatin1Char('.')) && !linestr[endPos + 1].isSpace()) ||
((endPos < lindex - 2) && (linestr[endPos] == QLatin1Char('-')) && (linestr[endPos + 1] == QLatin1Char('>')) && !linestr[endPos + 2].isSpace()) ||
((endPos > 1) && (linestr[endPos - 1] == QLatin1Char('-')) && (linestr[endPos] == QLatin1Char('>'))))) {
......
......@@ -385,7 +385,7 @@ QString KateCTagsView::currentWord()
while (startPos >= 0 && (linestr[startPos].isLetterOrNumber() || (linestr[startPos] == QLatin1Char(':') && includeColon) || linestr[startPos] == QLatin1Char('_') || linestr[startPos] == QLatin1Char('~'))) {
startPos--;
}
while (endPos < (int)linestr.length() && (linestr[endPos].isLetterOrNumber() || (linestr[endPos] == QLatin1Char(':') && includeColon) || linestr[endPos] == QLatin1Char('_'))) {
while (endPos < linestr.length() && (linestr[endPos].isLetterOrNumber() || (linestr[endPos] == QLatin1Char(':') && includeColon) || linestr[endPos] == QLatin1Char('_'))) {
endPos++;
}
if (startPos == endPos) {
......
......@@ -112,7 +112,7 @@ QModelIndex TargetModel::copyTargetOrSet(const QModelIndex &index)
quint32 rootRow = index.internalId();
if (rootRow == InvalidIndex) {
rootRow = index.row();
if (m_targets.count() <= (int)rootRow)
if (m_targets.count() <= static_cast<int>(rootRow))
return QModelIndex();
beginInsertRows(QModelIndex(), m_targets.count(), m_targets.count());
......@@ -132,7 +132,7 @@ QModelIndex TargetModel::copyTargetOrSet(const QModelIndex &index)
;
}
if (m_targets.count() <= (int)rootRow)
if (m_targets.count() <= static_cast<int>(rootRow))
return QModelIndex();
if (index.row() < 0)
return QModelIndex();
......@@ -179,9 +179,9 @@ void TargetModel::deleteItem(const QModelIndex &index)
beginRemoveRows(index.parent(), index.row(), index.row());
m_targets.removeAt(index.row());
endRemoveRows();
} else if (index.internalId() < (quint64)m_targets.size() && m_targets[(int)index.internalId()].commands.count() > index.row()) {
} else if (index.internalId() < static_cast<quint64>(m_targets.size()) && m_targets[static_cast<int>(index.internalId())].commands.count() > index.row()) {
beginRemoveRows(index.parent(), index.row(), index.row());
m_targets[(int)index.internalId()].commands.removeAt(index.row());
m_targets[static_cast<int>(index.internalId())].commands.removeAt(index.row());
endRemoveRows();
}
}
......@@ -210,11 +210,11 @@ const QString TargetModel::command(const QModelIndex &itemIndex) const
cRow = 0;
}
if ((int)rRow >= m_targets.count()) {
if (static_cast<int>(rRow) >= m_targets.count()) {
return QString();
}
if (cRow < 0 || cRow >= m_targets[(int)rRow].commands.count()) {
if (cRow < 0 || cRow >= m_targets[static_cast<int>(rRow)].commands.count()) {
return QString();
}
......@@ -233,15 +233,15 @@ const QString TargetModel::cmdName(const QModelIndex &itemIndex) const
cRow = 0;
}
if ((int)rRow >= m_targets.count()) {
if (static_cast<int>(rRow) >= m_targets.count()) {
return QString();
}
if (cRow < 0 || cRow >= m_targets[(int)rRow].commands.count()) {
if (cRow < 0 || cRow >= m_targets[static_cast<int>(rRow)].commands.count()) {
return QString();
}
return m_targets[(int)rRow].commands[cRow].first;
return m_targets[static_cast<int>(rRow)].commands[cRow].first;
}
const QString TargetModel::workDir(const QModelIndex &itemIndex) const
......@@ -256,11 +256,11 @@ const QString TargetModel::workDir(const QModelIndex &itemIndex) const
cRow = 0;
}
if ((int)rRow >= m_targets.count()) {
if (static_cast<int>(rRow) >= m_targets.count()) {
return QString();
}
return m_targets[(int)rRow].workDir;
return m_targets[static_cast<int>(rRow)].workDir;
}
const QString TargetModel::targetName(const QModelIndex &itemIndex) const
......@@ -275,11 +275,11 @@ const QString TargetModel::targetName(const QModelIndex &itemIndex) const
cRow = 0;
}
if ((int)rRow >= m_targets.count()) {
if (static_cast<int>(rRow) >= m_targets.count()) {
return QString();
}
return m_targets[(int)rRow].name;
return m_targets[static_cast<int>(rRow)].name;
}
QVariant TargetModel::data(const QModelIndex &index, int role) const
......
......@@ -522,7 +522,7 @@ void KateBuildView::addMarks(KTextEditor::Document *doc, bool mark)
auto line = item->data(1, Qt::UserRole).toInt();
if (mark) {
ErrorCategory category = (ErrorCategory)item->data(0, ErrorRole).toInt();
ErrorCategory category = static_cast<ErrorCategory>(item->data(0, ErrorRole).toInt());
KTextEditor::MarkInterface::MarkTypes markType {};
switch (category) {
......
......@@ -78,7 +78,7 @@ KateSQLView::KateSQLView(KTextEditor::Plugin *plugin, KTextEditor::MainWindow *m
m_mainWindow->guiFactory()->addClient(this);
QMenu *sqlMenu = (QMenu *)factory()->container(QStringLiteral("SQL"), this);
QMenu *sqlMenu = static_cast<QMenu *>(factory()->container(QStringLiteral("SQL"), this));
m_connectionsGroup = new QActionGroup(sqlMenu);
m_connectionsGroup->setExclusive(true);
......@@ -153,7 +153,7 @@ void KateSQLView::slotSQLMenuAboutToShow()
{
qDeleteAll(m_connectionsGroup->actions());
QMenu *sqlMenu = (QMenu *)factory()->container(QStringLiteral("SQL"), this);
QMenu *sqlMenu = static_cast<QMenu *>(factory()->container(QStringLiteral("SQL"), this));
QAction *before = action("query_run");
QAbstractItemModel *model = m_manager->connectionModel();
......
......@@ -79,28 +79,28 @@ class KindEnum
{
public:
enum _kind {
Text = (int)LSPDocumentHighlightKind::Text,
Read = (int)LSPDocumentHighlightKind::Read,
Write = (int)LSPDocumentHighlightKind::Write,
Error = 10 + (int)LSPDiagnosticSeverity::Error,
Warning = 10 + (int)LSPDiagnosticSeverity::Warning,
Information = 10 + (int)LSPDiagnosticSeverity::Information,
Hint = 10 + (int)LSPDiagnosticSeverity::Hint,
Text = static_cast<int>(LSPDocumentHighlightKind::Text),
Read = static_cast<int>(LSPDocumentHighlightKind::Read),
Write = static_cast<int>(LSPDocumentHighlightKind::Write),
Error = 10 + static_cast<int>(LSPDiagnosticSeverity::Error),
Warning = 10 + static_cast<int>(LSPDiagnosticSeverity::Warning),
Information = 10 + static_cast<int>(LSPDiagnosticSeverity::Information),
Hint = 10 + static_cast<int>(LSPDiagnosticSeverity::Hint),
Related
};
KindEnum(int v)
{
m_value = (_kind)v;
m_value = _kind(v);
}
KindEnum(LSPDocumentHighlightKind hl)
: KindEnum((_kind)(hl))
: KindEnum(static_cast<_kind>(hl))
{
}
KindEnum(LSPDiagnosticSeverity sev)
: KindEnum(_kind(10 + (int)sev))
: KindEnum(_kind(10 + static_cast<int>(sev)))
{
}
......@@ -555,7 +555,7 @@ public:
KTextEditor::Range range = item->data(RangeData::RangeRole).value<LSPRange>();
auto line = range.start().line();
RangeData::KindEnum kind = (RangeData::KindEnum)item->data(RangeData::KindRole).toInt();
RangeData::KindEnum kind = RangeData::KindEnum(item->data(RangeData::KindRole).toInt());
KTextEditor::Attribute::Ptr attr(new KTextEditor::Attribute());
......@@ -908,7 +908,7 @@ public:
QVariant vrange;
vrange.setValue(range);
item->setData(vrange, RangeData::RangeRole);
item->setData((int)kind, RangeData::KindRole);
item->setData(static_cast<int>(kind), RangeData::KindRole);
}
void makeTree(const QVector<RangeItem> &locations, const LSPClientRevisionSnapshot *snapshot)
......
......@@ -107,7 +107,7 @@ static QJsonObject to_json(const LSPDiagnostic &diagnostic)
if (!diagnostic.code.isEmpty())
result[QStringLiteral("code")] = diagnostic.code;
if (diagnostic.severity != LSPDiagnosticSeverity::Unknown)
result[QStringLiteral("severity")] = (int)diagnostic.severity;
result[QStringLiteral("severity")] = static_cast<int>(diagnostic.severity);
if (!diagnostic.source.isEmpty())
result[QStringLiteral("source")] = diagnostic.source;
QJsonArray relatedInfo;
......@@ -273,7 +273,7 @@ static void from_json(LSPDocumentOnTypeFormattingOptions &options, const QJsonVa
static void from_json(LSPServerCapabilities &caps, const QJsonObject &json)
{
auto sync = json.value(QStringLiteral("textDocumentSync"));
caps.textDocumentSync = (LSPDocumentSyncKind)(sync.isObject() ? sync.toObject().value(QStringLiteral("change")) : sync).toInt((int)LSPDocumentSyncKind::None);
caps.textDocumentSync = static_cast<LSPDocumentSyncKind>((sync.isObject() ? sync.toObject().value(QStringLiteral("change")) : sync).toInt(static_cast<int>(LSPDocumentSyncKind::None)));
caps.hoverProvider = json.value(QStringLiteral("hoverProvider")).toBool();
from_json(caps.completionProvider, json.value(QStringLiteral("completionProvider")));
from_json(caps.signatureHelpProvider, json.value(QStringLiteral("signatureHelpProvider")));
......@@ -356,7 +356,7 @@ static LSPDocumentHighlight parseDocumentHighlight(const QJsonValue &result)
{
auto hover = result.toObject();
auto range = parseRange(hover.value(MEMBER_RANGE).toObject());
auto kind = (LSPDocumentHighlightKind)hover.value(MEMBER_KIND).toInt((int)LSPDocumentHighlightKind::Text); // default is
auto kind = static_cast<LSPDocumentHighlightKind>(hover.value(MEMBER_KIND).toInt(static_cast<int>(LSPDocumentHighlightKind::Text))); // default is
// DocumentHighlightKind.Text
return {range, kind};
}
......@@ -455,7 +455,7 @@ static QList<LSPSymbolInformation> parseDocumentSymbols(const QJsonValue &result
auto list = parent ? &parent->children : &ret;
if (isPositionValid(range.start()) && isPositionValid(range.end())) {
auto name = symbol.value(QStringLiteral("name")).toString();
auto kind = (LSPSymbolKind)symbol.value(MEMBER_KIND).toInt();
auto kind = static_cast<LSPSymbolKind>(symbol.value(MEMBER_KIND).toInt());
auto detail = symbol.value(MEMBER_DETAIL).toString();
list->push_back({name, kind, range, detail});
index.insert(name, &list->back());
......@@ -505,7 +505,7 @@ static QList<LSPCompletionItem> parseDocumentCompletion(const QJsonValue &result
auto insertText = item.value(QStringLiteral("insertText")).toString();
if (insertText.isEmpty())
insertText = label;
auto kind = (LSPCompletionItemKind)item.value(MEMBER_KIND).toInt();
auto kind = static_cast<LSPCompletionItemKind>(item.value(MEMBER_KIND).toInt());
ret.push_back({label, kind, detail, doc, sortText, insertText});
}
return ret;
......@@ -596,7 +596,7 @@ static QList<LSPDiagnostic> parseDiagnostics(const QJsonArray &result)
for (const auto &vdiag : result) {
auto diag = vdiag.toObject();
auto range = parseRange(diag.value(MEMBER_RANGE).toObject());
auto severity = (LSPDiagnosticSeverity)diag.value(QStringLiteral("severity")).toInt();
auto severity = static_cast<LSPDiagnosticSeverity>(diag.value(QStringLiteral("severity")).toInt());
auto code = diag.value(QStringLiteral("code")).toString();
auto source = diag.value(QStringLiteral("source")).toString();
auto message = diag.value(MEMBER_MESSAGE).toString();
......@@ -865,7 +865,7 @@ private:
static QJsonObject init_error(const LSPErrorCode code, const QString &msg)
{
return QJsonObject {{MEMBER_ERROR, QJsonObject {{MEMBER_CODE, (int)code}, {MEMBER_MESSAGE, msg}}}};
return QJsonObject {{MEMBER_ERROR, QJsonObject {{MEMBER_CODE, static_cast<int>(code)}, {MEMBER_MESSAGE, msg}}}};
}
static QJsonObject init_request(const QString &method, const QJsonObject &params = QJsonObject())
......
......@@ -37,7 +37,7 @@ void KatePluginSymbolViewerView::parseBashSymbols(void)
QTreeWidgetItem *funcNode = nullptr;
QTreeWidgetItem *lastFuncNode = nullptr;
QPixmap func((const char **)class_xpm);
QPixmap func(class_xpm);
// It is necessary to change names
m_func->setText(i18n("Show Functions"));
......
......@@ -27,10 +27,10 @@ void KatePluginSymbolViewerView::parseCppSymbols(void)
char mclass = 0, block = 0, comment = 0; // comment: 0-no comment 1-inline comment 2-multiline comment 3-string
char macro = 0 /*, macro_pos = 0*/, func_close = 0;
bool structure = false;
QPixmap cls((const char **)class_xpm);
QPixmap sct((const char **)struct_xpm);
QPixmap mcr((const char **)macro_xpm);
QPixmap mtd((const char **)method_xpm);
QPixmap cls(class_xpm);
QPixmap sct(struct_xpm);
QPixmap mcr(macro_xpm);
QPixmap mtd(method_xpm);
// It is necessary to change names to defaults
m_macro->setText(i18n("Show Macros"));
......@@ -72,7 +72,7 @@ void KatePluginSymbolViewerView::parseCppSymbols(void)
func_close = 0;
if ((cl.length() >= 2) && (cl.at(0) == QLatin1Char('/') && cl.at(1) == QLatin1Char('/')))
continue;
if (cl.indexOf(QLatin1String("/*")) == 0 && (cl.indexOf(QLatin1String("*/")) == ((signed)cl.length() - 2)) && graph == 0)
if (cl.indexOf(QLatin1String("/*")) == 0 && (cl.indexOf(QLatin1String("*/")) == (cl.length() - 2)) && graph == 0)
continue; // workaround :(
if (cl.indexOf(QLatin1String("/*")) >= 0 && graph == 0)
comment = 1;
......@@ -255,7 +255,7 @@ void KatePluginSymbolViewerView::parseCppSymbols(void)
break;
}
if ((cl.at(j) == QLatin1Char('{') && structure == false && cl.indexOf(QLatin1Char(';')) < 0) || (cl.at(j) == QLatin1Char('{') && structure == false && cl.indexOf(QLatin1Char('}')) > (int)j)) {
if ((cl.at(j) == QLatin1Char('{') && structure == false && cl.indexOf(QLatin1Char(';')) < 0) || (cl.at(j) == QLatin1Char('{') && structure == false && cl.indexOf(QLatin1Char('}')) > j)) {
stripped.replace(0x9, QLatin1String(" "));
if (m_func->isChecked()) {
QString strippedWithTypes = stripped;
......
......@@ -40,8 +40,8 @@ void KatePluginSymbolViewerView::parseEcmaSymbols(void)
// a list of inserted nodes with the index being the brace depth at insertion
QList<QTreeWidgetItem *> nodes;
QPixmap cls((const char **)class_xpm);
QPixmap mtd((const char **)method_xpm);
QPixmap cls(class_xpm);
QPixmap mtd(method_xpm);
QTreeWidgetItem *node = nullptr;
if (m_treeOn->isChecked()) {
......
......@@ -35,9 +35,9 @@ void KatePluginSymbolViewerView::parseFortranSymbols(void)
QTreeWidgetItem *subrNode = nullptr, *funcNode = nullptr, *modNode = nullptr;
QTreeWidgetItem *lastSubrNode = nullptr, *lastFuncNode = nullptr, *lastModNode = nullptr;
QPixmap func((const char **)class_xpm);
QPixmap subr((const char **)macro_xpm);
QPixmap mod((const char **)struct_xpm);
QPixmap func(class_xpm);
QPixmap subr(macro_xpm);
QPixmap mod(struct_xpm);
// It is necessary to change names
m_macro->setText(i18n("Show Subroutines"));
......
......@@ -26,10 +26,10 @@ void KatePluginSymbolViewerView::parsePerlSymbols(void)
QString cl; // Current Line
QString stripped;
char comment = 0;
QPixmap cls((const char **)class_xpm);
QPixmap sct((const char **)struct_xpm);
QPixmap mcr((const char **)macro_xpm);
QPixmap cls_int((const char **)class_int_xpm);
QPixmap cls(class_xpm);
QPixmap sct(struct_xpm);
QPixmap mcr(macro_xpm);
QPixmap cls_int(class_int_xpm);
QTreeWidgetItem *node = nullptr;
QTreeWidgetItem *mcrNode = nullptr, *sctNode = nullptr, *clsNode = nullptr;
QTreeWidgetItem *lastMcrNode = nullptr, *lastSctNode = nullptr, *lastClsNode = nullptr;
......
......@@ -21,12 +21,12 @@ void KatePluginSymbolViewerView::parsePhpSymbols(void)
{
if (m_mainWindow->activeView()) {
QString line, lineWithliterals;
QPixmap namespacePix((const char **)class_int_xpm);
QPixmap definePix((const char **)macro_xpm);
QPixmap varPix((const char **)struct_xpm);
QPixmap classPix((const char **)class_xpm);
QPixmap constPix((const char **)macro_xpm);
QPixmap functionPix((const char **)method_xpm);
QPixmap namespacePix(class_int_xpm);
QPixmap definePix(macro_xpm);
QPixmap varPix(struct_xpm);
QPixmap classPix(class_xpm);
QPixmap constPix(macro_xpm);
QPixmap functionPix(method_xpm);
QTreeWidgetItem *node = nullptr;
QTreeWidgetItem *namespaceNode = nullptr, *defineNode = nullptr, *classNode = nullptr, *functionNode = nullptr;
QTreeWidgetItem *lastNamespaceNode = nullptr, *lastDefineNode = nullptr, *lastClassNode = nullptr, *lastFunctionNode = nullptr;
......
......@@ -119,7 +119,7 @@ KatePluginSymbolViewerView::KatePluginSymbolViewerView(KatePluginSymbolViewer *p
m_currItemTimer.setSingleShot(true);
connect(&m_currItemTimer, &QTimer::timeout, this, &KatePluginSymbolViewerView::updateCurrTreeItem);
QPixmap cls((const char **)class_xpm);
QPixmap cls(class_xpm);
m_toolview = m_mainWindow->createToolView(plugin, QStringLiteral("kate_plugin_symbolviewer"), KTextEditor::MainWindow::Left, cls, i18n("Symbol List"));
......@@ -404,7 +404,7 @@ KTextEditor::ConfigPage *KatePluginSymbolViewer::configPage(int, QWidget *parent
p->treeView->setChecked(config.readEntry(QStringLiteral("TreeView"), false));
p->sortSymbols->setChecked(config.readEntry(QStringLiteral("SortSymbols"), false));
connect(p, &KatePluginSymbolViewerConfigPage::configPageApplyRequest, this, &KatePluginSymbolViewer::applyConfig);
return (KTextEditor::ConfigPage *)p;
return static_cast<KTextEditor::ConfigPage *>(p);
}
void KatePluginSymbolViewer::applyConfig(KatePluginSymbolViewerConfigPage *p)
......@@ -475,7 +475,7 @@ QString KatePluginSymbolViewerConfigPage::fullName() const
}
QIcon KatePluginSymbolViewerConfigPage::icon() const
{
return QPixmap((const char **)class_xpm);
return QPixmap(class_xpm);
}
void KatePluginSymbolViewerConfigPage::apply()
......
......@@ -25,9 +25,9 @@ void KatePluginSymbolViewerView::parsePythonSymbols(void)
m_func->setText(i18n("Show Classes"));
QString cl; // Current Line
QPixmap cls((const char **)class_xpm);
QPixmap mtd((const char **)method_xpm);
QPixmap mcr((const char **)macro_xpm);
QPixmap cls(class_xpm);
QPixmap mtd(method_xpm);
QPixmap mcr(macro_xpm);
int in_class = 0, state = 0, j;
QString name;
......
......@@ -25,9 +25,9 @@ void KatePluginSymbolViewerView::parseRubySymbols(void)
m_func->setText(i18n("Show Classes"));
QString cl; // Current Line
QPixmap cls((const char **)class_xpm);
QPixmap mtd((const char **)method_xpm);
QPixmap mcr((const char **)macro_xpm);
QPixmap cls(class_xpm);
QPixmap mtd(method_xpm);
QPixmap mcr(macro_xpm);
int i;
QString name;
......
......@@ -34,8 +34,8 @@ void KatePluginSymbolViewerView::parseTclSymbols(void)
QTreeWidgetItem *mcrNode = nullptr, *clsNode = nullptr;
QTreeWidgetItem *lastMcrNode = nullptr, *lastClsNode = nullptr;
QPixmap mcr((const char **)macro_xpm);
QPixmap cls((const char **)class_xpm);
QPixmap mcr(macro_xpm);
QPixmap cls(class_xpm);
if (m_treeOn->isChecked()) {
clsNode = new QTreeWidgetItem(m_symbols, QStringList(i18n("Functions")));
......
......@@ -32,8 +32,8 @@ void KatePluginSymbolViewerView::parseXMLSymbols(void)
char comment = 0;
int i;
QPixmap cls((const char **)class_xpm);
QPixmap sct((const char **)struct_xpm);
QPixmap cls(class_xpm);
QPixmap sct(struct_xpm);
QTreeWidgetItem *node = nullptr;
QTreeWidgetItem *topNode = nullptr;
......
......@@ -32,10 +32,10 @@ void KatePluginSymbolViewerView::parseXsltSymbols(void)
char templ = 0;
int i;
QPixmap cls((const char **)class_xpm);
QPixmap sct((const char **)struct_xpm);
QPixmap mcr((const char **)macro_xpm);
QPixmap cls_int((const char **)class_int_xpm);
QPixmap cls(class_xpm);
QPixmap sct(struct_xpm);
QPixmap mcr(macro_xpm);
QPixmap cls_int(class_int_xpm);
QTreeWidgetItem *node = nullptr;
QTreeWidgetItem *mcrNode = nullptr, *sctNode = nullptr, *clsNode = nullptr;
......
......@@ -309,7 +309,7 @@ QModelIndex PluginKateXMLToolsCompletionModel::index(const int row, const int co
}
if (parent.internalId() == groupNode) { // Is this a group node?
if (0 <= row && row < m_allowed.size()) { // Make sure to return only valid indices
return createIndex(row, column, (void *)nullptr); // Just return a leaf-level index
return createIndex(row, column, nullptr); // Just return a leaf-level index
}
}
// Leaf node has no children... nothing to return
......@@ -658,7 +658,7 @@ void PluginKateXMLToolsCompletionModel::executeCompletionItem(KTextEditor::View
}
// find right quote:
for (endAttValue = col; endAttValue <= (uint)lineStr.length(); endAttValue++) {
for (endAttValue = col; endAttValue <= static_cast<uint>(lineStr.length()); endAttValue++) {
QString ch = lineStr.mid(endAttValue - 1, 1);
if (isQuote(ch)) {
break;
......
......@@ -81,7 +81,7 @@ QString KateAppAdaptor::tokenOpenUrl(const QString &url, const QString &encoding
if (!doc) {
return QStringLiteral("ERROR");
}
return QStringLiteral("%1").arg((qptrdiff)doc);
return QStringLiteral("%1").arg(reinterpret_cast<qptrdiff>(doc));
}
QString KateAppAdaptor::tokenOpenUrl(const QString &url, const QString &encoding, bool isTempFile)
......@@ -91,7 +91,7 @@ QString KateAppAdaptor::tokenOpenUrl(const QString &url, const QString &encoding
if (!doc) {
return QStringLiteral("ERROR");
}
return QStringLiteral("%1").arg((qptrdiff)doc);
return QStringLiteral("%1").arg(reinterpret_cast<qptrdiff>(doc));
}
QString KateAppAdaptor::tokenOpenUrlAt(const QString &url, int line, int column, const QString &encoding, bool isTempFile)
......@@ -102,7 +102,7 @@ QString KateAppAdaptor::tokenOpenUrlAt(const QString &url, int line, int column,
return QStringLiteral("ERROR");
}
m_app->setCursor(line, column);
return QStringLiteral("%1").arg((qptrdiff)doc);
return QStringLiteral("%1").arg(reinterpret_cast<qptrdiff>(doc));
}
//--------
......
......@@ -246,7 +246,7 @@ bool KateDocManager::closeDocuments(const QList<KTextEditor::Document *> &docume
}
}
KateApp::self()->emitDocumentClosed(QString::number((qptrdiff)doc));
KateApp::self()->emitDocumentClosed(QString::number(reinterpret_cast<qptrdiff>(doc)));
// document will be deleted, soon
emit documentWillBeDeleted(doc);
......