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)
|
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);
|
QStandardItem *item = model->itemFromIndex(index);
|
||||||
|
|
||||||
if (!item) {
|
if (!item) {
|
||||||
|
|
|
@ -382,7 +382,7 @@ QChartView *StatsDialog::createChart(const QString &statsFile, const QString &to
|
||||||
qreal maxY = 0;
|
qreal maxY = 0;
|
||||||
for (QAbstractSeries *s : chart->series()) {
|
for (QAbstractSeries *s : chart->series()) {
|
||||||
s->attachAxis(axisY);
|
s->attachAxis(axisY);
|
||||||
if (QLineSeries *ls = dynamic_cast<QLineSeries*>(s)) {
|
if (const QLineSeries *ls = dynamic_cast<const QLineSeries*>(s)) {
|
||||||
for (QPointF p : ls->points()) {
|
for (QPointF p : ls->points()) {
|
||||||
if (p.y() > maxY)
|
if (p.y() > maxY)
|
||||||
maxY = p.y();
|
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();
|
const std::map<std::string, std::list<const CTU::FileInfo::CallBase *>> callsMap = ctu->getCallsMap();
|
||||||
|
|
||||||
for (Check::FileInfo *fi1 : fileInfo) {
|
for (Check::FileInfo *fi1 : fileInfo) {
|
||||||
const MyFileInfo *fi = dynamic_cast<MyFileInfo*>(fi1);
|
const MyFileInfo *fi = dynamic_cast<const MyFileInfo*>(fi1);
|
||||||
if (!fi)
|
if (!fi)
|
||||||
continue;
|
continue;
|
||||||
for (const CTU::FileInfo::UnsafeUsage &unsafeUsage : fi->unsafeArrayIndex)
|
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;
|
std::unordered_map<std::string, MyFileInfo::NameLoc> all;
|
||||||
|
|
||||||
for (Check::FileInfo *fi1 : fileInfo) {
|
for (Check::FileInfo *fi1 : fileInfo) {
|
||||||
const MyFileInfo *fi = dynamic_cast<MyFileInfo*>(fi1);
|
const MyFileInfo *fi = dynamic_cast<const MyFileInfo*>(fi1);
|
||||||
if (!fi)
|
if (!fi)
|
||||||
continue;
|
continue;
|
||||||
for (const MyFileInfo::NameLoc &nameLoc : fi->classDefinitions) {
|
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();
|
const std::map<std::string, std::list<const CTU::FileInfo::CallBase *>> callsMap = ctu->getCallsMap();
|
||||||
|
|
||||||
for (Check::FileInfo *fi1 : fileInfo) {
|
for (Check::FileInfo *fi1 : fileInfo) {
|
||||||
const MyFileInfo *fi = dynamic_cast<MyFileInfo*>(fi1);
|
const MyFileInfo *fi = dynamic_cast<const MyFileInfo*>(fi1);
|
||||||
if (!fi)
|
if (!fi)
|
||||||
continue;
|
continue;
|
||||||
for (const CTU::FileInfo::UnsafeUsage &unsafeUsage : fi->unsafeUsage) {
|
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();
|
const std::map<std::string, std::list<const CTU::FileInfo::CallBase *>> callsMap = ctu->getCallsMap();
|
||||||
|
|
||||||
for (Check::FileInfo *fi1 : fileInfo) {
|
for (Check::FileInfo *fi1 : fileInfo) {
|
||||||
const MyFileInfo *fi = dynamic_cast<MyFileInfo*>(fi1);
|
const MyFileInfo *fi = dynamic_cast<const MyFileInfo*>(fi1);
|
||||||
if (!fi)
|
if (!fi)
|
||||||
continue;
|
continue;
|
||||||
for (const CTU::FileInfo::UnsafeUsage &unsafeUsage : fi->unsafeUsage) {
|
for (const CTU::FileInfo::UnsafeUsage &unsafeUsage : fi->unsafeUsage) {
|
||||||
|
|
Loading…
Reference in New Issue