add/preserve `const` in `dynamic_cast` (#4655)
This commit is contained in:
parent
9da574f4a0
commit
6fedbb4f77
|
@ -373,7 +373,7 @@ void ResultsView::readErrorsXml(const QString &filename)
|
|||
|
||||
void ResultsView::updateDetails(const QModelIndex &index)
|
||||
{
|
||||
QStandardItemModel *model = qobject_cast<QStandardItemModel*>(mUI->mTree->model());
|
||||
const QStandardItemModel *model = qobject_cast<const QStandardItemModel*>(mUI->mTree->model());
|
||||
QStandardItem *item = model->itemFromIndex(index);
|
||||
|
||||
if (!item) {
|
||||
|
|
|
@ -382,7 +382,7 @@ QChartView *StatsDialog::createChart(const QString &statsFile, const QString &to
|
|||
qreal maxY = 0;
|
||||
for (QAbstractSeries *s : chart->series()) {
|
||||
s->attachAxis(axisY);
|
||||
if (QLineSeries *ls = dynamic_cast<QLineSeries*>(s)) {
|
||||
if (const QLineSeries *ls = dynamic_cast<const QLineSeries*>(s)) {
|
||||
for (QPointF p : ls->points()) {
|
||||
if (p.y() > maxY)
|
||||
maxY = p.y();
|
||||
|
|
|
@ -960,7 +960,7 @@ bool CheckBufferOverrun::analyseWholeProgram(const CTU::FileInfo *ctu, const std
|
|||
const std::map<std::string, std::list<const CTU::FileInfo::CallBase *>> callsMap = ctu->getCallsMap();
|
||||
|
||||
for (Check::FileInfo *fi1 : fileInfo) {
|
||||
const MyFileInfo *fi = dynamic_cast<MyFileInfo*>(fi1);
|
||||
const MyFileInfo *fi = dynamic_cast<const MyFileInfo*>(fi1);
|
||||
if (!fi)
|
||||
continue;
|
||||
for (const CTU::FileInfo::UnsafeUsage &unsafeUsage : fi->unsafeArrayIndex)
|
||||
|
|
|
@ -3199,7 +3199,7 @@ bool CheckClass::analyseWholeProgram(const CTU::FileInfo *ctu, const std::list<C
|
|||
std::unordered_map<std::string, MyFileInfo::NameLoc> all;
|
||||
|
||||
for (Check::FileInfo *fi1 : fileInfo) {
|
||||
const MyFileInfo *fi = dynamic_cast<MyFileInfo*>(fi1);
|
||||
const MyFileInfo *fi = dynamic_cast<const MyFileInfo*>(fi1);
|
||||
if (!fi)
|
||||
continue;
|
||||
for (const MyFileInfo::NameLoc &nameLoc : fi->classDefinitions) {
|
||||
|
|
|
@ -597,7 +597,7 @@ bool CheckNullPointer::analyseWholeProgram(const CTU::FileInfo *ctu, const std::
|
|||
const std::map<std::string, std::list<const CTU::FileInfo::CallBase *>> callsMap = ctu->getCallsMap();
|
||||
|
||||
for (Check::FileInfo *fi1 : fileInfo) {
|
||||
const MyFileInfo *fi = dynamic_cast<MyFileInfo*>(fi1);
|
||||
const MyFileInfo *fi = dynamic_cast<const MyFileInfo*>(fi1);
|
||||
if (!fi)
|
||||
continue;
|
||||
for (const CTU::FileInfo::UnsafeUsage &unsafeUsage : fi->unsafeUsage) {
|
||||
|
|
|
@ -1703,7 +1703,7 @@ bool CheckUninitVar::analyseWholeProgram(const CTU::FileInfo *ctu, const std::li
|
|||
const std::map<std::string, std::list<const CTU::FileInfo::CallBase *>> callsMap = ctu->getCallsMap();
|
||||
|
||||
for (Check::FileInfo *fi1 : fileInfo) {
|
||||
const MyFileInfo *fi = dynamic_cast<MyFileInfo*>(fi1);
|
||||
const MyFileInfo *fi = dynamic_cast<const MyFileInfo*>(fi1);
|
||||
if (!fi)
|
||||
continue;
|
||||
for (const CTU::FileInfo::UnsafeUsage &unsafeUsage : fi->unsafeUsage) {
|
||||
|
|
Loading…
Reference in New Issue